| 1 | <!--
|
|---|
| 2 | This program and the accompanying materials are made available
|
|---|
| 3 | under the terms of the Eclipse Public License v1.0 which
|
|---|
| 4 | accompanies this distribution, and is available at
|
|---|
| 5 | http://www.eclipse.org/legal/epl-v10.html
|
|---|
| 6 |
|
|---|
| 7 | This build script creates a build directory containing the plugins
|
|---|
| 8 | and features to be built, and then kicks off the PDE build process.
|
|---|
| 9 | You could just as easily do this from a shell script or cron job.
|
|---|
| 10 |
|
|---|
| 11 | Also, the script can be run inside the Eclipse IDE by choosing
|
|---|
| 12 | Run As -> Ant Build from the context menu. It could obviously be
|
|---|
| 13 | run outside of the IDE if you have ANT installed on your path.
|
|---|
| 14 | -->
|
|---|
| 15 | <project name="net.eclipsetraining.contacts" default="buildFromWorkspace">
|
|---|
| 16 | <property file="build.properties" />
|
|---|
| 17 |
|
|---|
| 18 | <!--
|
|---|
| 19 | PDE Build expects that the build directory contains a "plugins"
|
|---|
| 20 | directory and a "features" directory. These directories should contain
|
|---|
| 21 | the various plug-ins and features to be built.
|
|---|
| 22 |
|
|---|
| 23 | This tutorial simply copies the projects directly from the workspace
|
|---|
| 24 | into the appropriate build directory folders.
|
|---|
| 25 |
|
|---|
| 26 | In this example required plug-ins not available in the SDK are
|
|---|
| 27 | also copied to the build directory.
|
|---|
| 28 | -->
|
|---|
| 29 | <target name="copyProjectsFromWorkspace">
|
|---|
| 30 | <mkdir dir="${buildDirectory}" />
|
|---|
| 31 | <mkdir dir="${buildDirectory}/plugins" />
|
|---|
| 32 | <mkdir dir="${buildDirectory}/features" />
|
|---|
| 33 | <copy todir="${buildDirectory}/plugins">
|
|---|
| 34 | <fileset dir="../">
|
|---|
| 35 | <include name="com.siemens.ct.pm*/**" />
|
|---|
| 36 | <include name="org.jdesktop.application*/**" />
|
|---|
| 37 | <exclude name="com.siemens.ct.pm.build*/**" />
|
|---|
| 38 | <exclude name="com.siemens.ct.pm.target*/**" />
|
|---|
| 39 | <exclude name="com.siemens.ct.pm.feature*/**" />
|
|---|
| 40 | </fileset>
|
|---|
| 41 | </copy>
|
|---|
| 42 | <copy todir="${buildDirectory}/features">
|
|---|
| 43 | <fileset dir="../">
|
|---|
| 44 | <include name="com.siemens.ct.pm.feature*/**" />
|
|---|
| 45 | </fileset>
|
|---|
| 46 | </copy>
|
|---|
| 47 | <copy todir="${buildDirectory}/target">
|
|---|
| 48 | <fileset dir="../">
|
|---|
| 49 | <include name="com.siemens.ct.pm.target/**" />
|
|---|
| 50 | </fileset>
|
|---|
| 51 | </copy>
|
|---|
| 52 | </target>
|
|---|
| 53 |
|
|---|
| 54 | <!--
|
|---|
| 55 | This target actually executes the PDE Build process by launching the
|
|---|
| 56 | Eclipse antRunner application.
|
|---|
| 57 | -->
|
|---|
| 58 | <target name="pde-build">
|
|---|
| 59 | <echo message="Executing ${eclipseLocation}/plugins/org.eclipse.equinox.launcher_${equinoxLauncherPluginVersion}.jar" />
|
|---|
| 60 | <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
|
|---|
| 61 | <arg value="-application" />
|
|---|
| 62 | <arg value="org.eclipse.ant.core.antRunner" />
|
|---|
| 63 | <arg value="-buildfile" />
|
|---|
| 64 | <arg value="${eclipseLocation}/plugins/org.eclipse.pde.build_${pdeBuildPluginVersion}/scripts/build.xml" />
|
|---|
| 65 | <arg value="-Dtimestamp=${timestamp}" />
|
|---|
| 66 | <classpath>
|
|---|
| 67 | <pathelement location="${eclipseLocation}/plugins/org.eclipse.equinox.launcher_${equinoxLauncherPluginVersion}.jar" />
|
|---|
| 68 | </classpath>
|
|---|
| 69 | </java>
|
|---|
| 70 | </target>
|
|---|
| 71 |
|
|---|
| 72 | <target name="clean">
|
|---|
| 73 | <delete dir="${buildDirectory}" />
|
|---|
| 74 | </target>
|
|---|
| 75 |
|
|---|
| 76 | <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpath="./svn/svnant.jar;./svn/svnClientAdapter.jar;./svn/svnkit.jar;./svn/ganymede.jar;./svn/svnjavahl.jar" />
|
|---|
| 77 |
|
|---|
| 78 | <target name="fetchAllProjectsFromSvn">
|
|---|
| 79 | <echo message="Checking out project ${project}" />
|
|---|
| 80 | <svn javahl="false" username="anonymous" password="">
|
|---|
| 81 | <checkout revision="HEAD" url="https://max-server.myftp.org:444/svn/PM/trunk/pm" destPath="${buildDirectory}/svn" />
|
|---|
| 82 | </svn>
|
|---|
| 83 | </target>
|
|---|
| 84 |
|
|---|
| 85 | <target name="buildFromWorkspace" depends="clean,copyProjectsFromWorkspace,pde-build" />
|
|---|
| 86 |
|
|---|
| 87 | <target name="buildFromSvn" depends="clean,fetchAllProjectsFromSvn,pde-build" />
|
|---|
| 88 |
|
|---|
| 89 | <target name="deployToWebServer">
|
|---|
| 90 | <property file="${buildDirectory}/product.version" />
|
|---|
| 91 |
|
|---|
| 92 | <delete dir="${webServerResultDir}/repository" />
|
|---|
| 93 | <copy todir="${webServerResultDir}/repository">
|
|---|
| 94 | <fileset dir="c:/temp/mp3m-build/repo" />
|
|---|
| 95 | </copy>
|
|---|
| 96 | <delete dir="${webServerResultDir}/download" />
|
|---|
| 97 | <copy todir="${webServerResultDir}/download">
|
|---|
| 98 | <fileset dir="c:/temp/mp3m-build/result" />
|
|---|
| 99 | </copy>
|
|---|
| 100 | <property file="${buildDirectory}/product.version" />
|
|---|
| 101 | <svn javahl="false" username="anonymous" password="">
|
|---|
| 102 | <export revision="HEAD" srcUrl="https://max-server.myftp.org:444/svn/mp3m/MP3M/trunk/MP3M" destPath="${buildDirectory}/export/MP3M" />
|
|---|
| 103 | </svn>
|
|---|
| 104 | <zip destfile="${buildDirectory}/export/MP3M-src-${mp3mVersion}.zip" basedir="${buildDirectory}/export/MP3M" />
|
|---|
| 105 | <copy file="${buildDirectory}/export/MP3M-src-${mp3mVersion}.zip" todir="${webServerResultDir}/download" />
|
|---|
| 106 |
|
|---|
| 107 | <copy file="mp3m-downloads.html" todir="${webServerResultDir}/download" overwrite="true">
|
|---|
| 108 | <filterset>
|
|---|
| 109 | <filter token="mp3mVersion" value="${mp3mVersion}" />
|
|---|
| 110 | </filterset>
|
|---|
| 111 | </copy>
|
|---|
| 112 | </target>
|
|---|
| 113 |
|
|---|
| 114 | <target name="buildAndDeploy" depends="buildFromSvn" />
|
|---|
| 115 |
|
|---|
| 116 | <!--
|
|---|
| 117 | This target is run on the actual build server.
|
|---|
| 118 | Firstly it gets the latest version of theis build project from svn,
|
|---|
| 119 | then runs the build.
|
|---|
| 120 | -->
|
|---|
| 121 | <target name="bootstrapBuildFromSvn">
|
|---|
| 122 | <delete dir="c:/temp/pm-build-bootstrap" />
|
|---|
| 123 | <svn javahl="false" username="anonymous" password="">
|
|---|
| 124 | <checkout revision="HEAD" url="https://max-server.myftp.org:444/svn/PM/trunk/pm/com.siemens.ct.p3.build" destPath="c:/temp/mp3m-build-bootstrap" />
|
|---|
| 125 | </svn>
|
|---|
| 126 | <ant antfile="c:/temp/mp3m-build-bootstrap/build.xml" target="buildAndDeploy" dir="c:/temp/pm-build-bootstrap" />
|
|---|
| 127 | </target>
|
|---|
| 128 | </project>
|
|---|
| 129 |
|
|---|