|
1 |
| -<?xml version="1.0" encoding="UTF-8"?> |
2 |
| -<project name="gitblit-powertools" default="build" xmlns:mx="antlib:org.moxie"> |
3 |
| - |
4 |
| - <!-- |
5 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
6 |
| - Retrieve Moxie Toolkit |
7 |
| - |
8 |
| - documentation @ http://gitblit.github.io/moxie |
9 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
10 |
| - --> |
11 |
| - <property name="moxie.version" value="0.9.1" /> |
12 |
| - <property name="moxie.url" value="http://gitblit.github.io/moxie/maven" /> |
13 |
| - <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" /> |
14 |
| - <property name="moxie.dir" value="${user.home}/.moxie" /> |
15 |
| - |
16 |
| - <!-- Download Moxie from it's Maven repository to user.home --> |
17 |
| - <mkdir dir="${moxie.dir}" /> |
18 |
| - <get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}" |
19 |
| - dest="${moxie.dir}" skipexisting="true" verbose="true" /> |
20 |
| - |
21 |
| - <!-- Register Moxie tasks --> |
22 |
| - <taskdef uri="antlib:org.moxie"> |
23 |
| - <classpath location="${moxie.dir}/${moxie.jar}" /> |
24 |
| - </taskdef> |
25 |
| - |
26 |
| - |
27 |
| - <!-- |
28 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
29 |
| - Initialize Moxie and setup build properties |
30 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
31 |
| - --> |
32 |
| - <target name="prepare"> |
33 |
| - |
34 |
| - <!-- Setup Ant build from build.moxie and resolve dependencies. |
35 |
| - If it exists, build.properties is automatically loaded. |
36 |
| - Explicitly set mxroot allowing CI servers to override the default. --> |
37 |
| - <mx:init verbose="no" mxroot="${moxie.dir}" /> |
38 |
| - |
39 |
| - <!-- Set Ant project properties --> |
40 |
| - <property name="distribution.zipfile" value="${artifactId}-${project.version}.zip" /> |
41 |
| - <property name="maven.directory" value="${basedir}/../gitblit-maven" /> |
42 |
| - |
43 |
| - </target> |
44 |
| - |
45 |
| - |
46 |
| - <!-- |
47 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
48 |
| - Cleanup all build artifacts and directories |
49 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
50 |
| - --> |
51 |
| - <target name="clean" depends="prepare" description="Cleanup all build artifacts and directories"> |
52 |
| - |
53 |
| - <!-- Clean build and target directories --> |
54 |
| - <mx:clean /> |
55 |
| - |
56 |
| - </target> |
57 |
| - |
58 |
| - |
59 |
| - <!-- |
60 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
61 |
| - Compile |
62 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
63 |
| - --> |
64 |
| - <target name="compile" depends="prepare" description="compiles from source"> |
65 |
| - <!-- Compile project --> |
66 |
| - <mx:javac scope="compile" clean="true" /> |
67 |
| - |
68 |
| - </target> |
69 |
| - |
70 |
| - |
71 |
| - <!-- |
72 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
73 |
| - Build |
74 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
75 |
| - --> |
76 |
| - <target name="build" depends="compile" description="builds the distribution"> |
77 |
| - <!-- Generate the plugin jar file stamped with the appropriate manifest atributes --> |
78 |
| - <mx:jar destfile="${project.targetDirectory}/plugin.jar" includeResources="true" packageSources="false"> |
79 |
| - <manifest> |
80 |
| - <attribute name="plugin-id" value ="${project.groupId}:${project.artifactId}" /> |
81 |
| - <attribute name="plugin-version" value="${project.version}" /> |
82 |
| - <attribute name="plugin-provider" value="${project.organization}" /> |
83 |
| - <attribute name="plugin-class" value="${project.mainclass}" /> |
84 |
| - <attribute name="plugin-dependencies" value="" /> |
85 |
| - </manifest> |
86 |
| - </mx:jar> |
87 |
| - |
88 |
| - <!-- Unpack the built jar to a temporary folder --> |
89 |
| - <property name="plugin.classes" value="${project.targetDirectory}/exploded" /> |
90 |
| - <unzip dest="${plugin.classes}" src="${project.targetDirectory}/plugin.jar" /> |
91 |
| - |
92 |
| - <!-- Assemble the plugin zip file: classes in classes/ and dependencies in lib/ --> |
93 |
| - <mx:zip> |
94 |
| - <zipfileset prefix="classes/" dir="${plugin.classes}" /> |
95 |
| - <!--<zipgroupfileset prefix="classes/" file="${project.targetDirectory}/plugin.jar" /> --> |
96 |
| - <dependencies prefix="lib/" /> |
97 |
| - </mx:zip> |
98 |
| - </target> |
99 |
| - |
100 |
| - |
101 |
| - <!-- |
102 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
103 |
| - Report the compile dependencies on the console |
104 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
105 |
| - --> |
106 |
| - <target name="report" depends="prepare" description="generate dependency report"> |
107 |
| - |
108 |
| - <!-- Report compile dependencies to the console --> |
109 |
| - <mx:report scope="compile" destfile="${project.targetDirectory}/dependencies.txt" /> |
110 |
| - |
111 |
| - </target> |
112 |
| - |
113 |
| - |
114 |
| - <!-- |
115 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
116 |
| - Test |
117 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
118 |
| - --> |
119 |
| - <target name="test" depends="compile" description="compiles from source and runs unit tests"> |
120 |
| - |
121 |
| - <!-- Compile unit tests --> |
122 |
| - <mx:javac scope="test" /> |
123 |
| - |
124 |
| - <!-- Run unit tests --> |
125 |
| - <mx:test failonerror="true" /> |
126 |
| - |
127 |
| - </target> |
128 |
| - |
129 |
| - <!-- |
130 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
131 |
| - Tag a new version and prepare for the next development cycle. |
132 |
| - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
133 |
| - --> |
134 |
| - <target name="tagRelease" depends="prepare" description="tag a new version and prepare for the next development cycle"> |
135 |
| - <!-- release --> |
136 |
| - <property name="dryrun" value="false" /> |
137 |
| - <mx:version stage="release" dryrun="${dryrun}" /> |
138 |
| - <property name="project.tag" value="v${project.version}" /> |
139 |
| - <!-- commit build.moxie & releases.moxie (automatic) --> |
140 |
| - <mx:commit showtitle="no"> |
141 |
| - <message>Prepare ${project.version} release</message> |
142 |
| - <tag name="${project.tag}"> |
143 |
| - <message>${project.name} ${project.version} release</message> |
144 |
| - </tag> |
145 |
| - </mx:commit> |
146 |
| - |
147 |
| - <!-- create the release process script --> |
148 |
| - <mx:if> |
149 |
| - <os family="windows" /> |
150 |
| - <then> |
151 |
| - <!-- Windows PowerShell script --> |
152 |
| - <!-- set-executionpolicy remotesigned --> |
153 |
| - <property name="recipe" value="release_${project.version}.ps1" /> |
154 |
| - </then> |
155 |
| - <else> |
156 |
| - <!-- Bash script --> |
157 |
| - <property name="recipe" value="release_${project.version}.sh" /> |
158 |
| - </else> |
159 |
| - </mx:if> |
160 |
| - <delete file="${recipe}" failonerror="false" quiet="true" verbose="false" /> |
161 |
| - <!-- Work-around for lack of proper ant property substitution in copy --> |
162 |
| - <property name="dollar" value="$"/> |
163 |
| - <copy file="release.template" tofile="${recipe}"> |
164 |
| - <filterset begintoken="${dollar}{" endtoken="}"> |
165 |
| - <filter token="project.version" value="${project.version}" /> |
166 |
| - <filter token="project.commitId" value="${project.commitId}" /> |
167 |
| - <filter token="project.tag" value="${project.tag}" /> |
168 |
| - <filter token="project.directory" value="${basedir}" /> |
169 |
| - <filter token="maven.directory" value="${maven.directory}" /> |
170 |
| - </filterset> |
171 |
| - </copy> |
172 |
| - <chmod file="${recipe}" perm="ugo+rx" /> |
173 |
| - |
174 |
| - <!-- next cycle --> |
175 |
| - <mx:version stage="snapshot" incrementNumber="incremental" dryrun="${dryrun}" /> |
176 |
| - <mx:commit showtitle="no"> |
177 |
| - <message>Reset build identifiers for next development cycle</message> |
178 |
| - </mx:commit> |
179 |
| - </target> |
180 |
| -</project> |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<project name="gitblit-powertools" default="build" xmlns:mx="antlib:org.moxie"> |
| 3 | + |
| 4 | + <!-- |
| 5 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 6 | + Retrieve Moxie Toolkit |
| 7 | + |
| 8 | + documentation @ http://gitblit.github.io/moxie |
| 9 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 | + --> |
| 11 | + <property name="moxie.version" value="0.9.1" /> |
| 12 | + <property name="moxie.url" value="http://gitblit.github.io/moxie/maven" /> |
| 13 | + <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" /> |
| 14 | + <property name="moxie.dir" value="${user.home}/.moxie" /> |
| 15 | + |
| 16 | + <!-- Download Moxie from it's Maven repository to user.home --> |
| 17 | + <mkdir dir="${moxie.dir}" /> |
| 18 | + <get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}" |
| 19 | + dest="${moxie.dir}" skipexisting="true" verbose="true" /> |
| 20 | + |
| 21 | + <!-- Register Moxie tasks --> |
| 22 | + <taskdef uri="antlib:org.moxie"> |
| 23 | + <classpath location="${moxie.dir}/${moxie.jar}" /> |
| 24 | + </taskdef> |
| 25 | + |
| 26 | + |
| 27 | + <!-- |
| 28 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 29 | + Initialize Moxie and setup build properties |
| 30 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 31 | + --> |
| 32 | + <target name="prepare"> |
| 33 | + |
| 34 | + <!-- Setup Ant build from build.moxie and resolve dependencies. |
| 35 | + If it exists, build.properties is automatically loaded. |
| 36 | + Explicitly set mxroot allowing CI servers to override the default. --> |
| 37 | + <mx:init verbose="no" mxroot="${moxie.dir}" /> |
| 38 | + |
| 39 | + <property name="registry.directory" value="${basedir}/../gitblit-registry" /> |
| 40 | + |
| 41 | + </target> |
| 42 | + |
| 43 | + |
| 44 | + <!-- |
| 45 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 46 | + Cleanup all build artifacts and directories |
| 47 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 48 | + --> |
| 49 | + <target name="clean" depends="prepare" description="Cleanup all build artifacts and directories"> |
| 50 | + |
| 51 | + <mx:clean /> |
| 52 | + |
| 53 | + </target> |
| 54 | + |
| 55 | + |
| 56 | + <!-- |
| 57 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 58 | + Compile |
| 59 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 60 | + --> |
| 61 | + <target name="compile" depends="prepare" description="compiles from source"> |
| 62 | + |
| 63 | + <mx:javac scope="compile" clean="true" /> |
| 64 | + |
| 65 | + </target> |
| 66 | + |
| 67 | + |
| 68 | + <!-- |
| 69 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 70 | + Build |
| 71 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 72 | + --> |
| 73 | + <target name="build" depends="compile" description="builds the distribution"> |
| 74 | + <!-- Generate the plugin jar file stamped with the appropriate manifest atributes --> |
| 75 | + <mx:jar includeResources="true" packageSources="true"> |
| 76 | + <manifest> |
| 77 | + <attribute name="plugin-id" value ="${project.groupId}:${project.artifactId}" /> |
| 78 | + <attribute name="plugin-version" value="${project.version}" /> |
| 79 | + <attribute name="plugin-provider" value="${project.organization}" /> |
| 80 | + <attribute name="plugin-class" value="${project.mainclass}" /> |
| 81 | + <attribute name="plugin-dependencies" value="" /> |
| 82 | + </manifest> |
| 83 | + </mx:jar> |
| 84 | + |
| 85 | + <!-- Unpack the built jar to a temporary folder --> |
| 86 | + <property name="plugin.classes" value="${project.targetDirectory}/exploded" /> |
| 87 | + <unzip dest="${plugin.classes}" src="${project.targetDirectory}/${project.artifactId}-${project.version}.jar" /> |
| 88 | + |
| 89 | + <!-- Assemble the plugin zip file: classes in classes/ and dependencies in lib/ --> |
| 90 | + <mx:zip> |
| 91 | + <zipfileset prefix="classes/" dir="${plugin.classes}" /> |
| 92 | + <!--<zipgroupfileset prefix="classes/" file="${project.targetDirectory}/plugin.jar" /> --> |
| 93 | + <dependencies prefix="lib/" /> |
| 94 | + </mx:zip> |
| 95 | + </target> |
| 96 | + |
| 97 | + |
| 98 | + <!-- |
| 99 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 100 | + Tag a new version and prepare for the next development cycle. |
| 101 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 102 | + --> |
| 103 | + <target name="tagRelease" depends="prepare" description="tag a new version and prepare for the next development cycle"> |
| 104 | + <!-- release --> |
| 105 | + <property name="dryrun" value="false" /> |
| 106 | + <mx:version stage="release" dryrun="${dryrun}" /> |
| 107 | + <property name="project.tag" value="v${project.version}" /> |
| 108 | + <!-- commit build.moxie & releases.moxie (automatic) --> |
| 109 | + <mx:commit showtitle="no"> |
| 110 | + <message>Prepare ${project.version} release</message> |
| 111 | + <tag name="${project.tag}"> |
| 112 | + <message>${project.name} ${project.version} release</message> |
| 113 | + </tag> |
| 114 | + </mx:commit> |
| 115 | + |
| 116 | + <!-- create the release process script --> |
| 117 | + <mx:if> |
| 118 | + <os family="windows" /> |
| 119 | + <then> |
| 120 | + <!-- Windows PowerShell script --> |
| 121 | + <!-- set-executionpolicy remotesigned --> |
| 122 | + <property name="recipe" value="release_${project.version}.ps1" /> |
| 123 | + </then> |
| 124 | + <else> |
| 125 | + <!-- Bash script --> |
| 126 | + <property name="recipe" value="release_${project.version}.sh" /> |
| 127 | + </else> |
| 128 | + </mx:if> |
| 129 | + <delete file="${recipe}" failonerror="false" quiet="true" verbose="false" /> |
| 130 | + <!-- Work-around for lack of proper ant property substitution in copy --> |
| 131 | + <property name="dollar" value="$"/> |
| 132 | + <copy file="release.template" tofile="${recipe}"> |
| 133 | + <filterset begintoken="${dollar}{" endtoken="}"> |
| 134 | + <filter token="project.version" value="${project.version}" /> |
| 135 | + <filter token="project.commitId" value="${project.commitId}" /> |
| 136 | + <filter token="project.tag" value="${project.tag}" /> |
| 137 | + <filter token="project.directory" value="${basedir}" /> |
| 138 | + <filter token="registry.directory" value="${registry.directory}" /> |
| 139 | + </filterset> |
| 140 | + </copy> |
| 141 | + <chmod file="${recipe}" perm="ugo+rx" /> |
| 142 | + |
| 143 | + <!-- next cycle --> |
| 144 | + <mx:version stage="snapshot" incrementNumber="incremental" dryrun="${dryrun}" /> |
| 145 | + <mx:commit showtitle="no"> |
| 146 | + <message>Reset build identifiers for next development cycle</message> |
| 147 | + </mx:commit> |
| 148 | + </target> |
| 149 | + |
| 150 | + <!-- |
| 151 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 152 | + Build and deploy to the registry directory without tagging. |
| 153 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 154 | + --> |
| 155 | + <target name="release" depends="build"> |
| 156 | + <mx:deploy basedir="${registry.directory}" generateIndexPage="true" /> |
| 157 | + </target> |
| 158 | +</project> |
0 commit comments