Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Importing property files
Importing property files [message #1385427] Fri, 06 June 2014 11:06 Go to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Hello,


is it possible to read all properties from a specified .property file and import those as oomph-variables?

Example:
---------------
git-server=S001-02
project-git-url=http://${git-server}/r/Project
---------------

Thank you for the awesome tool!


Cheers,
Boris
Re: Importing property files [message #1385465 is a reply to message #1385427] Fri, 06 June 2014 15:16 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5590
Registered: July 2009
Senior Member
Hi Boris,

Thanks for the kudos ;-)

A VariableImportTask would be a reasonable addition. Note that a variable, i.e., the VariableTask, in contrast to most
other tasks, is an intrinsic facility. They undergo special treatment (and are even removed) by the performer before
isNeeded() is called on any task. That means all tasks that declare or induce variables must be implemented in the main
setup package; it's not possible to implement them in an extension package. Do you want to work on this new
VariableImportTask?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Am 06.06.2014 13:06, schrieb Boris Brodski:
> Hello,
>
>
> is it possible to read all properties from a specified .property file and import those as oomph-variables?
>
> Example:
> ---------------
> git-server=S001-02
> project-git-url=http://${git-server}/r/Project
> ---------------
>
> Thank you for the awesome tool!
>
>
> Cheers,
> Boris
Re: Importing property files [message #1385780 is a reply to message #1385465] Wed, 11 June 2014 08:03 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Hello Eike,


thank you for the quick response and explanations. I will look into the source code. Depending on the requirements of my project it may take some time though.

Cheers,
Boris
Re: Importing property files [message #1385795 is a reply to message #1385780] Wed, 11 June 2014 09:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26287
Registered: July 2009
Senior Member
Boris,

I expect something like this would be best implemented with a
specialized resource implementation that parses such a file into an EMF
model with some single placeholder root object (i.e., a
CompoundSetupTask)that contains VariableTask instances parsed from the
properties in the file. A "PropertyVariableTask" could then cross
resource contain the root object of that file so from a setup model
point of view. Something like that. It's not such a trivial problem to
solve...

But I wonder, are you looking at this as a one-time import facility or
are you wanting to maintain all such VariableTasks direct in that
property file because it's being used by some other software so you
don't want to maintain two versions of the information?


On 11/06/2014 10:03 AM, Boris Brodski wrote:
> Hello Eike,
>
>
> thank you for the quick response and explanations. I will look into
> the source code. Depending on the requirements of my project it may
> take some time though.
>
> Cheers,
> Boris
Re: Importing property files [message #1385798 is a reply to message #1385795] Wed, 11 June 2014 09:32 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Hello Ed,


I would like to load properties from a property file at the runtime (or at least update the property values at the runtime),
so I can maintain my properties for Ant, Maven, and Oomph at a single place. So, the second one in your question Smile

I understand your idea of implementing this, but I must admit, that I'm not currently able to write all this from scratch.

Could you just start implementing this by creating some key classes with empty methods (incl. test classes), that will provide
some kind of guide lines for me? We could maintain it as a Gerrit review or just push it to a Github repo.

Thank you!

Cheers,
Boris
Re: Importing property files [message #1385863 is a reply to message #1385798] Wed, 11 June 2014 17:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26287
Registered: July 2009
Senior Member
Boris,

When I get back from EclipseCon France at the end of next week, I'll
look at sketching something. Please open an enhancement request to
track the issue.


On 11/06/2014 11:32 AM, Boris Brodski wrote:
> Hello Ed,
>
>
> I would like to load properties from a property file at the runtime
> (or at least update the property values at the runtime),
> so I can maintain my properties for Ant, Maven, and Oomph at a single
> place. So, the second one in your question :)
>
> I understand your idea of implementing this, but I must admit, that
> I'm not currently able to write all this from scratch.
>
> Could you just start implementing this by creating some key classes
> with empty methods (incl. test classes), that will provide
> some kind of guide lines for me? We could maintain it as a Gerrit
> review or just push it to a Github repo.
>
> Thank you!
>
> Cheers,
> Boris
Re: Importing property files [message #1386053 is a reply to message #1385863] Fri, 13 June 2014 08:48 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Enhancement created: https://bugs.eclipse.org/bugs/show_bug.cgi?id=437347
Re: Importing property files [message #1400559 is a reply to message #1386053] Mon, 14 July 2014 11:37 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Hello Ed,

did you have time to make a progress on this one?


What do you think, will it be possible to clone a git project and then load a property file from the repository?

Background: I use DSL-plugin developed with Xtext. I would like to synchronize installed version of my DSL-plugin with one specified in the property file (in the source code repository). So if I checkout a branch, Oomph updates my DSL-Plugin (and probably Xtext) according to the version from the property file.

I implemented it myself, but my implementation some kind of to dirty Smile

I think, that this kind of functionality my be interesting for many other projects,
so converting (rewriting) my implementation to Oomph-plugin my be worse doing.


Thank you!


Cheers,
Boris
Re: Importing property files [message #1400592 is a reply to message #1400559] Mon, 14 July 2014 12:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26287
Registered: July 2009
Senior Member
Boris,

Comments below.

On 14/07/2014 1:37 PM, Boris Brodski wrote:
> Hello Ed,
>
> did you have time to make a progress on this one?
I've been prototyping a little, but then got side tracked (with making
sure that Oomph can install into Juno and Kepler).
>
>
> What do you think, will it be possible to clone a git project and then
> load a property file from the repository?
No. The problem is that variables are needed early during the
processing of the setup tasks themselves. The best that would be
possible would be an http link to the plain text view of the properties
file so that it's available while processing the tasks and preparing
them to perform.
>
> Background: I use DSL-plugin developed with Xtext. I would like to
> synchronize installed version of my DSL-plugin with one specified in
> the property file (in the source code repository). So if I checkout a
> branch, Oomph updates my DSL-Plugin (and probably Xtext) according to
> the version from the property file.
I see.
>
> I implemented it myself, but my implementation some kind of to dirty :)
What approach did you take?
>
> I think, that this kind of functionality my be interesting for many
> other projects,
> so converting (rewriting) my implementation to Oomph-plugin my be
> worse doing.
Are these property files used for other purposes or is it just intended
to be used by an Oomph *.set? If the later, I was exploring how to
provide kind of a "macro inclusion" capability in general; I'd need
something like this anyway to support reading a properties file as if it
contains a bunch of VariableTasks....
>
>
> Thank you!
>
>
> Cheers,
> Boris
Re: Importing property files [message #1400609 is a reply to message #1400592] Mon, 14 July 2014 12:57 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Hello Ed,


I use those property files for ant build, but this shouldn't be a problem. I'm perfectly OK with managing
versions in both *.property and *.setup files.

If I get your idea right, you propose to create and add to the git repo a new .setup file, that contains "P2 Director" entries with the plugins configuration needed for the current state of the project to build (in my case Xtext version + DSL version + update sites). Then you would just pass the "execution" to this file after git clone and project import are done. Checking out a branch and "Perform Setup task" should work then as well.

This sounds great!

What can I do to make it real? Smile


Cheers,
Boris


Re: Importing property files [message #1400625 is a reply to message #1400609] Mon, 14 July 2014 13:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26287
Registered: July 2009
Senior Member
Boris,

Comments below.

On 14/07/2014 2:57 PM, Boris Brodski wrote:
> Hello Ed,
>
>
> I use those property files for ant build, but this shouldn't be a
> problem. I'm perfectly OK with managing
> versions in both *.property and *.setup files.
It should be quite straightforward to register a resource factory that
reads a properties file and converts them to variable tasks... The
tricky part seems to be for which file extensions should we do that?
>
> If I get your idea right, you propose to create and add to the git
> repo a new .setup file, that contains "P2 Director" entries with the
> plugins configuration needed for the current state of the project to
> build (in my case Xtext version + DSL version + update sites).
I probably need a more complete mental picture of what you're trying to
accomplish. I would expect this is normally done by maintaining a
simple *.setup for the project and that you've have streams that contain
the variant parts. I.e., the different versions of tools that need to be
installed and the different update sites to use for the target
platform... I don't see where the need for a properties file kicks in.
> Then you would just pass the "execution" to this file after git clone
> and project import are done.
No, the tasks must be gathered and complete before you start executing
any tasks, so you can't have the situation where the tasks depend on
tasks that are only known after you've cloned.
> Checking out a branch and "Perform Setup task" should work then as well.
Typically we expect that the *.setup is maintained on the master branch
and that it has streams for the other branches and those specify what
should be done specifically for those branches.

I think it would be good if you outlined what you're trying to
accomplish so I can be sure you actually need something else or if
you're just not seeing how to exploit what's already there to achieve
your goal...
>
> This sounds great!
>
> What can I do to make it real? :)
>
>
> Cheers,
> Boris
>
>
>
Re: Importing property files [message #1403101 is a reply to message #1400625] Mon, 21 July 2014 11:34 Go to previous message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Please see https://www.eclipse.org/forums/index.php/m/1403100/#msg_1403100
Previous Topic:Variable for .setup file location
Next Topic:Configure Eclipse according to current project state
Goto Forum:
  


Current Time: Sun Dec 21 22:16:35 GMT 2014

Powered by FUDForum. Page generated in 0.01873 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software