|
Re: Can I induce a default choice or contribute attribute rules? [message #1802578 is a reply to message #1802547] |
Tue, 12 February 2019 09:15 |
|
The "inherit" key of the "InducedChoices" annotation can point to multiple whitespace-separated variables. In your example it points to the "github.remoteURIs" variable, which is defined in the Github project catalog (com.github.projects.setup) as follows:
<?xml version="1.0" encoding="UTF-8"?>
<setup:VariableTask
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
name="github.remoteURIs"
label="Github repository">
<choice value="git@github.com:@{remoteURI}.git"
label="Git (read-write)"/>
<choice value="https://${github.user.id|username}@github.com/@{remoteURI}.git"
label="HTTPS (read-write)">
<annotation
source="http://www.eclipse.org/oomph/setup/MatchChoice"/>
</choice>
<choice value="https://github.com/@{remoteURI}.git"
label="HTTPS (read-only, anonymous)"/>
<description>Choose from the available Github URIs</description>
</setup:VariableTask>
You can change the annotation to inherit the choices of a different or an additional variable.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
Re: Can I induce a default choice or contribute attribute rules? [message #1802653 is a reply to message #1802614] |
Wed, 13 February 2019 10:46 |
|
It's okay that the git clone location variable appears unresolved at authoring time. At install time the user can pick one of the shipped attribute rules or enter a custom attribute rule (IIRC). The shipped attribute rules are defined in https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.setup.git/model/Git.ecore#n27 :
<eStructuralFeatures xsi:type="ecore:EAttribute" name="location" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="">
<eAnnotations source="http://www.eclipse.org/oomph/setup/Variable">
<eAnnotations source="Choice">
<details key="value" value="${installation.location/git/}${@id.remoteURI|gitRepository}"/>
<details key="label" value="Located in a folder named 'git/<repo>' within the installation folder"/>
</eAnnotations>
<eAnnotations source="Choice">
<details key="value" value="${workspace.location/.git/}${@id.remoteURI|gitRepository}"/>
<details key="label" value="Located in a folder named '.git/<repo>' within the workspace folder"/>
</eAnnotations>
<eAnnotations source="Choice">
<details key="value" value="${git.container.root/}${@id.remoteURI|gitRepository}-${@id.checkoutBranch}"/>
<details key="label" value="Located in a folder named '<repo>-<branch>' within the root Git-container folder "/>
</eAnnotations>
<eAnnotations source="Choice">
<details key="value" value="${git.container.root/}${@id.remoteURI|gitRepository/}${@id.checkoutBranch}"/>
<details key="label" value="Located in a folder named '<repo>/<branch>' within the root Git-container folder "/>
</eAnnotations>
<eAnnotations source="Choice">
<details key="value" value="${@id.location}"/>
<details key="label" value="Located in the specified absolute folder location"/>
</eAnnotations>
<details key="filter" value="canonical"/>
<details key="type" value="STRING"/>
<details key="label" value="Git clone location rule"/>
<details key="description" value="The rule for the absolute folder location where the Git clone is located"/>
<details key="explicitType" value="FOLDER"/>
<details key="explicitLabel" value="${@id.description} Git clone location"/>
<details key="explicitDescription" value="The absolute folder location where the ${@id.description} Git clone is located"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/oomph/setup/RuleVariable">
<details key="name" value="git.container.root"/>
<details key="type" value="FOLDER"/>
<details key="label" value="Root Git-container folder"/>
<details key="defaultValue" value="${user.home}"/>
<details key="description" value="The root Git-container folder where all the Git clones are located"/>
<details key="storageURI" value="scope://"/>
</eAnnotations>
</eStructuralFeatures>
I don't think you can offer custom attribute rule choices for the git clone location. The attribute rule that the user selects/enters is stored in user.setup.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.03884 seconds