-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
86 lines (71 loc) · 3.14 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- This DOCTYPE tag shuts off the warning from Eclipse that there is no DTD
associated with this XML file. -->
<!DOCTYPE project>
<project name="find-non-ascii" default="dist-zip" basedir=".">
<echo message="java.home=${java.home}"/>
<property name="main.class" value="com.alteredmechanism.apps.find_non_ascii.FindNonAsciiCharacters" />
<property name="version" value="2.0.0" />
<property name="src.dir" value="src/main/java" />
<property name="res.dir" value="src/main/resources" />
<property name="scripts.dir" value="src/main/scripts" />
<property name="target.dir" value="target" />
<property name="cls.dir" value="${target.dir}/classes" />
<property name="assemble.dir" value="${target.dir}/assemble" />
<property name="jar" value="${target.dir}/${ant.project.name}.jar" />
<property name="dist.zip" value="${target.dir}/${ant.project.name}-${version}.zip" />
<target name="compile" description="Compiles the source">
<mkdir dir="${cls.dir}" />
<javac srcdir="${src.dir}" destdir="${cls.dir}" classpath="${cls.dir}"
debug="on" includeAntRuntime="false" />
</target>
<target name="copy.res" description="Copy resources">
<copy todir="${cls.dir}">
<fileset dir="${res.dir}">
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="setup">
<mkdir dir="${target.dir}"/>
</target>
<target name="jar" depends="compile" description="Builds an executable jar file">
<jar destfile="${jar}" basedir="${cls.dir}">
<manifest>
<attribute name="Implementation-Title" value="${ant.project.name}" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
</target>
<target name="dist-zip" depends="jar"
description="Builds a zip file for distribution to end users">
<copy todir="${assemble.dir}">
<fileset dir="${scripts.dir}">
<include name="**/*"/>
<exclude name=".*.swp"/>
</fileset>
</copy>
<copy file="${jar}" todir="${assemble.dir}"/>
<zip destfile="${dist.zip}">
<fileset dir="${assemble.dir}">
<include name="**/*"/>
</fileset>
<fileset dir=".">
<include name="README.md"/>
</fileset>
</zip>
</target>
<target name="unix-install" description="Installs runnable files to local system">
<!-- The copy command does not preserve the execute permissions. -->
<exec executable="cp">
<arg value="${scripts.dir}/find-non-ascii"/>
<arg value="/usr/local/bin"/>
</exec>
<copy file="${jar}" todir="/usr/local/share/java"/>
</target>
<target name="clean">
<delete dir="${target.dir}" verbose="true" />
</target>
</project>