-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
124 lines (114 loc) · 5.21 KB
/
Copy pathbuild.xml
File metadata and controls
124 lines (114 loc) · 5.21 KB
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
<project name="CoffeeScriptSideKick" default="dist.nojavadoc">
<description>
Ant build file the CoffeeScriptSideKick plugin for jEdit.
</description>
<property file="../build.properties" />
<property file="build.properties" />
<property name="user-doc.xml" location="users-guide.xml" />
<property name="src.dir" location="src" />
<property name="build.dir" location="build" /> <!-- define as location -->
<property name="javadoc.packagenames" value="sidekick.coffeescript" />
<!-- Properties for building from the CoffeeScript source. -->
<property name="node.executable" value="node" />
<property name="coffeescript.dir" location="coffee-script" />
<property name="javascript.file" location="./CoffeeScriptParser.js" />
<import file="${build.support}/plugin-build.xml" />
<path id="project.class.path">
<pathelement location="${jedit.plugins.dir}/SideKick.jar" />
<pathelement location="${jedit.plugins.dir}/ErrorList.jar" />
<pathelement location="${jedit.plugins.dir}/rhino.jar" />
<pathelement location="${jedit.plugins.dir}/eclipseicons.jar" />
</path>
<!-- Redefine to exclude superfluous files from the CoffeeScript repo. -->
<selector id="extraFiles">
<and>
<or>
<filename name="**/actions.xml" />
<filename name="**/browser.actions.xml" />
<filename name="**/dockables.xml" />
<filename name="**/services.xml" />
<filename name="**/*.props" />
<filename name="**/lang_*.properties" />
<filename name="**/LICENSE" />
<filename name="**/README" />
</or>
<not>
<filename name="coffee-script/**" />
</not>
</and>
</selector>
<target name="build.prepare">
<antcall target="compile.coffeescript" />
<antcall target="compile.javascript" />
</target>
<target name="check-javascript-file">
<!-- Check whether any CoffeeScript source files have been altered.
* Compute checksum over all *.coffee files in src.dir and save
in property "coffeescript.checksum".
* Read the checksum of the previous compilation from the last
line of the javascript.file.
* Set "should.compile.coffeescript" if the checksums differ.
-->
<checksum totalproperty="coffeescript.checksum"
todir="${build.dir}/checksums" forceoverwrite="yes">
<files includes="${src.dir}/*.coffee" />
</checksum>
<loadfile property="coffeescript.checksum.old"
srcfile="${javascript.file}" failonerror="false">
<filterchain>
<tailfilter lines="1" />
<deletecharacters chars="/" />
</filterchain>
</loadfile>
<condition property="should.compile.coffeescript">
<not>
<equals arg1="${coffeescript.checksum}"
arg2="${coffeescript.checksum.old}"
trim="true" />
</not>
</condition>
</target>
<target name="compile.coffeescript"
depends="check-javascript-file" if="should.compile.coffeescript">
<!-- Explicit mkdir to prevent the infamous "-p" dir in Windows. -->
<mkdir dir="${build.dir}/coffee-script" />
<!-- Execute "cake build" to build the javascript.file. -->
<exec executable="${node.executable}" failonerror="true">
<arg value="${coffeescript.dir}/bin/cake" />
<arg line="--source ${src.dir}" />
<arg line="--build ${build.dir}/coffee-script" />
<arg line="--dist ${javascript.file}" />
<arg line="--node ${node.executable}" />
<arg line="--coffeescript ${coffeescript.dir}" />
<arg value="build" />
</exec>
<!-- Write checksum of CoffeeScript source files to the last line. -->
<echo file="${javascript.file}" append="true"
message="${line.separator}// ${coffeescript.checksum}" />
</target>
<target name="compile.javascript">
<!-- First compile interface file (utilizing "compile" task)-->
<selector id="parserInterfaceFile">
<filename name="**/ICoffeeScriptParser.java" />
</selector>
<antcall target="compile">
<reference torefid="compileFiles" refid="parserInterfaceFile" />
</antcall>
<!-- Compile javascript.file with Rhinos JavaScript compiler. -->
<java fork="yes"
classname="org.mozilla.javascript.tools.jsc.Main"
failonerror="true">
<classpath>
<path refid="default.class.path" />
<path refid="project.class.path" />
<pathelement path="${build.classes}" />
</classpath>
<arg line="-opt 1" />
<arg line="-nosource" />
<arg line="-implements sidekick.coffeescript.ICoffeeScriptParser" />
<arg line="-package sidekick.coffeescript" />
<arg line="-d ${build.classes}" />
<arg value="${javascript.file}" />
</java>
</target>
</project>