forked from leafgray/pysonar2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
99 lines (81 loc) · 2.85 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="PySonar2" default="dist" basedir=".">
<description>
PySonar2 Build File
</description>
<!-- set global properties for this build -->
<property name="jar.file" value="PySonar2"/>
<property name="src.dir" location="src"/>
<property name="lib.dir" location="lib"/>
<property name="build.dir" location="build"/>
<property name="dist.dir" location="dist"/>
<property name="meta-inf.dir" location="META-INF"/>
<property name="manifest.file" value="MANIFEST.MF"/>
<property name="manifest.path" value="${meta-inf.dir}/${manifest.file}"/>
<property name="debuglevel" value="source,lines,vars" />
<path id="build.classpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${meta-inf.dir}"/>
</target>
<target name="compile" depends="init,increase-version" description="compile the source">
<javac srcdir="${src.dir}" destdir="${build.dir}" optimize="true" debug="true" debuglevel="${debuglevel}" includeantruntime="on" source="1.8" target="1.8" encoding="UTF-8">
<classpath refid="build.classpath" />
</javac>
</target>
<pathconvert property="libs.dependence" pathsep=" ">
<mapper>
<chainedmapper>
<!-- remove absolute path -->
<flattenmapper />
<!-- add lib/ prefix -->
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
<path>
<!-- lib.home contains all jar files, in several subdirectories -->
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
</pathconvert>
<target name="manifest" depends="init" description="generate the manifest">
<manifest file="${manifest.path}">
<attribute name="Main-Class" value="org.yinwang.pysonar.Main"/>
<attribute name="Class-Path" value="${libs.dependence}"/>
</manifest>
</target>
<target name="increase-version">
<propertyfile file="${src.dir}/version.properties">
<entry key="build" type="date" value="now" pattern="yyyyMMddHHmmss"/>
</propertyfile>
</target>
<target name="dist" depends="compile,manifest" description="generate the distribution" >
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
</fileset>
</copy>
<delete dir="${dist.dir}"/>
<copy todir="${dist.dir}">
<fileset dir="${basedir}">
<include name="**/PySonar2.bat"/>
<include name="**/PySonar2.sh"/>
</fileset>
</copy>
<jar jarfile="${dist.dir}/${jar.file}.jar" basedir="${build.dir}" manifest="${manifest.path}"/>
</target>
<target name="clean" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${meta-inf.dir}"/>
</target>
</project>