Menu

[r574]: / CodeSounding / trunk / build.xml  Maximize  Restore  History

Download this file

189 lines (159 with data), 7.0 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
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
<project name="CodeSounding" default="jar.embedded.codesounding" basedir=".">
<property name="src" value="${basedir}/src"/>
<property name="build" value="${basedir}/bin"/>
<property name="lib" value="${basedir}/lib"/>
<property name="dist" value="${basedir}/dist"/>
<property name="jalopyDest" value="${basedir}/jalopyDest"/>
<path id="cp.compile">
<pathelement location="${lib}/antlr-3.0.jar"/>
<pathelement location="${lib}/jjack.jar"/>
<pathelement location="${lib}/stringtemplate.jar"/>
<pathelement location="${lib}/jmusic.jar"/>
<pathelement location="${lib}/commons-cli-1.1.jar"/>
</path>
<path id="cp.antlr.grammar">
<pathelement location="${lib}/antlr-3.0.jar"/>
<pathelement location="${lib}/antlr-2.7.7.jar"/>
<pathelement location="${lib}/stringtemplate.jar"/>
</path>
<path id="cp.test.grammar">
<path refid="cp.antlr.grammar"/>
<path location="${build}"/>
</path>
<path id="cp.license.jalopy">
<fileset dir="${lib}/jalopy">
<include name="*.jar" />
</fileset>
</path>
<target name="license.jalopy">
<taskdef name="jalopy"
classname="de.hunsicker.jalopy.plugin.ant.AntPlugin" classpathref="cp.license.jalopy">
</taskdef>
<jalopy convention="conf_jalopy_license.xml">
<fileset dir="${src}">
<include name="**/*.java" />
<exclude name="**/test/**"/>
</fileset>
<fileset dir="jsyn">
<!--
NOTE: this jalopy's version does not support Java annotations; replace them before running the task:
@Override -> //@Override
-->
<include name="**/*.java" />
</fileset>
</jalopy>
</target>
<target name="getJavaVersion">
<java fork="true" classname="fake" outputproperty="long.version" >
<jvmarg value="-version" />
</java>
<echo>Java long version: ${long.version}</echo>
<condition property="checkVersion">
<contains string="${long.version}" substring="gij (GNU libgcj)" />
</condition>
<echo>Going to add 1.5 flag? ${checkVersion}</echo>
</target>
<target name="jar.codesounding.conVersion" depends = "getJavaVersion" if = "checkVersion">
<javac target="1.5" srcdir="${src}"
destdir="${build}"
classpathref="cp.compile">
<compilerarg value = "-1.5"/>
</javac>
<echo>with -1.5 flag</echo>
</target>
<target name="jar.codesounding.senzaVersion" depends = "getJavaVersion" unless = "checkVersion">
<javac target="1.5" srcdir="${src}"
destdir="${build}"
classpathref="cp.compile">
</javac>
<echo>without -1.5 flag</echo>
</target>
<target name="compile.jar.codesounding" depends = "jar.codesounding.senzaVersion, jar.codesounding.conVersion">
<echo >** compiled **</echo>
</target>
<!-- depends="antlr.processGrammar, license.jalopy" -->
<target name="jar.codesounding" >
<delete failonerror="false">
<fileset dir="${build}"/>
<fileset dir="${dist}"/>
</delete>
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
<antcall target="compile.jar.codesounding"></antcall>
<copy tofile="${build}/codesounding/basicProcessor.stg" file="${src}/codesounding/basicProcessor.stg"/>
<jar destfile="${dist}\codesounding.jar" basedir="${build}">
<include name="**/*.class"/>
<include name="**/*.stg"/>
<exclude name="**/test/**"/>
<metainf dir=".">
<include name="LICENSE"/>
</metainf>
</jar>
</target>
<target name="jar.embedded.codesounding" depends="jar.codesounding">
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${lib}/jarjar-1.0rc3.jar"/>
<jarjar jarfile="${dist}/codesounding-embedded.jar">
<zipfileset src="${dist}/codesounding.jar"/>
<zipfileset src="${lib}/jmusic.jar"/>
<rule pattern="jm.**" result="cs.jm.@1"/>
<rule pattern="jmms.**" result="cs.jmms.@1"/>
<rule pattern="jmqt.**" result="cs.jmqt.@1"/>
<zipfileset src="${lib}/antlr-3.0.jar"/>
<zipfileset src="${lib}/stringtemplate.jar"/>
<rule pattern="org.antlr.**" result="cs.org.antlr.@1"/>
<zipfileset src="${lib}/antlr-2.7.7.jar"/>
<rule pattern="antlr.**" result="cs.antlr.@1"/>
<zipfileset src="${lib}/commons-cli-1.1.jar" excludes="**/META-INF/LICENSE.*"/>
<rule pattern="org.apache.commons.cli.**" result="cs.org.apache.commons.cli.@1"/>
<!-- cannot embed, because native JNI matchs the qualified class name
<zipfileset src="${lib}/jjack.jar"/>
<rule pattern="com.petersalomonsen.**" result="cs.com.petersalomonsen.@1"/>
<rule pattern="de.gulden.**" result="cs.de.gulden.@1"/>
<rule pattern="JJack*" result="cs.JJack@1"/>
-->
<metainf dir=".">
<include name="LICENSE_commons_cli.txt"/>
<include name="LICENSE_jMusic.txt"/>
<include name="LICENSE_ANTLR.txt"/>
<include name="LICENSE_jjack.txt"/>
</metainf>
</jarjar>
</target>
<target name="sonifier" depends="jar.codesounding">
<taskdef name="sonify" classpathref="cp.test.grammar" classname="codesounding.ant.TaskTemplateApplier"/>
<sonify destDir="destrew">
<fileset dir="src" includes="**/*.java" excludes="**/antlr/**" />
</sonify>
</target>
<target name="sonifierEclipse" depends="jar.codesounding">
<taskdef name="sonify" classpathref="cp.test.grammar" classname="codesounding.ant.TaskTemplateApplier"/>
<sonify destDir="D:\sounding\eclipse-sourceBuild-srcIncluded-3.2.1_rewritten" template="basicProcessor.stg">
<fileset dir="D:\sounding\eclipse-sourceBuild-srcIncluded-3.2.1" includes="**/*.java" />
</sonify>
</target>
<target name="antlr.testGrammar" depends="jar.codesounding">
<taskdef name="applyTestTemplate" classpathref="cp.test.grammar" classname="codesounding.test.TestRewrite"/>
<applyTestTemplate
rootDir="${src}/codesounding/test"
template="JavaRewrite.stg"
sourceJava="ToParse.java"
compareWith="Compare.txt"
/>
<delete>
<fileset dir="${build}">
<include name="**/ToParse*.class"/>
</fileset>
</delete>
<javac srcdir="${src}"
target="1.5"
listfiles="true"
includes="**/test/ToParse.java"
destdir="${build}">
</javac>
</target>
<target name="antlr.processGrammar">
<java fork="true" classname="org.antlr.Tool" classpathref="cp.antlr.grammar">
<arg value="${src}/codesounding/antlr/JavaRewrite.g"/>
</java>
</target>
</project>