forked from albertlatacz/java-repl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
207 lines (166 loc) · 8.29 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?xml version="1.0" encoding="UTF-8"?>
<project name="javarepl" default="build">
<property environment="env"/>
<condition property="build.number" value="${env.JAVAREPL_BUILD_NUMBER}" else="dev.build">
<isset property="env.JAVAREPL_BUILD_NUMBER"/>
</condition>
<property name="build" value="${basedir}/build"/>
<property name="artifacts" value="${build}/artifacts"/>
<property name="reports" value="${artifacts}/reports"/>
<property name="src" value="${basedir}/src"/>
<property name="test" value="${basedir}/test"/>
<property name="release.version" value="${build.number}"/>
<property name="plugin.src" value="${basedir}/intellij-plugin/src"/>
<property name="release.install.script" value="ec2-install.sh"/>
<property name="release.install.script.path" value="${basedir}/bin/${release.install.script}"/>
<property name="release.plugin.jar" value="${ant.project.name}-${release.version}-intellij.jar"/>
<property name="release.plugin.zip" value="${ant.project.name}-${release.version}-intellij.zip"/>
<property name="release.name" value="${ant.project.name}-${release.version}"/>
<property name="release.jar" value="${release.name}.jar"/>
<property name="release.jar.path" value="${artifacts}/${release.jar}"/>
<property name="release.pom" value="${release.name}.pom"/>
<property name="release.pom.path" value="${artifacts}/${release.pom}"/>
<property name="release.manifest" value="MANIFEST.MF"/>
<property name="release.src" value="${release.name}-sources.jar"/>
<property name="release.src.path" value="${artifacts}/${release.src}"/>
<property name="release.manifest.path" value="${artifacts}/${release.manifest}"/>
<property name="release.plugin.jar.path" value="${artifacts}/${release.plugin.jar}"/>
<property name="release.plugin.zip.path" value="${artifacts}/${release.plugin.zip}"/>
<property name="s3.repo.path"
value="s3://albertlatacz.published/repo/${ant.project.name}/${ant.project.name}/${release.version}"/>
<property name="s3.download.path" value="s3://albertlatacz.published/${ant.project.name}"/>
<property name="tests.jar" value="${release.name}-tests.jar"/>
<property name="tests.src" value="${release.name}-test-sources.jar"/>
<property name="tests.jar.path" value="${artifacts}/${tests.jar}"/>
<property name="build.dependencies.dir" value="lib/build"/>
<property name="runtime.dependencies.dir" value="lib/runtime"/>
<property name="packaged.dependencies.dir" value="lib/packaged"/>
<property name="optional.dependencies.dir" value="lib/optional"/>
<property name="manual.dependencies.dir" value="lib/manual"/>
<import file="${build}/macros.xml"/>
<import file="${build}/shavenmaven.xml"/>
<path id="all.dependancies">
<fileset dir="${build.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${runtime.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${packaged.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${optional.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${manual.dependencies.dir}" includes="**/*.jar"/>
</path>
<path id="all.jars">
<path refid="all.dependancies"/>
<path path="${release.jar.path}"/>
<path path="${tests.jar.path}"/>
</path>
<target name="update" description="Update library dependencies">
<!--<install version="57"/>-->
<parallel>
<update dependencies="build/build.dependencies"
directory="${build.dependencies.dir}"/>
<update dependencies="build/runtime.dependencies"
directory="${runtime.dependencies.dir}"/>
<update dependencies="build/packaged.dependencies"
directory="${packaged.dependencies.dir}"/>
<update dependencies="build/optional.dependencies"
directory="${optional.dependencies.dir}"/>
</parallel>
</target>
<target name="clean" description="cleanup all">
<delete dir="${artifacts}"/>
</target>
<target name="plugin">
<copy file="${plugin.src}/META-INF/plugin.xml" tofile="${artifacts}/plugin.xml.original"/>
<replace file="${plugin.src}/META-INF/plugin.xml" token="dev.build" value="${build.number}"/>
<compile.and.jar src="${plugin.src}" jar="${release.plugin.jar.path}" classpathref="all.jars"
version="${release.version}"/>
<move file="${artifacts}/plugin.xml.original" tofile="${plugin.src}/META-INF/plugin.xml"/>
<zip destfile="${release.plugin.zip.path}">
<zipfileset file="${release.jar.path}" prefix="java-repl/lib"/>
<zipfileset file="${release.plugin.jar.path}" prefix="java-repl/lib"/>
</zip>
</target>
<target name="compile">
<compile.and.jar src="${src}" jar="${release.jar.path}" classpathref="all.dependancies"
version="${release.version}"/>
<compile.and.jar src="${test}" jar="${tests.jar.path}" classpathref="all.jars" version="${release.version}"/>
<antcall target="plugin"/>
</target>
<target name="test">
<test jar="${tests.jar.path}" classpathref="all.jars" reports="${reports}"/>
</target>
<target name="package">
<mkdir dir="${artifacts}"/>
<zip destfile="${artifacts}/${release.src}" basedir="src"/>
<zip destfile="${artifacts}/${tests.src}" basedir="test"/>
<exec executable="git" output="${artifacts}/git.properties">
<arg line="log -1 --pretty=format:summary:%s%nchangeset:%H%nuser:%cn"/>
</exec>
<property file="${artifacts}/git.properties" prefix="git"/>
<generate.pom artifact.uri="mvn:${ant.project.name}:${ant.project.name}:jar:${release.version}"
dependencies="build/runtime.dependencies"
directory="${artifacts}"/>
</target>
<target name="embed">
<embed.libs jar="${release.jar.path}"/>
</target>
<target name="deploy" if="${deploy}">
<property name="s3.config" value="~/.s3cfg"/>
<echo file="${s3.config}">[default]
access_key = ${env.AWS_KEY}
secret_key = ${env.AWS_SECRET}
</echo>
<deploy-to-s3
config="${s3.config}"
source="${release.plugin.zip.path}"
destination="${s3.download.path}/javarepl-intellij.zip"/>
<deploy-to-s3
config="${s3.config}"
source="${release.jar.path}"
destination="${s3.download.path}/javarepl.jar"/>
<deploy-to-s3
config="${s3.config}"
source="${release.install.script.path}"
destination="${s3.download.path}/${release.install.script}"/>
<deploy-to-s3-maven-repository
config="${s3.config}"
source="${release.jar.path}"
destination="${s3.repo.path}/${release.jar}"/>
<deploy-to-s3-maven-repository
config="${s3.config}"
source="${release.src.path}"
destination="${s3.repo.path}/${release.src}"/>
<deploy-to-s3-maven-repository
config="${s3.config}"
source="${release.pom.path}"
destination="${s3.repo.path}/${release.pom}"/>
<deploy-to-s3-maven-repository
config="${s3.config}"
source="${release.plugin.zip.path}"
destination="${s3.repo.path}/${release.plugin.zip}"/>
<delete file="${s3.config}" quiet="true"/>
</target>
<target name="build" description="build all">
<parallel>
<antcall target="update"/>
<antcall target="clean"/>
</parallel>
<antcall target="compile"/>
<parallel>
<antcall target="test"/>
<antcall target="package"/>
</parallel>
<antcall target="embed"/>
<antcall target="plugin"/>
<antcall target="deploy"/>
</target>
<target name="fast" description="build all">
<parallel>
<antcall target="update"/>
<antcall target="clean"/>
</parallel>
<antcall target="compile"/>
<parallel>
<antcall target="package"/>
</parallel>
<antcall target="embed"/>
</target>
</project>