forked from haosdent/jcgroup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
117 lines (89 loc) · 4.51 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
<?xml version="1.0"?>
<!DOCTYPE project [
<!ENTITY commonAntCommands SYSTEM "../one-deploy/build/common-ant.xml">
]>
<project name="jcgroup" default="core" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- ============================================================================ -->
<!-- Global definition -->
<!-- ============================================================================ -->
<!-- path to root -->
<property name="root.dir" value="${basedir}"/>
<!-- local.properties имеют высший приоритет -->
<property file="${root.dir}/local.properties"/>
<!-- проперти для деплоймент целей -->
<property file="${user.home}/one/${ant.project.name}.properties"/>
&commonAntCommands; <!-- include common ant commands -->
<property name="build.dir" value="${build}" />
<property name="build.native" value="${build}/native"/>
<property name="src.native" value="${root.dir}/native"/>
<!-- ============================================================================ -->
<!-- Initialize -->
<!-- ============================================================================ -->
<target name="check-environment"/>
<target name="init" depends="check-environment">
<echo message="build.compiler = ${build.compiler}"/>
<echo message="user.home = ${user.home}"/>
<echo message="java.home = ${java.home}"/>
<echo message="ant.home = ${ant.home}"/>
<echo message="java.class.path = ${java.class.path}"/>
<echo message=""/>
<path id="compile.classpath.ref">
<fileset dir="${build.ivy.lib}" includes="**/*.jar"/>
</path>
<property name="compile.classpath" refid="compile.classpath.ref"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="compile.classpath.ref" />
<artifact:pom id="pom" file="${root.dir}/pom.xml" />
</target>
<!-- ============================================================================ -->
<!-- Build client jars library files -->
<!-- ============================================================================ -->
<target name="client-jar" depends="init, prepare-build">
<antcall target="info">
<param name="info.msg" value="Invoking pom '${ant.project.name}' util library."/>
</antcall>
<artifact:mvn pom="${root.dir}/pom.xml" mavenversion="2.0.11" >
<arg value="-DskipTests"/>
<arg value="clean"/>
<arg value="package"/>
</artifact:mvn>
<move file="${pom.build.directory}/${pom.build.finalName}.jar" tofile="${build.components}/${ant.project.name}-${build.number.str}.jar"/>
</target>
<target name="ivy-assemble-source-jars" depends="init, prepare-build">
<mkdir dir="${ivy.deliver.source.dir}"/>
<jar jarfile="${ivy.deliver.source.dir}/jcgroup.jar">
<fileset dir="${pom.build.sourceDirectory}"/>
</jar>
</target>
<!-- ============================================================================ -->
<!-- Build package release -->
<!-- ============================================================================ -->
<target name="build">
<property name="banner.title" value="Development building '${ant.project.name} ${build.number.str}'."/>
<antcall target="banner"/>
<antcall target="ivy-retrieve-all"/>
<antcall target="client-jar"/>
</target>
<!-- ============================================================================ -->
<!-- MANDATORY TASK -->
<!-- Build package release with dependecies -->
<!-- ============================================================================ -->
<target name="build-release">
<antcall target="ivy-retrieve-all"/>
<antcall target="client-jar"/>
<copy todir="${build.deploy.client.lib}">
<fileset dir="${build.lib}" includes="*.jar"/>
</copy>
</target>
<!-- ============================================================================ -->
<!-- MANDATORY TASK -->
<!-- Deploy package release -->
<!-- ============================================================================ -->
<target name="deploy-release">
<fail>
This is library project and can not be deployed.
</fail>
</target>
<target name="core" depends="project-instructions"/>
</project>