Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Adding to git clone location choice
Adding to git clone location choice [message #1770139] Tue, 08 August 2017 15:09 Go to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
Is there a way to add a choice to the variable git clone location rule? I found that the choices seem to be defined in a file Git.ecore. I don't see them in any setup file, so there's nothing I could copy to my setup file and modify.
I would like to have a choice ${git.container.root/}${@id.remoteURI|gitRepository}
Re: Adding to git clone location choice [message #1770158 is a reply to message #1770139] Tue, 08 August 2017 17:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
There are variables such as these defined in the org.eclipse.projects.setup:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0">
  <setup:VariableTask
      name="eclipse.gerrit.remoteURIs"
      label="Eclipse Gerrit Repository">
    <choice
        value="https://git.eclipse.org/r/@{remoteURI}"
        label="HTTPS (read-only, anonymous, Gerrit)"/>
    <choice
        value="ssh://${git.user.id|username}@git.eclipse.org:29418/@{remoteURI}"
        label="SSH (read-write, Gerrit)">
      <annotation
          source="http://www.eclipse.org/oomph/setup/MatchChoice"/>
    </choice>
    <choice
        value="https://${git.user.id|username}@git.eclipse.org/r/@{remoteURI}"
        label="HTTPS (read-write, Gerrit)">
      <annotation
          source="http://www.eclipse.org/oomph/setup/MatchChoice"/>
    </choice>
    <description>Choose from the available remote Gerrit URIs</description>
  </setup:VariableTask>
  <setup:VariableTask
      name="eclipse.git.remoteURIs"
      label="Eclipse Git Repository">
    <choice
        value="http://git.eclipse.org/gitroot/@{remoteURI}.git"
        label="HTTP (read-only, anonymous, direct)"/>
    <choice
        value="ssh://${git.user.id|username}@git.eclipse.org/gitroot/@{remoteURI}.git"
        label="SSH (read-write, direct)">
      <annotation
          source="http://www.eclipse.org/oomph/setup/MatchChoice"/>
    </choice>
    <choice
        value="git://git.eclipse.org/gitroot/@{remoteURI}"
        label="Git (read-only, anonymous, direct)"/>
    <description>Choose from the available Git URIs</description>
  </setup:VariableTask>
  <setup:VariableTask
      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)"/>
    <choice
        value="https://github.com/@{remoteURI}.git"
        label="HTTPS (read-only, anonymous)"/>
    <description>Choose from the available Github URIs</description>
  </setup:VariableTask>
</xmi:XMI>
So yes, you can define your own such variables that extract (via @{feature-name}) information specified in the model instance. I'm not sure the intent of @{id.remoteURI} because that's not a feature name.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Adding to git clone location choice [message #1770252 is a reply to message #1770158] Wed, 09 August 2017 11:52 Go to previous messageGo to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
Thanks, I'll give it a try. There seems to be a lot of "magic" involved where the EAnnotations for the location EAttribute of the GitCloneTask are handled. I'm not quite convinced that all that can be reproduced using a setup file...
Re: Adding to git clone location choice [message #1770287 is a reply to message #1770252] Wed, 09 August 2017 16:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Sorry, I read your question as being about the remoteURI not the location. You can of course set your own variable reference as the value of the git clone task location and provide whatever choices you want... But yes, the rules are kind of magical because they're used to synthesize a different variable for each git clone task, with a specific set of choices (intended to avoid name collisions, e.g., should you create an environments for different branches of the same clone).

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Adding to git clone location choice [message #1770438 is a reply to message #1770287] Fri, 11 August 2017 12:19 Go to previous messageGo to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
Given my knowledge of how oomph works, it doesn't seem to be possible to recreate the required magic behavior in a setup.
Re: Adding to git clone location choice [message #1770444 is a reply to message #1770438] Fri, 11 August 2017 13:03 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
No, the rules for synthesizing the variables are built-in into the model. But you can define your own variable for the location with your own choices, but of course you'd have to do that for each clone task.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Execute Tasks Only Once
Next Topic:Eclipse installer issue on Windows
Goto Forum:
  


Current Time: Fri Apr 19 23:02:13 GMT 2024

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

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

Back to the top