-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild_dist.xml
65 lines (54 loc) · 2.54 KB
/
build_dist.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
<project default="dist">
<xmlproperty file="pom.xml" prefix="pom" /> <!-- read properties from 'pom.xml' -->
<property name="version" value="${pom.project.version}" />
<property name="dest_dir" value="./dist" />
<property name="zip_file" value="${dest_dir}/telosys-cli-${version}.zip" />
<!-- ============================================================================== -->
<target name="dist" >
<echo message="Values from pom.xml : " />
<echo message=" project.groupId = ${pom.project.groupId} " />
<echo message=" project.artifactId = ${pom.project.artifactId} " />
<echo message=" project.version = ${pom.project.version} " />
<echo message="Task properties : " />
<echo message=" version = ${version} " />
<echo message=" dest_dir = ${dest_dir} " />
<echo message=" zip_file = ${zip_file} " />
<!--
Copy if the source file is newer than the destination file,
or when the destination file does not exist.
However, you can explicitly overwrite files with the "overwrite" attribute.
-->
<echo message="Create dir : ${dest_dir} " />
<mkdir dir="${dest_dir}"/>
<echo message="Copy and prepare BAT file" />
<copy file="./tt.bat.txt" tofile="./tt.bat" overwrite="true" />
<replace file="tt.bat" token="${VER}" value="${version}" summary="true" />
<copy file="./tt.bat" tofile="./telosys.bat" overwrite="true" />
<!-- <copy file="./tt.bat" todir="./target"/> -->
<echo message="Copy and prepare SHELL file" />
<copy file="./tt.sh.txt" tofile="./tt" overwrite="true" />
<replace file="tt" token="${VER}" value="${version}" summary="true" />
<copy file="./tt" tofile="./telosys" overwrite="true" />
<echo message="Copy telosys-cli JAR file" />
<copy file="./target/telosys-cli-${version}.jar" tofile="./telosys-cli-${version}.jar" overwrite="true" />
<!-- Package all in a ZIP -->
<echo message="Zip file : ${zip_file} " />
<zip destfile="${zip_file}" >
<fileset dir="." includes="telosys-cli-${version}.jar"/>
<fileset dir="." includes="telosys-cli.cfg"/>
<fileset dir="." includes="telosys.ico"/>
<fileset dir="." includes="telosys-term.sh"/>
<fileset dir="." includes="README.TXT"/>
<fileset dir="." includes="tt.bat"/>
<fileset dir="." includes="tt"/>
<fileset dir="." includes="telosys.bat"/>
<fileset dir="." includes="telosys"/>
</zip>
<echo message="Clean temp files" />
<delete file="./telosys-cli-${version}.jar"/>
<delete file="./tt.bat"/>
<delete file="./tt"/>
<delete file="./telosys.bat"/>
<delete file="./telosys"/>
</target>
</project>