-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
116 lines (97 loc) · 4.52 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Syncany" default="release" basedir=".">
<description>Builds, tests, and runs Syncany.</description>
<property file="project.properties"/>
<import file="nbproject/build-impl.xml"/>
<!-- Determine OS -->
<condition property="isLinux"><os family="unix" /></condition>
<condition property="isWindows"><os family="windows" /></condition>
<condition property="isMac"><os family="mac" /></condition>
<!-- Architecture; http://lopica.sourceforge.net/os.html -->
<condition property="arch" value="amd64">
<or>
<os arch="x86_64" />
<os arch="amd64" />
</or>
</condition>
<condition property="arch" value="i386">
<or>
<os arch="x86" />
<os arch="i386" />
<os arch="i686" />
</or>
</condition>
<target name="-pre-init" description="Sets the buildversion for the current build">
<property name="project.name" value="${PROJECT_NAME}" />
<property name="project.website" value="${PROJECT_WEBSITE}" />
<property name="project.version" value="${VERSION_MAJOR}.${VERSION_MINOR}" />
<echo>Revision found from SVN: ${project.version}</echo>
<manifest file="manifest.mf">
<attribute name="Project" value="${project.name}" />
<attribute name="Version" value="${project.version}" />
<attribute name="URL" value="${project.website}" />
</manifest>
</target>
<target name="release" depends="linux,windows"></target>
<!-- Linux only stuff -->
<target name="linux" depends="-release-common" if="isLinux">
<echo level="info" message="Linux only: Adjust file permissions ..." />
<exec executable="chmod" output="/dev/null" os="Linux">
<arg value="+x"/>
<arg value="${dist.dir}/bin/syncany.sh"/>
<arg value="${dist.dir}/bin/native.py"/>
</exec>
<echo level="info" message="Linux only: creating tar.gz archive ..." />
<move file="${dist.dir}" tofile="syncany-${VERSION_MAJOR}.${VERSION_MINOR}" />
<exec executable="tar" output="/dev/null">
<arg value="-czf"/>
<arg value="syncany-${VERSION_MAJOR}.${VERSION_MINOR}.tar.gz"/>
<arg value="syncany-${VERSION_MAJOR}.${VERSION_MINOR}"/>
</exec>
<move file="syncany-${VERSION_MAJOR}.${VERSION_MINOR}" tofile="${dist.dir}" />
<move file="syncany-${VERSION_MAJOR}.${VERSION_MINOR}.tar.gz" todir="${dist.dir}" />
</target>
<!-- Windows only stuff -->
<target name="windows" depends="-release-common" if="isWindows">
<echo level="info" message="Doing Windows only stuff ..." />
</target>
<!-- Post JAR Hook -->
<target name="-release-common" depends="clean,jar">
<echo level="info" message="Copying required files ..." />
<copy todir="${dist.dir}">
<fileset dir=".">
<include name="bin/**" />
<include name="conf/**" />
<include name="res/**" />
<!-- Only core libraries; no subdirectories -->
<include name="lib/*" />
<include name="README" />
<include name="LICENSE" />
<include name="INSTALL" />
<include name="DEVELOPMENT" />
<include name="logging.properties" />
</fileset>
</copy>
<echo level="info" message="Copying plugin files ..." />
<copy todir="${dist.dir}/lib/plugins">
<fileset dir=".">
<include name="lib/plugins/**" />
</fileset>
</copy>
<echo level="info" message="Deleting unnecessary README.txt ..." />
<delete file="${dist.dir}/README.TXT" />
</target>
<target name="-post-jar">
<copy todir="${dist.dir}/bin">
<fileset dir="bin" />
</copy>
<chmod perm="+x" dir="${dist.dir}/bin/syncany.sh" />
<chmod perm="+x" dir="${dist.dir}/syncany.jar" />
<copy todir="${dist.dir}/res">
<fileset dir="res" />
</copy>
<copy todir="${dist.dir}/conf">
<fileset dir="conf" />
</copy>
</target>
</project>