forked from hanborq/rockstor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
156 lines (129 loc) · 6.12 KB
/
build.xml
File metadata and controls
156 lines (129 loc) · 6.12 KB
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
149
150
151
152
153
154
155
156
<project name="rockstore" default="jar" basedir=".">
<description>
Build rockstore for rock store Web Service
</description>
<!-- set global properties for this build -->
<property name="version" value="0.2.4"/>
<property name="src" location="src" />
<property name="src.java" location="${src}/java" />
<property name="src.web" location="${src}/web" />
<property name="src.test" location="${src}/test" />
<property name="src.sdk" location="${src}/sdk" />
<property name="bin" location="bin" />
<property name="lib" location="lib" />
<property name="conf" location="conf" />
<property name="console" location="console" />
<property name="tomcat" location="tomcat" />
<property name="build" location="build" />
<property name="build.classes" location="${build}/classes" />
<property name="build.jar" value="${build}/hanborq-rockstor-${version}.jar" />
<property name="build.jar.hbase.plugin" value="${build}/hanborq-rockstor-${version}-hbase-plugin.jar" />
<property name="build.jar.sdk" value="${build}/hanborq-rockstor-${version}-client.jar" />
<property name="build.jar.sdk.sample" value="${build}/hanborq-rockstor-${version}-client-sample.jar" />
<property name="build.package" value="${build}/hanborq-rockstor-${version}-bin.tar.gz" />
<target name="init">
<!-- Create the build directory structure used by compile -->
<echo message="Init build process, mkdir ${build}"/>
<mkdir dir="${build}"/>
<mkdir dir="${build.classes}"/>
<copy todir="${build.classes}" file="${src.java}/com/rockstor/rockstor-default.xml"/>
</target>
<condition property="linux"><equals arg1="${os.name}" arg2="Linux"/></condition>
<target name="genVersionFile" if="linux" depends="init">
<exec executable="sh">
<arg line="src/saveVersion.sh ${version} ${src.java}"/>
<env key="ROCKSTOR_REVISION" value="${rockstor.hash}" />
</exec>
</target>
<target name="compile" depends="init, genVersionFile"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<echo message="Compile java files : ${src.java}"/>
<!-- generate package-info annotation file. This has to be done here
so that the timestamp of package-info.java is newer than the timestamp
of the output directory -->
<javac srcdir="${src.java} : ${src.sdk}" debug="on" encoding="utf-8" destdir="${build.classes}">
<classpath>
<fileset dir="${lib}" />
</classpath>
</javac>
</target>
<target name="jar" depends="compile"
description="generate the distribution jar file" >
<echo message="Make archive file : ${build.jar}"/>
<jar destfile="${build.jar}">
<manifest>
<section name="com/rockstor">
<attribute name="Implementation-Title" value="RockStor"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="BDE"/>
</section>
</manifest>
<fileset dir="${build.classes}">
<include name="**/*.class"/>
<include name="**/*.xml"/>
</fileset>
</jar>
<jar destfile="${build.jar.hbase.plugin}">
<fileset dir="${build.classes}">
<include name="com/rockstor/core/db/ScanFilter.class"/>
</fileset>
</jar>
</target>
<target name="sdk" depends="compile"
description="generate the sdk jar file" >
<echo message="Make archive file : ${build.jar.sdk}"/>
<jar destfile="${build.jar.sdk}">
<fileset dir="${build.classes}">
<include name="com/rockstor/client/*.class"/>
</fileset>
</jar>
<jar destfile="${build.jar.sdk.sample}">
<fileset dir="${src.sdk}">
<include name="com/rockstor/clientsample/Sample.java"/>
</fileset>
</jar>
</target>
<target name="package" depends="jar"
description="generate the distribution" >
<echo message="Make distribution file : ${build.package}"/>
<mkdir dir="${build}/rockstor-${version}"/>
<mkdir dir="${build}/rockstor-${version}/conf"/>
<mkdir dir="${build}/rockstor-${version}/lib"/>
<mkdir dir="${build}/rockstor-${version}/bin"/>
<mkdir dir="${build}/rockstor-${version}/logs"/>
<copy todir="${build}/rockstor-${version}/bin">
<fileset dir="${bin}" />
</copy>
<copy todir="${build}/rockstor-${version}/conf">
<fileset dir="${conf}" />
</copy>
<copy todir="${build}/rockstor-${version}/lib">
<fileset dir="${lib}" />
</copy>
<copy todir="${build}/rockstor-${version}/lib"
file="${build.jar}"/>
<tar compression="gzip" longfile="gnu" destfile="${build.package}">
<tarfileset dir="${build}/rockstor-${version}" prefix="hanborq-rockstor-${version}-bin">
<include name="**"/>
<exclude name="bin/*"/>
</tarfileset>
<tarfileset dir="${build}/rockstor-${version}" prefix="hanborq-rockstor-${version}-bin" mode="755">
<include name="bin/*.sh"/>
<include name="bin/rockstor"/>
</tarfileset>
</tar>
<delete dir="${build}/rockstor-${version}" />
</target>
<target name="console" description="build rockstor console package">
<ant antfile="${console}/build.xml" dir="${console}" target="package" inheritAll="false"/>
<copy file="${console}/build/hanborq-rockstor-${version}-console.tar.gz" todir="${build}"/>
</target>
<target name="console_clean" description="build rockstor console package">
<ant antfile="${console}/build.xml" dir="${console}" target="clean" inheritAll="false"/>
<delete file="${build}/rockstor-console.tar.gz"/>
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
</target>
</project>