run.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <project name="run.xml" default="all" basedir=".">
  2. <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="lib/ant-contrib-1.0b3.jar" />
  3. <tstamp>
  4. <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
  5. </tstamp>
  6. <property environment="env" />
  7. <property file="run.properties" />
  8. <property file="build/build.properties" />
  9. <target name="prepareBuildDirectory">
  10. <echo message="Preparing build directory..." />
  11. <delete dir="${buildDirectory}" />
  12. <mkdir dir="${buildDirectory}" />
  13. <antcall target="prepareRepositoriesDirectory" />
  14. <antcall target="prepareFeatures" />
  15. <antcall target="preparePlugins" />
  16. </target>
  17. <target name="prepareRepositoriesDirectory">
  18. <!-- base only has to be prepared, if it does not exist or if the user explicitly specifies to do so (skipBase=false) -->
  19. <echo message="Skipping repositories: ${skipRepositories}" />
  20. <if>
  21. <or>
  22. <equals arg1="${skipRepositories}" arg2="false" />
  23. <not>
  24. <available file="${repoBaseLocation}" />
  25. </not>
  26. </or>
  27. <then>
  28. <trycatch>
  29. <try>
  30. <mkdir dir="${repoBaseLocation}" />
  31. <antcall target="prepareRepositories" />
  32. </try>
  33. <catch>
  34. <echo message="Preparing repositories failed. Cleaning up..." />
  35. <delete dir="${repoBaseLocation}" />
  36. <echo message="Done." />
  37. </catch>
  38. </trycatch>
  39. </then>
  40. </if>
  41. </target>
  42. <target name="prepareRepositories">
  43. <echo message="Preparing repositories ..." />
  44. <!-- project updates -->
  45. <p2.mirror source="${downloadMirror}/eclipse/updates/3.7milestones" destination="file:${repoBaseLocation}/eclipse_updates_3_7">
  46. <iu id="org.eclipse.platform.ide" />
  47. <slicingOptions includeOptional="false" includeNonGreedy="false" followStrict="true" />
  48. </p2.mirror>
  49. <!-- indigo releases -->
  50. <p2.mirror source="${downloadMirror}/releases/indigo" destination="file:${repoBaseLocation}/releases_indigo">
  51. <iu id="org.eclipse.emf.sdk.feature.group" />
  52. <iu id="org.eclipse.gmf.runtime.notation.sdk.feature.group" />
  53. <iu id="org.eclipse.gmf.runtime.sdk.feature.group" />
  54. <iu id="org.eclipse.xtext.sdk.feature.group" />
  55. <!--<slicingOptions includeOptional="false" includeNonGreedy="false" followStrict="true" />-->
  56. </p2.mirror>
  57. <echo message="Preparing repositories done." />
  58. </target>
  59. <target name="preparePlugins">
  60. <delete dir="${buildDirectory}/plugins" />
  61. <mkdir dir="${buildDirectory}/plugins" />
  62. <!-- Copy plugins -->
  63. <echo>Copy plugins from ${repository} to ${buildDirectory}/plugins</echo>
  64. <copy todir="${buildDirectory}/plugins">
  65. <fileset dir="${buildWorkspace}/sct2_repository/plugins" />
  66. </copy>
  67. <copy todir="${buildDirectory}/plugins">
  68. <fileset dir="${buildWorkspace}/base_repository/plugins" />
  69. </copy>
  70. <copy todir="${buildDirectory}/plugins">
  71. <fileset dir="${buildWorkspace}/gmf_utils_repository/plugins" />
  72. </copy>
  73. </target>
  74. <target name="prepareFeatures">
  75. <delete dir="${buildDirectory}/features" />
  76. <mkdir dir="${buildDirectory}/features" />
  77. <!-- Copy features -->
  78. <echo>Copy features from ${repository} to ${buildDirectory}/features</echo>
  79. <copy todir="${buildDirectory}/features">
  80. <fileset dir="${buildWorkspace}/sct2_repository/features" />
  81. </copy>
  82. <copy todir="${buildDirectory}/features">
  83. <fileset dir="${buildWorkspace}/gmf_utils_repository/features" />
  84. </copy>
  85. <!-- remove the "-feature" suffix of all feature projects in the features folder -->
  86. <for param="currentFeatureDir" keepgoing="true">
  87. <path>
  88. <dirset dir="${buildDirectory}/features">
  89. <include name="*-feature" />
  90. </dirset>
  91. </path>
  92. <sequential>
  93. <propertyregex override="yes" property="renamedFeatureDir" input="@{currentFeatureDir}" regexp="(.*)-feature" select="\1" />
  94. <echo message="Moving @{currentFeatureDir} to ${renamedFeatureDir}" />
  95. <move todir="${renamedFeatureDir}">
  96. <fileset dir="@{currentFeatureDir}" />
  97. </move>
  98. </sequential>
  99. </for>
  100. </target>
  101. <target name="all">
  102. <echo message="Preparing build directory ${buildDirectory}" />
  103. <antcall target="prepareBuildDirectory" />
  104. <echo message="Using buildWorspace ${buildWorkspace}" />
  105. <echo message="Cleaning up report directory ${reportDirectory}" />
  106. <delete dir="${reportDirectory}" />
  107. <mkdir dir="${reportDirectory}" />
  108. <ant antfile="build.xml" dir="build" target="all" inheritall="true">
  109. <property name="builder" value="${basedir}/build" />
  110. <property name="libs" value="${basedir}/lib" />
  111. </ant>
  112. </target>
  113. </project>