Child: [f9a9cc] (diff)

Download this file

build.xml    130 lines (106 with data), 4.5 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
<?xml version = "1.0" encoding = "utf-8"?>
<project name="TavernaExtractorConverter" default="build" basedir=".">
<description>Taverna Extractor + Archi Converter</description>
<property name="readMe" location="./README.md" />
<property name="src" location="./src" />
<property name="samples" location="./samples" />
<property name="build" location="./bin" />
<property name="lib" location="./lib" />
<property name="dist" location="./dist" />
<property name="jarfileBasename" value="taverna2archi" />
<property name="jarfile" value="${jarfileBasename}.jar" />
<property name="jarfileFat" value="${jarfileBasename}-inclLib.jar" />
<property name="props" location="TavernaExtractor.properties" />
<path id="classpath">
<pathelement location="${build}" />
<fileset dir="${lib}" />
</path>
<target name="jar" depends="clean, build" description="Generates an out-of-the-box executable jar">
<copy todir="${dist}/build">
<fileset dir="${build}" />
</copy>
<copy todir="${dist}/sampleFiles">
<fileset dir="${samples}" />
</copy>
<copy todir="${dist}" file="${lib}/droid/droid-command-line-6.1.3.jar" />
<copy todir="${dist}" file="${readMe}" />
<copy todir="${dist}" file="${props}" />
<copy todir="${dist}/lib" flatten="true">
<fileset dir="lib" />
</copy>
<pathconvert property="libs.project" pathsep=" ">
<mapper>
<globmapper from="${dist}/lib*" to="lib*" handledirsep="yes" />
</mapper>
<path>
<fileset dir="${dist}/lib">
<include name="**/*.jar" />
</fileset>
</path>
</pathconvert>
<jar jarfile="${dist}/TavernaExtractor.jar" basedir="${dist}/build">
<manifest>
<attribute name="Class-Path" value="${libs.project}" />
<attribute name="Main-Class" value="net.timbusproject.extractors.Main" />
</manifest>
</jar>
<delete dir="${dist}/build" />
<delete dir="${dist}/sampleFiles" />
</target>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="build" depends="init" description="build ">
<javac srcdir="${src}" destdir="${build}" debug="true">
<classpath refid="classpath" />
</javac>
</target>
<target name="dist" depends="build" description="generate the distribution">
<mkdir dir="${dist}" />
<jar jarfile="${dist}/${jarfile}" basedir="${build}" manifest="META-INF/MANIFEST.MF" />
</target>
<target name="dist-standalone" depends="dist" description="Build a single jar containing also the full classpath">
<!-- We want to exclude some files from the generated jar, namely individual MANIFEST, LICENSE and README files -->
<!-- Otherwise, if we merge MANIFEST files, we might end up with an invalid main class set (one from the other JAR files) -->
<!-- It seems this it is not possibly to exclude specific files in a ZIP/JAR file when using zipgroupfileset -->
<!-- Thus, employing workaround described at http://stackoverflow.com/questions/1274879/ant-exclude-files-from-merged-jar-file -->
<!-- First, bundle all external libraries in a fat jar external-libs -->
<jar jarfile="${dist}/external-libs.jar" filesetmanifest="skip">
<zipgroupfileset dir="${lib}" includes="**/*.jar" />
</jar>
<sleep seconds="1" />
<!-- Then merge with our jar, excluding everything in /META-INF in the external-libs fat jar -->
<jar destfile="${dist}/${jarfileFat}" filesetmanifest="merge">
<manifest>
<attribute name="Class-Path" value="${libs.project}" />
<section name="Referenced Libs">
<attribute name="Info" value="Additional libraries are provided as-is, and might fall under different licenses." />
</section>
</manifest>
<zipgroupfileset file="${dist}/${jarfile}" />
<zipfileset src="${dist}/external-libs.jar">
<exclude name="META-INF/**" />
</zipfileset>
</jar>
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete dir="${dist}" />
<delete file="${jarfile}" />
</target>
<target name="doc" depends="build">
<delete dir="${doc}" />
<mkdir dir="${doc}" />
<mkdir dir="${doc}/api" />
<javadoc windowtitle="Taverna2Archi API" sourcepath="${src}" destdir="${doc}/api" packagenames="*" package="yes">
<classpath refid="classpath" />
</javadoc>
</target>
<target name="TavernaExtractor" depends="build" description="Runs the TavernaExtractor">
<java classname="net.timbusproject.extractors.Main" failonerror="true" fork="yes">
<arg line="${args}" />
<classpath refid="classpath" />
</java>
</target>
</project>