-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
105 lines (92 loc) · 4.3 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright 2010 David Yeung
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project name="coffeescript-idea" default="generate-lexer">
<property name="idea.home" value="${basedir}/../idea"/>
<target name="bootstrap">
<exec executable="${basedir}/VERSION-GEN" dir="${basedir}" outputproperty="version"/>
<echo message="${version}"/>
</target>
<taskdef name="javac2" classname="com.intellij.ant.Javac2">
<classpath refid="idea.classpath"/>
</taskdef>
<taskdef name="jflex" classname="JFlex.anttask.JFlexTask">
<classpath location="${idea.home}/tools/lexer/jflex-1.4/lib/JFlex.jar"/>
</taskdef>
<path id="idea.classpath">
<fileset dir="${idea.home}">
<include name="lib/*.jar"/>
<include name="redist/*.jar"/>
</fileset>
<fileset dir="/Applications/IntelliJ IDEA 9.0.1 CE.app/lib/">
<include name="*.jar"/>
</fileset>
</path>
<target name="generate-lexer">
<jflex skeleton="${idea.home}/tools/lexer/idea-flex.skeleton" nobak="true"
file="${basedir}/src/coffeescript/lang/lexer.flex"
destdir="${basedir}/src"
charat="true"/>
</target>
<target name="clean">
<delete dir="${basedir}/target"/>
</target>
<target name="init" depends="clean, bootstrap">
<mkdir dir="${basedir}/target/classes"/>
<mkdir dir="${basedir}/target/test-classes"/>
<mkdir dir="${basedir}/target/junit"/>
<mkdir dir="${basedir}/target/test-reports"/>
</target>
<target name="resources" depends="init, generate-lexer">
<copy todir="${basedir}/target/classes">
<fileset dir="${basedir}/resources"/>
<filterchain ><expandproperties/></filterchain>
</copy>
</target>
<target name="compile" depends="resources">
<javac2 srcdir="${basedir}/src" destdir="${basedir}/target/classes" source="1.5" target="1.5">
<classpath refid="idea.classpath"/>
</javac2>
<javac2 srcdir="${basedir}/test" destdir="${basedir}/target/test-classes" source="1.5" target="1.5">
<classpath refid="idea.classpath"/>
<classpath location="${basedir}/target/classes"/>
</javac2>
</target>
<target name="unit-test" depends="compile">
<junit failureproperty="unit-test.fail" forkmode="once" fork="yes" includeantruntime="yes"
tempdir="${basedir}/target/junit" printsummary="yes" showoutput="yes">
<classpath location="${basedir}/target/classes"/>
<classpath location="${basedir}/target/test-classes"/>
<classpath refid="idea.classpath"/>
<formatter type="xml"/>
<batchtest todir="${basedir}/target/test-reports" fork="yes">
<fileset dir="${basedir}/target/test-classes" includes="**/*UnitTest.class"/>
</batchtest>
</junit>
<fail if="unit-test.fail" message="unit tests failed see ${basedir}/target/test-reports"/>
</target>
<target name="jar" depends="unit-test" description="build jar">
<mkdir dir="${basedir}/target/jar"/>
<jar file="${basedir}/target/jar/coffeescript-idea.${version}.jar" compress="true">
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<zipfileset dir="${basedir}/target/classes"/>
</jar>
</target>
<target name="install-in-rubymine-on-mac" description="deploy built jar to existing rubymine 2.0 installation">
<delete dir="${user.home}/Library/Application Support/RubyMine20" includes="coffeescript-idea*.jar"/>
<copy todir="${user.home}/Library/Application Support/RubyMine20"><fileset dir="${basedir}/target/jar" includes="*.jar"/></copy>
</target>
</project>