Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » setup:VariableTask
setup:VariableTask [message #1699890] Sun, 28 June 2015 22:47 Go to next message
Michael  Haeusler is currently offline Michael HaeuslerFriend
Messages: 10
Registered: July 2009
Junior Member
I am creating some setup files for our projects and I defined a global variable to store the location where git repositories should be stored.

<setupTask
xsi:type="setup:VariableTask"
name="git.location"
defaultValue="${installation.location/git}"
storageURI="scope://Workspace"
label="Git Folder (default: ${installation.location/git})"
documentation="folder where all the GIT respositories are created" />

I have tried this and it works. However, the default value is not displayed at all . Is that the intended behavior ?

also If I do not enter a value, I cannot proceed with the installation. So I am really wondering if "defaultValue" has any use at the moment.

Re: setup:VariableTask [message #1699896 is a reply to message #1699890] Mon, 29 June 2015 04:37 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Michael,

Comments below.

On 29/06/2015 12:47 AM, Michael äusler wrote:
> I am creating some setup files for our projects and I defined a global
> variable to store the location where git repositories should be stored.
Note that there is already a rule for where clones are located: "Git
clone location rule". It's not clear why you need something else for
that. Why take away the flexibility that allows the user to decide
where to store the clones? I'd suggest having a look at how all the
clone tasks for the existing projects in the catalog make use of that.
I.e., they leave the Location of the clone blank and give set an ID
"git.clone.foo" on the Git clone task itself, which induces a variable
git.clone.foo.location that can be used elsewhere and whose value is
managed by the "Git clone location rule".
>
> <setupTask
> xsi:type="setup:VariableTask"
> name="git.location"
> defaultValue="${installation.location/git}"
> storageURI="scope://Workspace"
> label="Git Folder (default: ${installation.location/git})"
> documentation="folder where all the GIT respositories are
> created" />
> I have tried this and it works. However, the default value is not
> displayed at all . Is that the intended behavior ?
The default value isn't used if it contains an unexpanded variable.
>
> also If I do not enter a value, I cannot proceed with the installation.
All variables must have a value to proceed.
> So I am really wondering if "defaultValue" has any use at the moment.
>
What are you trying to accomplish with this?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: setup:VariableTask [message #1700048 is a reply to message #1699896] Mon, 29 June 2015 19:34 Go to previous messageGo to next message
Michael  Haeusler is currently offline Michael HaeuslerFriend
Messages: 10
Registered: July 2009
Junior Member
of course I am using the git-clone task which uses the {$git.location} variable, and it is exactly for the reason that I want to allow flexibility to the end-user... but I also want convenience by giving the option to specify the parent folder of all GIT repositories just once ... as this preference will never change (at least that is what I heard when talking to all my colleagues)

I want to support two different approaches to storing the GIT repositories:
1. using a folder relative to the installation directory
2. using an absolute global folder for all the repositories.
option 1 should be the default and therefore I put the default-value ${installation.location/git}

by the way, if I set the value as ${installation.location/git} it works just as expected, however it is no longer possible to override the value in the installer... preventing option 2

is there another solution to this ?

[Updated on: Mon, 29 June 2015 20:49]

Report message to a moderator

Re: setup:VariableTask [message #1700055 is a reply to message #1700048] Mon, 29 June 2015 21:22 Go to previous messageGo to next message
Michael  Haeusler is currently offline Michael HaeuslerFriend
Messages: 10
Registered: July 2009
Junior Member
thanks for pointing out the requirement for "resolved variables" as default values.

so the working solution for my requirement is to use
defaultValue="$${installation.location/git}"

I still find it a bit strange that the behavior of defaultValue is different to value
Re: setup:VariableTask [message #1700074 is a reply to message #1700048] Tue, 30 June 2015 01:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Michael,

Again, what you describe is already supported without doing anything.
As I said, just give the clone task and ID and leave the location blank...

On 29/06/2015 9:34 PM, Michael äusler wrote:
> I want to support two different approaches to storing the GIT
> repositories:
> 1. using a folder relative to the installation directory
> 2. using a common global folder for all the repositories.
> where option one would be default and therefore the
> ${installation.location/git}
>
> by the way, if I set the value as ${installation.location/git} it
> works just as expected, however it is no longer possible to override
> the value in the installer... preventing option 2
>
> is there another solution to this ?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: setup:VariableTask [message #1700893 is a reply to message #1700074] Tue, 07 July 2015 23:22 Go to previous messageGo to next message
Michael  Haeusler is currently offline Michael HaeuslerFriend
Messages: 10
Registered: July 2009
Junior Member
Hi Ed,

yes this is exactly what I was looking for... Smile
I guess the setup file that I took as template, sent me in the wrong direction.... it is not really obvious that leaving the location parameter empty will have that effect.
Re: setup:VariableTask [message #1700900 is a reply to message #1700893] Wed, 08 July 2015 03:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Michael,

Yes, it's very (too) subtle and clearly needs to be well documented.


On 08/07/2015 1:22 AM, Michael äusler wrote:
> Hi Ed,
>
> yes this is exactly what I was looking for... :)
> I guess the setup file that I took as template, sent me in the wrong
> direction.... it is not really obvious that leaving the location
> parameter empty will have that effect.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:git clone location
Next Topic:Fail to contact HTTPS/SSL p2 repositories
Goto Forum:
  


Current Time: Sun Dec 08 00:13:28 GMT 2024

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

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

Back to the top