forked from dragon66/icafe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
87 lines (87 loc) · 3.38 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
<?xml version="1.0"?>
<project name= "icafe" default="package" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>
Ant build.xml file for building the icafe library.
</description>
<!-- define Maven coordinates -->
<property name="groupId" value="com.github.dragon66" />
<property name="artifactId" value="icafe" />
<property name="version" value="1.1-SNAPSHOT" />
<!-- there server id in the Maven settings.xml -->
<property name="ossrh-server-id" value="ossrh" />
<property name="ossrh-snapshots-repository-url"
value="https://oss.sonatype.org/content/repositories/snapshots" />
<!-- define artifacts' name, which follows the convention of Maven -->
<property name="jar" value="lib/${artifactId}-${version}.jar" />
<path id="icafe.classpath">
<fileset dir="lib">
<include name="*.jar"/>
<exclude name="icafe.jar"/>
</fileset>
</path>
<fileset id="icafe.source.path" dir="src" defaultexcludes="yes">
<include name="**/*.java"/>
<exclude name="**/document/**/*.java"/>
<exclude name="**/game/**/*.java"/>
<exclude name="**/graphics/**/*.java"/>
<exclude name="**/processing/*.java"/>
<exclude name="**/scripting/**/*.java"/>
</fileset>
<target name="init" depends="clean">
<mkdir dir="build/classes"/>
<mkdir dir="dist"/>
<mkdir dir="build/doc"/>
<copy includeemptydirs="false" todir="build/classes">
<fileset dir="src">
<include name="*"/>
<include name="resources/CMYK Profiles/USWebCoatedSWOP.icc"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="build"/>
<delete dir="dist"/>
</target>
<target name="doc" depends="init" >
<javadoc destdir="build/doc" classpathref="icafe.classpath" additionalparam="-notimestamp" packagenames="cafe.*">
<fileset refid="icafe.source.path"/>
</javadoc>
</target>
<target name="compile" depends="init">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac includeantruntime="false" srcdir="src" destdir="build/classes"
encoding="UTF-8" classpathref="icafe.classpath">
<exclude name="**/document/**/*.java"/>
<exclude name="**/game/**/*.java"/>
<exclude name="**/graphics/**/*.java"/>
<exclude name="**/processing/*.java"/>
<exclude name="**/scripting/**/*.java"/>
</javac>
</target>
<target name="package" depends="compile, doc">
<jar destfile="dist/icafe.jar">
<fileset dir="build/classes"/>
<fileset dir="build">
<include name="doc/**/*"/>
</fileset>
</jar>
<delete file="lib/icafe.jar"/>
<copy file="dist/icafe.jar" todir="lib"/>
</target>
<target name="package-snapshot">
<jar destfile="dist/${artifactId}-${version}.jar">
<fileset dir="build/classes"/>
</jar>
<delete file="{jar}"/>
<copy file="dist/${artifactId}-${version}.jar" todir="lib"/>
</target>
<target name="deploy" depends="package, package-snapshot" description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" />
<arg value="-Durl=${ossrh-snapshots-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${jar}" />
</artifact:mvn>
</target>
</project>