PageRenderTime 135ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/asl/asl-scm-p4.xml

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
XML | 213 lines | 130 code | 18 blank | 65 comment | 0 complexity | a29c22617584c044210573c660424d0c MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. ********************************************************************************
  4. * Ant Script Library - Source Control Management for Perforce
  5. * Module that imports all the other java modules for a plain java build
  6. * Module property prefix: "scm"
  7. ********************************************************************************
  8. * Copyright 2009 Joe Schmetzer
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. ********************************************************************************
  22. -->
  23. <project name="asl-scm-p4">
  24. <dirname property="asl-scm-p4.basedir" file="${ant.file.asl-scm-p4}"/>
  25. <import file="${asl-scm-p4.basedir}/asl-common.xml"/>
  26. <property name="scm.p4-executable" value="p4"/>
  27. <property name="scm.p4-tag-base" value="unknown"/>
  28. <!-- ***********************************************************************
  29. * macro: scm-checkout
  30. ************************************************************************ -->
  31. <macrodef name="scm-export">
  32. <attribute name="serverpath"/>
  33. <attribute name="version"/>
  34. <attribute name="localpath"/>
  35. <sequential>
  36. <property name="scm.p4-workspace-name" value="@{version}-release-ws"/>
  37. <echo>scm-export:
  38. serverpath: @{serverpath}
  39. version: @{version}
  40. localpath: @{localpath}
  41. workspace: ${scm.p4-workspace-name}</echo>
  42. <antcall target="-p4-create-workspace">
  43. <param name="scm.p4-ws-server-path" value="@{serverpath}"/>
  44. <param name="scm.p4-ws-version" value="@{version}"/>
  45. <param name="scm.p4-ws-local-path" value="@{localpath}"/>
  46. <param name="scm.p4-workspace-name" value="${scm.p4-workspace-name}"/>
  47. </antcall>
  48. <antcall target="-p4-sync-workspace">
  49. <param name="scm.p4-ws-server-path" value="@{serverpath}"/>
  50. <param name="scm.p4-ws-version" value="@{version}"/>
  51. <param name="scm.p4-ws-local-path" value="@{localpath}"/>
  52. <param name="scm.p4-workspace-name" value="${scm.p4-workspace-name}"/>
  53. </antcall>
  54. <antcall target="-p4-delete-workspace">
  55. <param name="scm.p4-workspace-name" value="${scm.p4-workspace-name}"/>
  56. </antcall>
  57. </sequential>
  58. </macrodef>
  59. <!-- ***********************************************************************
  60. * macro: scm-update
  61. ************************************************************************ -->
  62. <macrodef name="scm-update">
  63. <attribute name="dir"/>
  64. <sequential>
  65. <exec command="${scm.p4-executable}">
  66. <arg value="sync"/>
  67. <arg value="@{dir}/..."/>
  68. </exec>
  69. </sequential>
  70. </macrodef>
  71. <!-- ***********************************************************************
  72. * macro: scm-tag
  73. * p4 label -i
  74. * p4 tag -l ${label-name} ${project-path}/...
  75. ************************************************************************ -->
  76. <macrodef name="scm-tag">
  77. <attribute name="dir"/>
  78. <attribute name="tag"/>
  79. <sequential>
  80. <antcall target="-p4-create-label">
  81. <param name="scm.p4-label-path" value="@{dir}"/>
  82. <param name="scm.p4-label-name" value="@{tag}"/>
  83. </antcall>
  84. <antcall target="-p4-apply-tag">
  85. <param name="scm.p4-label-path" value="@{dir}"/>
  86. <param name="scm.p4-label-name" value="@{tag}"/>
  87. </antcall>
  88. </sequential>
  89. </macrodef>
  90. <!-- ***********************************************************************
  91. * target: -p4-create-label
  92. ************************************************************************ -->
  93. <target name="-p4-create-label"
  94. depends="-p4-create-label-spec, -p4-apply-label-spec, -p4-delete-label-spec"/>
  95. <!-- ***********************************************************************
  96. * target: -p4-create-label-spec
  97. ************************************************************************ -->
  98. <target name="-p4-create-label-spec">
  99. <property name="p4-label-spec-file" location="${java.io.tmpdir}/${ant.project.name}-p4-label-spec.txt"/>
  100. <echo message="Using p4 label spec file ${p4-label-spec-file}"/>
  101. <echo file="${p4-label-spec-file}">
  102. Label: ${scm.p4-label-name}
  103. View:
  104. ${scm.p4-label-path}/...</echo>
  105. </target>
  106. <!-- ***********************************************************************
  107. * target: -p4-apply-label-spec
  108. ************************************************************************ -->
  109. <target name="-p4-apply-label-spec">
  110. <exec executable="${scm.p4-executable}"
  111. input="${p4-label-spec-file}"
  112. failonerror="true">
  113. <arg value="label"/>
  114. <arg value="-i"/>
  115. </exec>
  116. </target>
  117. <!-- ***********************************************************************
  118. * target: -p4-delete-label-spec
  119. ************************************************************************ -->
  120. <target name="-p4-delete-label-spec">
  121. <delete file="${p4-label-spec-file}"/>
  122. </target>
  123. <!-- ***********************************************************************
  124. * target: -p4-apply-tag
  125. ************************************************************************ -->
  126. <target name="-p4-apply-tag">
  127. <exec executable="${scm.p4-executable}" failonerror="true">
  128. <arg value="tag"/>
  129. <arg value="-l"/>
  130. <arg value="${scm.p4-label-name}"/>
  131. <arg value="${scm.p4-label-path}/..."/>
  132. </exec>
  133. </target>
  134. <!-- ***********************************************************************
  135. * target: -p4-create-workspace
  136. ************************************************************************ -->
  137. <target name="-p4-create-workspace"
  138. depends="-p4-create-workspace-spec, -p4-apply-workspace-spec, -p4-delete-workspace-spec"/>
  139. <!-- ***********************************************************************
  140. * target: -p4-create-workspace-spec
  141. ************************************************************************ -->
  142. <target name="-p4-create-workspace-spec">
  143. <property name="p4-workspace-spec-file" location="${java.io.tmpdir}/${ant.project.name}-p4-workspace-spec.txt"/>
  144. <echo message="Using p4 workspace spec file ${p4-workspace-spec-file}"/>
  145. <echo file="${p4-workspace-spec-file}">
  146. Client: ${scm.p4-workspace-name}
  147. Owner: ${user.name}
  148. Root: ${scm.p4-ws-local-path}
  149. View:
  150. ${scm.p4-ws-server-path}/... //${scm.p4-workspace-name}/...
  151. </echo>
  152. </target>
  153. <!-- ***********************************************************************
  154. * target: -p4-apply-workspace-spec
  155. ************************************************************************ -->
  156. <target name="-p4-apply-workspace-spec">
  157. <exec executable="${scm.p4-executable}"
  158. input="${p4-workspace-spec-file}"
  159. failonerror="true">
  160. <arg value="client"/>
  161. <arg value="-i"/>
  162. </exec>
  163. </target>
  164. <!-- ***********************************************************************
  165. * target: -p4-delete-workspace-spec
  166. ************************************************************************ -->
  167. <target name="-p4-delete-workspace-spec">
  168. <delete file="${p4-workspace-spec-file}"/>
  169. </target>
  170. <!-- ***********************************************************************
  171. * target: -p4-sync-workspace
  172. ************************************************************************ -->
  173. <target name="-p4-sync-workspace">
  174. <mkdir dir="${scm.p4-ws-local-path}"/>
  175. <exec executable="${scm.p4-executable}"
  176. failonerror="true">
  177. <arg value="-c"/>
  178. <arg value="${scm.p4-workspace-name}"/>
  179. <arg value="sync"/>
  180. <arg value="-p"/>
  181. <arg value="${scm.p4-ws-server-path}/...@${scm.p4-ws-version}"/>
  182. </exec>
  183. </target>
  184. <!-- ***********************************************************************
  185. * target: -p4-delete-workspace
  186. ************************************************************************ -->
  187. <target name="-p4-delete-workspace">
  188. <exec executable="${scm.p4-executable}"
  189. failonerror="true">
  190. <arg value="client"/>
  191. <arg value="-d"/>
  192. <arg value="${scm.p4-workspace-name}"/>
  193. </exec>
  194. </target>
  195. </project>