Home » Eclipse Projects » Oomph » Understanding variable in a setup + installation
Understanding variable in a setup + installation [message #1836715] |
Tue, 12 January 2021 13:13  |
Eclipse User |
|
|
|
Hello,
I have made a configuration (setup:Configuration) which performs an installation, loading additionals plugins and configuring preferences.
While it works, I am also setting several variables, I am wondering how variable resolution work (I have read https://wiki.eclipse.org/Eclipse_Oomph_Authoring#Understanding_Setup_Tasks_and_Scopes but I have trouble understanding some part).
If I put this in the user.setup, the variable is not defined to the value Fira Code, unless I remove the declaration in the installation.setup:
<!-- user.setup -->
<setupTask xsi:type="setup:VariableTask" id="font" name="font" value="Fira Code" label="Default font"/>
It is defined like this in install.setup:
<!-- install.setup -->
<setupTask xsi:type="setup:VariableTask" id="font" name="font" defaultValue="Consolas" label="Default font"/>
I would assume that Oomph would look for variable font, in all scope (user, install, workspace), and resolve the value to the one defined in user.setup, but it won't.
What is the difference between value and defaultValue in this case?
Now, I also setup some variables to customize:
- Some plugins for SpotBugs
- The user dictionary
<!-- install.setup -->
<setupTask xsi:type="setup:VariableTask"
id="spotbugs.root" name="spotbugs.root"
value="${install.root/spotbugs}" defaultValue="${install.root/spotbugs}"
label="Spotbug Contribution Root" />
<setupTask xsi:type="setup:VariableTask"
id="spotbugs.findsecbugs.location" name="spotbugs.findsecbugs.location"
type="FILE"
value="${spotbugs.root}/findsecbugs-plugin-${spotbugs.findsecbugs.version}.jar"
defaultValue="${spotbugs.root}/findsecbugs-plugin-${spotbugs.findsecbugs.version}.jar"
storageURI="scope://Installation" label="Location of findsecbugs jar" />
<setupTask xsi:type="setup:VariableTask"
id="userDictionary.location" name="userDictionary.location"
type="FILE" value="${workspace.root/user-dictionnary.txt|canonical}" defaultValue="${workspace.root/user-dictionnary.txt|canonical}"
label="User dictionary" />
I notice in the UI, when displaying all variables, that:
- userDictionary.location is set to the actual value of ${workspace.root}, eg: D:\eclipse\workspace\user-dictionnary.txt (workspace.root is defined in user.setup)
- spotbugs.findsecbugs.location is set to the expression I used in the value/defaultValue
Why variables defined in user.setup are resolved, while other are not?
What the storageURI attribute purpose? And what scope://Installation does if set?
How, as an user, can I see the default value or its resolution ?
Finally, in the setup I also provide JRE I want to use:
<!-- install.setup -->
<setupTask xsi:type="jdt:JRETask" version="JavaSE-1.8" location="${jre.location-1.8}"/>
<setupTask xsi:type="jdt:JRETask" version="JavaSE-11" location="${jre.location-11}"/>
Is there a way for me to disable the field?
The rational is that Oomph is a little bit sensitive when I check/uncheck the "All variables", and when I scroll down, from time to time, I enter by mistake in the JRE 1.8 field and select a JRE 15 - which is not what I want :)
Regards,
NoDataFound
|
|
| |
Re: Understanding variable in a setup + installation [message #1836755 is a reply to message #1836728] |
Wed, 13 January 2021 05:57  |
Eclipse User |
|
|
|
Thank for the links.
Quote:I'm not sure what you mean by" disable the field". If you use a variable with choices those choices are available available....
To better explain, when you display all variables, the screen display the JRE location (jre.location-1.8 and 11). In fact, I have more JREs configure in Oomph.
When I scroll down using mouse wheel to see all values, at some point, Oomph decide to scroll up (I don't know why), and when I scroll down again, I can see that from time to time the JRE 8 was changed to the latest JRE (15).
That's why I'd like to provide a read only value.
|
|
|
Goto Forum:
Current Time: Thu Jun 19 16:25:53 EDT 2025
Powered by FUDForum. Page generated in 0.03624 seconds
|