-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
85 lines (74 loc) · 2.79 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
<?xml version="1.0" ?>
<project name="EditorConfigJava" default="all" basedir=".">
<property name="tmp.dir" value="${basedir}/tmp" />
<property name="editorconfig.py.dir" value="./editorconfig-core-py" />
<property name="build.dir" value="./build" />
<path id="jython.path">
<pathelement location="${tmp.dir}/jython.jar" />
</path>
<!-- Build EditorConfig Java wrapper -->
<target name="build-java-wrapper">
<mkdir dir="./classes" />
<javac srcdir="./src" destdir="./classes">
<classpath refid="jython.path" />
</javac>
</target>
<!-- Download jython installer -->
<property name="jython.url" value="http://downloads.sourceforge.net/project/jython/jython/2.2.1/jython_installer-2.2.1.jar" />
<target name="download-jython">
<mkdir dir="${tmp.dir}" />
<get src="${jython.url}" dest="${tmp.dir}/jython_installer.jar" usetimestamp="true" verbose="true" />
</target>
<!-- unpack jython installer -->
<target name="unpack-jython" depends="download-jython">
<java jar="${tmp.dir}/jython_installer.jar" fork="true">
<arg value="-s" />
<arg value="-v" />
<arg value="-d" />
<arg value="${tmp.dir}/install" />
<arg value="-t" />
<arg value="standalone" />
</java>
<move file="${tmp.dir}/install/jython.jar" todir="${tmp.dir}" />
</target>
<!-- pack jython EditorConfig -->
<target name="pack-jython-editorconfig" depends="unpack-jython,build-java-wrapper">
<fail message="Missing editorconfig-core-py files. Please run 'git submodule update --recursive' to have those files."> <!-- editorconfig.py.dir can't be empty-->
<condition>
<not>
<available file="${editorconfig.py.dir}/editorconfig/main.py"/>
</not>
</condition>
</fail>
<mkdir dir="${build.dir}" />
<jar destfile="${build.dir}/editorconfig.jar">
<fileset dir="./classes">
<include name="**/*.class" />
</fileset>
<zipfileset src="${tmp.dir}/jython.jar" />
<zipfileset dir="${editorconfig.py.dir}" prefix="Lib/">
<include name="editorconfig/**.py" />
</zipfileset>
<fileset file="./README.md" />
<fileset file="./LICENSE.txt" />
</jar>
</target>
<target name="doc" depends="unpack-jython">
<mkdir dir="./doc" />
<javadoc sourcepath="./src" destdir="./doc" locale="en_US"
windowtitle="EditorConfig Java Library API Documentation"
linksource="true" nodeprecatedlist="true">
<classpath>
<fileset file="${tmp.dir}/jython.jar" />
</classpath>
<link href="http://docs.oracle.com/javase/6/docs/api/" />
</javadoc>
</target>
<target name="clean">
<delete dir="build" />
<delete dir="classes" />
<delete dir="tmp" />
</target>
<target name="all" depends="pack-jython-editorconfig">
</target>
</project>