Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sapphire-dev] Sapphire + tycho build support

FYI, new page has been added:
http://wiki.eclipse.org/Sapphire_Modeling_Tycho_build_support

On Mon, Jun 6, 2011 at 1:42 PM, Konstantin Komissarchik <konstantin.komissarchik@xxxxxxxxxx> wrote:

Greg,

 

Thanks for this info. It is bound to be useful to other adopters.

 

There is a placeholder location for Sapphire wiki:

 

http://wiki.eclipse.org/Sapphire

 

You should be able to add a new page beneath that to hold this writeup.

 

- Konstantin

 

 

From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Greg Amerson
Sent: Monday, June 06, 2011 11:34 AM
To: Sapphire project
Subject: [sapphire-dev] Sapphire + tycho build support

 

Hello everyone,

 

This is just a FYI for any users that are trying to use tycho to build their eclipse plugins that use sapphire.  Below is how I setup the customBuildCallbacks.xml so the annotations processor and sapphire ant tasks would run at the right point during the build.

 

Here is what I did.  In the pom.xml for any plugin that has sapphire generated models I modified the pom to fire off a ant script during the generate-sources phase and then had to modify the callback ant script to reference maven/tycho provided classpath references.  

 

1) In your pom.xml used snippet [1] to launch the ant script during generate-sources

 

2) In customBuildCallback.xml, had to make the following changes:

2a) modify the location of ant-contrib.jar for my build environment

2b) Change the <safe-apt /> task [2] to reference classpath refs provided by maven3/tycho

2c) Change the <taskdef /> element [3] for how to find the sapphire SDK ant task

 

3) In my plugin.xml I had to explicitly depend on these bundles [4], so that when maven/tycho generates the classpath references it will include those two jars on the classpath.  There may be a more elegant way to do encode this dependnecy in maven/pom.xml but I am not a maven expert but doing this worked.

 

Hope this can be of help to other sapphire+tycho users.  Konstantin, is there a wiki for sapphire project that I could add this to?

 

 

[1] <build>

     <plugins>

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-antrun-plugin</artifactId>

        <version>1.6</version>

        <executions>

          <execution>

            <id>generate-sources</id>

            <phase>generate-sources</phase>

            <configuration>

              <target>

                <ant antfile="customBuildCallbacks.xml" inheritRefs="true" />

              </target>

            </configuration>

            <goals>

              <goal>run</goal>

            </goals>

          </execution>

        </executions>

      </plugin>

    </plugins>

  </build>

 

 

[2] <safe-apt srcdir="src"

      destdir=".apt_generated"

      preprocessdir=".apt_generated"

      classpathref="maven.compile.classpath"

      factorypathref="maven.compile.classpath"

      compile="false"/>

 

 

[3] <taskdef 

          resource="org/eclipse/sapphire/sdk/build/antlib.xml"

          classpathref="maven.compile.classpath"/>

 

[4] org.eclipse.sapphire.sdk

org.eclipse.sapphire.sdk.build.processor

 

 


--

Greg Amerson (@greg_amerson)

Liferay, Inc. (#liferay)


_______________________________________________
sapphire-dev mailing list
sapphire-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/sapphire-dev




--
Greg Amerson (@greg_amerson)
Liferay, Inc. (#liferay)

Back to the top