forked from pbreault/adb-idea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
365 lines (324 loc) · 16.1 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
<?xml version="1.0" encoding="UTF-8"?>
<project name="adb_idea" default="all">
<property file="local.properties"/>
<xmlproperty file="META-INF/plugin.xml"/>
<property name="plugin.name">adb_idea</property>
<property name="plugin.version">${idea-plugin.version}</property>
<echo message="VERSION == ${plugin.version}"/>
<!-- Uncomment the following property if no tests compilation is needed -->
<!--
<property name="skip.tests" value="true"/>
-->
<!-- Compiler options -->
<property name="compiler.debug" value="on"/>
<property name="compiler.generate.no.warnings" value="off"/>
<property name="compiler.args" value=""/>
<property name="compiler.max.memory" value="700m"/>
<patternset id="ignored.files">
<exclude name="**/CVS/**"/>
<exclude name="**/SCCS/**"/>
<exclude name="**/RCS/**"/>
<exclude name="**/rcs/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.svn/**"/>
<exclude name="**/.pyc/**"/>
<exclude name="**/.pyo/**"/>
<exclude name="**/*.pyc/**"/>
<exclude name="**/*.pyo/**"/>
<exclude name="**/.git/**"/>
<exclude name="**/*.hprof/**"/>
<exclude name="**/_svn/**"/>
<exclude name="**/.hg/**"/>
<exclude name="**/*.lib/**"/>
<exclude name="**/*~/**"/>
<exclude name="**/__pycache__/**"/>
<exclude name="**/.bundle/**"/>
<exclude name="**/*.rbc/**"/>
</patternset>
<patternset id="library.patterns">
<include name="*.zip"/>
<include name="*.apk"/>
<include name="*.war"/>
<include name="*.egg"/>
<include name="*.ear"/>
<include name="*.ane"/>
<include name="*.swc"/>
<include name="*.jar"/>
</patternset>
<patternset id="compiler.resources">
<exclude name="**/?*.java"/>
<exclude name="**/?*.form"/>
<exclude name="**/?*.class"/>
<exclude name="**/?*.groovy"/>
<exclude name="**/?*.scala"/>
<exclude name="**/?*.flex"/>
<exclude name="**/?*.kt"/>
<exclude name="**/?*.clj"/>
</patternset>
<!-- JDK definitions -->
<path id="jdk.classpath.idea">
<fileset dir="${idea.home}">
<include name="lib/annotations.jar"/>
<include name="lib/asm-commons.jar"/>
<include name="lib/asm.jar"/>
<include name="lib/asm4-all.jar"/>
<include name="lib/automaton.jar"/>
<include name="lib/boot.jar"/>
<include name="lib/bootstrap.jar"/>
<include name="lib/cglib-2.2.2.jar"/>
<include name="lib/cli-parser-1.1.jar"/>
<include name="lib/commons-codec-1.8.jar"/>
<include name="lib/commons-httpclient-3.1-patched.jar"/>
<include name="lib/commons-logging-1.1.1.jar"/>
<include name="lib/commons-net-3.1.jar"/>
<include name="lib/ecj-4.2.1.jar"/>
<include name="lib/extensions.jar"/>
<include name="lib/forms_rt.jar"/>
<include name="lib/groovy-all-2.0.6.jar"/>
<include name="lib/gson-2.2.3.jar"/>
<include name="lib/guava-14.0.1.jar"/>
<include name="lib/icons.jar"/>
<include name="lib/idea.jar"/>
<include name="lib/idea_rt.jar"/>
<include name="lib/isorelax.jar"/>
<include name="lib/javac2.jar"/>
<include name="lib/jaxen-1.1.3.jar"/>
<include name="lib/jayatana-1.2.4.jar"/>
<include name="lib/jcip-annotations.jar"/>
<include name="lib/jdkAnnotations.jar"/>
<include name="lib/jdom.jar"/>
<include name="lib/jgoodies-common-1.2.1.jar"/>
<include name="lib/jgoodies-forms.jar"/>
<include name="lib/jgoodies-looks-2.4.2.jar"/>
<include name="lib/jh.jar"/>
<include name="lib/jing.jar"/>
<include name="lib/jna-utils.jar"/>
<include name="lib/jna.jar"/>
<include name="lib/jps-launcher.jar"/>
<include name="lib/jps-server.jar"/>
<include name="lib/jsch-0.1.50.jar"/>
<include name="lib/jsr166e.jar"/>
<include name="lib/jsr173_1.0_api.jar"/>
<include name="lib/junit-4.10.jar"/>
<include name="lib/jzlib-1.1.1.jar"/>
<include name="lib/log4j.jar"/>
<include name="lib/markdownj-core-0.4.2-SNAPSHOT.jar"/>
<include name="lib/microba.jar"/>
<include name="lib/miglayout-swing.jar"/>
<include name="lib/nanoxml-2.2.3.jar"/>
<include name="lib/nekohtml-1.9.14.jar"/>
<include name="lib/netty-all-4.1.0.Alpha1.jar"/>
<include name="lib/openapi.jar"/>
<include name="lib/optimizedFileManager.jar"/>
<include name="lib/oromatcher.jar"/>
<include name="lib/picocontainer.jar"/>
<include name="lib/protobuf-2.5.0.jar"/>
<include name="lib/proxy-vole_20120920.jar"/>
<include name="lib/pty4j-0.3.jar"/>
<include name="lib/purejavacomm.jar"/>
<include name="lib/resolver.jar"/>
<include name="lib/resources.jar"/>
<include name="lib/resources_en.jar"/>
<include name="lib/rhino-js-1_7R4.jar"/>
<include name="lib/rngom-20051226-patched.jar"/>
<include name="lib/sanselan-0.98-snapshot.jar"/>
<include name="lib/serviceMessages.jar"/>
<include name="lib/snappy-java-1.0.5.jar"/>
<include name="lib/swingx-core-1.6.2.jar"/>
<include name="lib/trang-core.jar"/>
<include name="lib/trove4j.jar"/>
<include name="lib/trove4j_src.jar"/>
<include name="lib/util.jar"/>
<include name="lib/velocity.jar"/>
<include name="lib/winp-1.17-patched.jar"/>
<include name="lib/xbean.jar"/>
<include name="lib/xerces.jar"/>
<include name="lib/xmlrpc-2.0.jar"/>
<include name="lib/xpp3-1.1.4-min.jar"/>
<include name="lib/xstream-1.4.3.jar"/>
<include name="plugins/android/lib"/>
<include name="plugins/android/lib/android-common.jar"/>
<include name="plugins/android/lib/android-rt.jar"/>
<include name="plugins/android/lib/android.jar"/>
<include name="plugins/android/lib/androidAnnotations.jar"/>
<include name="plugins/android/lib/asm-4.0.jar"/>
<include name="plugins/android/lib/asm-analysis-4.0.jar"/>
<include name="plugins/android/lib/asm-tree-4.0.jar"/>
<include name="plugins/android/lib/assetstudio.jar"/>
<include name="plugins/android/lib/bcpkix-jdk15on-1.48.jar"/>
<include name="plugins/android/lib/bcprov-jdk15on-1.48.jar"/>
<include name="plugins/android/lib/builder-model-0.7.0.jar"/>
<include name="plugins/android/lib/common.jar"/>
<include name="plugins/android/lib/commons-codec-1.4.jar"/>
<include name="plugins/android/lib/commons-compress-1.0.jar"/>
<include name="plugins/android/lib/commons-logging-1.1.1.jar"/>
<include name="plugins/android/lib/ddmlib.jar"/>
<include name="plugins/android/lib/draw9patch.jar"/>
<include name="plugins/android/lib/dvlib.jar"/>
<include name="plugins/android/lib/easymock-3.1.jar"/>
<include name="plugins/android/lib/freemarker-2.3.19.jar"/>
<include name="plugins/android/lib/GoogleFeedback.jar"/>
<include name="plugins/android/lib/gradle-import.jar"/>
<include name="plugins/android/lib/guava-15.0.jar"/>
<include name="plugins/android/lib/httpclient-4.1.1.jar"/>
<include name="plugins/android/lib/httpcore-4.1.jar"/>
<include name="plugins/android/lib/httpmime-4.1.1.jar"/>
<include name="plugins/android/lib/jarutils.jar"/>
<include name="plugins/android/lib/junit.jar"/>
<include name="plugins/android/lib/kxml2-2.3.0.jar"/>
<include name="plugins/android/lib/layoutlib-api.jar"/>
<include name="plugins/android/lib/lint-api.jar"/>
<include name="plugins/android/lib/lint-checks.jar"/>
<include name="plugins/android/lib/manifest-merger.jar"/>
<include name="plugins/android/lib/mockito-all-1.9.5.jar"/>
<include name="plugins/android/lib/ninepatch.jar"/>
<include name="plugins/android/lib/perflib.jar"/>
<include name="plugins/android/lib/resources_en.jar"/>
<include name="plugins/android/lib/sdk-common.jar"/>
<include name="plugins/android/lib/sdklib.jar"/>
</fileset>
</path>
<property name="project.jdk.home" value="${idea.home}"/>
<property name="project.jdk.bin" value="${jdk.bin}"/>
<property name="project.jdk.classpath" value="jdk.classpath.idea"/>
<!-- Register Custom Compiler Taskdefs -->
<property name="javac2.home" value="${idea.home}/lib"/>
<path id="javac2.classpath">
<pathelement location="${javac2.home}/javac2.jar"/>
<pathelement location="${javac2.home}/jdom.jar"/>
<pathelement location="${javac2.home}/asm4-all.jar"/>
<pathelement location="${javac2.home}/jgoodies-forms.jar"/>
</path>
<target name="register.custom.compilers">
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
<taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions"
classpathref="javac2.classpath"/>
</target>
<!-- Modules -->
<!-- Module adb_idea -->
<dirname property="module.adb_idea.basedir" file="${ant.file}"/>
<property name="module.jdk.home.adb_idea" value="${project.jdk.home}"/>
<property name="module.jdk.bin.adb_idea" value="${project.jdk.bin}"/>
<property name="module.jdk.classpath.adb_idea" value="${project.jdk.classpath}"/>
<property name="compiler.args.adb_idea" value="-encoding UTF-8 -source 1.6 ${compiler.args}"/>
<property name="adb_idea.output.dir" value="${module.adb_idea.basedir}/out/production/adb_idea"/>
<property name="adb_idea.testoutput.dir" value="${module.adb_idea.basedir}/out/test/adb_idea"/>
<path id="adb_idea.module.bootclasspath">
<!-- Paths to be included in compilation bootclasspath -->
</path>
<path id="adb_idea.module.production.classpath">
<path refid="${module.jdk.classpath.adb_idea}"/>
<path refid="adb_idea.module.classpath" />
</path>
<path id="adb_idea.runtime.production.module.classpath">
<pathelement location="${adb_idea.output.dir}"/>
</path>
<path id="adb_idea.module.classpath">
<path refid="${module.jdk.classpath.adb_idea}"/>
<pathelement location="${adb_idea.output.dir}"/>
<fileset dir="lib/main">
<include name="**/*.jar" />
<exclude name="**/*-sources.jar" />
</fileset>
</path>
<path id="adb_idea.module.test.classpath">
<path refid="adb_idea.module.classpath"/>
<fileset dir="lib/test">
<include name="**/*.jar" />
<exclude name="**/*-sources.jar" />
</fileset>
</path>
<path id="adb_idea.runtime.module.classpath">
<pathelement location="${adb_idea.testoutput.dir}"/>
<pathelement location="${adb_idea.output.dir}"/>
</path>
<patternset id="excluded.from.module.adb_idea">
<patternset refid="ignored.files"/>
</patternset>
<patternset id="excluded.from.compilation.adb_idea">
<patternset refid="excluded.from.module.adb_idea"/>
</patternset>
<path id="adb_idea.module.sourcepath">
<dirset dir="${module.adb_idea.basedir}">
<include name="src"/>
</dirset>
</path>
<path id="adb_idea.module.test.sourcepath">
<dirset dir="${module.adb_idea.basedir}">
<include name="test"/>
</dirset>
</path>
<target name="compile.module.adb_idea" depends="compile.module.adb_idea.production,compile.module.adb_idea.tests"
description="Compile module adb_idea"/>
<target name="compile.module.adb_idea.production" depends="register.custom.compilers"
description="Compile module adb_idea; production classes">
<mkdir dir="${adb_idea.output.dir}"/>
<javac2 destdir="${adb_idea.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}"
memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.adb_idea}/javac"
target="1.6" source="1.6">
<compilerarg line="${compiler.args.adb_idea}"/>
<bootclasspath refid="adb_idea.module.bootclasspath"/>
<classpath refid="adb_idea.module.production.classpath"/>
<src refid="adb_idea.module.sourcepath"/>
<patternset refid="excluded.from.compilation.adb_idea"/>
</javac2>
<copy todir="${adb_idea.output.dir}">
<fileset dir="${module.adb_idea.basedir}/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.adb_idea.tests" depends="register.custom.compilers,compile.module.adb_idea.production"
description="compile module adb_idea; test classes" unless="skip.tests">
<mkdir dir="${adb_idea.testoutput.dir}"/>
<javac2 destdir="${adb_idea.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}"
memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.adb_idea}/javac">
<compilerarg line="${compiler.args.adb_idea}"/>
<bootclasspath refid="adb_idea.module.bootclasspath"/>
<classpath refid="adb_idea.module.test.classpath"/>
<src refid="adb_idea.module.test.sourcepath"/>
<patternset refid="excluded.from.compilation.adb_idea"/>
</javac2>
<copy todir="${adb_idea.testoutput.dir}">
<fileset dir="${module.adb_idea.basedir}/test">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="clean.module.adb_idea" description="cleanup module">
<delete dir="${adb_idea.output.dir}"/>
<delete dir="${adb_idea.testoutput.dir}"/>
</target>
<property name="adb_idea.plugin.path.jar" value="${module.adb_idea.basedir}/${plugin.name}-${plugin.version}.jar"/>
<!-- Build archive for plugin 'adb_idea' -->
<target name="plugin.build.jar.adb_idea" depends="compile.module.adb_idea"
description="Build plugin archive for module 'adb_idea'">
<jar destfile="${adb_idea.plugin.path.jar}" duplicate="preserve">
<zipfileset dir="${module.adb_idea.basedir}/out/production/adb_idea"/>
<zipfileset file="${module.adb_idea.basedir}/META-INF/plugin.xml" prefix="META-INF"/>
<manifest>
<attribute name="Created-By" value="IntelliJ IDEA"/>
<attribute name="Manifest-Version" value="1.0"/>
</manifest>
</jar>
</target>
<target name="init" description="Build initialization">
<!-- Perform any build initialization in this target -->
</target>
<target name="clean" depends="clean.module.adb_idea" description="cleanup all"/>
<target name="build.modules" depends="init, clean, plugin.build.jar.adb_idea" description="build all modules"/>
<target name="all" depends="build.modules" description="build all"/>
<!--
Will remove the previous plugin and add this one to the plugin directory
The plugin directory is denoted by the ${deploy.plugin.dir} variable in the local.properties file.
On OSX, this path is located at: ~/Library/Application Support/AndroidStudioPreview
-->
<target name="deploy">
<delete>
<fileset dir="${deploy.plugin.dir}" includes="${plugin.name}*"/>
</delete>
<copy file="${adb_idea.plugin.path.jar}" todir="${deploy.plugin.dir}"/>
</target>
</project>