forked from MangoAutomation/BACnet4J
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
148 lines (128 loc) · 6.07 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
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
<?xml version="1.0"?>
<project name="BACnet4J" basedir="." default="deploy" xmlns:mvn="antlib:org.apache.maven.artifact.ant">
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="lib-opt/ant-contrib-1.0b3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpath="lib-opt/maven-ant-tasks-2.1.3.jar" />
<mvn:pom file="pom.xml" id="maven-pom" />
<mvn:dependencies filesetId="maven-deps" type="jar" pomRefId="maven-pom" />
<mvn:dependencies filesetId="maven-deps-runtime" type="jar" pomRefId="maven-pom" useScope="runtime" />
<property name="fullName" value="${maven-pom.artifactId}-${maven-pom.version}" />
<path id="master-classpath">
<fileset refid="maven-deps" />
</path>
<property file="build.properties" />
<target name="clean" description="Clean the target area">
<delete dir="target" />
</target>
<target name="compile" description="Compile main source tree java files">
<mkdir dir="target" />
<javac destdir="target" target="1.7" source="1.7" debug="true" debuglevel="lines,vars,source" deprecation="true" optimize="false" failonerror="true">
<src path="src/main/java" />
<classpath refid="master-classpath" />
</javac>
</target>
<target name="jar" depends="clean,compile" description="Create a jar file of the compiled classes">
<delete file="release/${maven-pom.version}/${fullName}.jar" />
<jar destfile="release/${maven-pom.version}/${fullName}.jar">
<fileset dir="target">
<include name="**/*.class" />
</fileset>
</jar>
</target>
<target name="src-zip" description="Create a jar file of the source">
<delete file="release/${maven-pom.version}/${fullName}-src.zip" />
<zip destfile="release/${maven-pom.version}/${fullName}-src.zip">
<fileset dir="src/main/java">
<include name="**/*.java" />
</fileset>
<fileset dir="src/test/java">
<include name="**/*.java" />
</fileset>
<fileset dir="src_test">
<include name="**/*.java" />
</fileset>
</zip>
</target>
<target name="doc-zip" description="Create a jar file of the javadocs">
<javadoc destdir="target/javadoc" author="true" version="true" use="true" windowtitle="BACnet4j">
<fileset dir="src/main/java" defaultexcludes="yes">
</fileset>
<doctitle><![CDATA[<h1>BACnet4j</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2015 Infinite Automation Systems. All Rights Reserved.</i>]]></bottom>
</javadoc>
<delete file="release/${maven-pom.version}/${fullName}-doc.zip" />
<zip destfile="release/${maven-pom.version}/${fullName}-doc.zip">
<fileset dir="target/javadoc">
<include name="**/*" />
</fileset>
</zip>
</target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="lib-opt/ant-contrib-1.0b3.jar" />
<target name="deploy" depends="jar" description="Copy the jar file to the places where it is needed">
<foreach list="${deploy.jar.paths}" target="|deploy" param="todir" delimiter=":">
<param name="deploy.file" value="release/${maven-pom.version}/${fullName}.zip" />
</foreach>
<foreach list="${deploy.src.paths}" target="|deploy" param="todir" delimiter=":">
<param name="deploy.file" value="release/${maven-pom.version}/${fullName}-src.zip" />
</foreach>
</target>
<target name="|deploy">
<copy todir="${todir}" preservelastmodified="true" file="${deploy.file}" />
</target>
<!-- override as necessary to install elsewhere
<property name="maven.local" value="~/maven-repo" />
-->
<target name="maven-deploy" depends="jar,src-jar,doc-jar" description="Install library to Maven repository located at ${maven.local} if defined and install in user's local Maven">
<if>
<isset property="maven.local" />
<then>
<mvn:deploy file="release/${maven-pom.version}/${fullName}.jar">
<remoterepository url="file://${maven.local}" />
<pom refid="maven-pom" />
<attach file="release/${maven-pom.version}/${fullName}-src.jar"
type="jar"
classifier="sources" />
<attach file="release/${maven-pom.version}/${fullName}-doc.jar"
type="jar"
classifier="javadoc" />
</mvn:deploy>
</then>
</if>
<mvn:install file="release/${maven-pom.version}/${fullName}.jar">
<attach file="release/${maven-pom.version}/${fullName}-src.jar"
type="jar"
classifier="sources" />
<attach file="release/${maven-pom.version}/${fullName}-doc.jar"
type="jar"
classifier="javadoc" />
<pom refid="maven-pom" />
</mvn:install>
</target>
<target name="doc-jar" description="Create a jar file of the javadocs">
<javadoc destdir="target/javadoc" author="true" version="true" use="true" windowtitle="BACnet4j">
<fileset dir="src/main/java" defaultexcludes="yes">
</fileset>
<doctitle><![CDATA[<h1>BACnet4j</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2015 Infinite Automation Systems. All Rights Reserved.</i>]]></bottom>
</javadoc>
<delete file="release/${maven-pom.version}/${fullName}-doc.jar" />
<zip destfile="release/${maven-pom.version}/${fullName}-doc.jar">
<fileset dir="target/javadoc">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="src-jar" description="Create a jar file of the source">
<delete file="release/${maven-pom.version}/${fullName}-src.jar" />
<zip destfile="release/${maven-pom.version}/${fullName}-src.jar">
<fileset dir="src/main/java">
<include name="**/*.java" />
</fileset>
<fileset dir="src/test/java">
<include name="**/*.java" />
</fileset>
<fileset dir="src_test">
<include name="**/*.java" />
</fileset>
</zip>
</target>
</project>