forked from majinju/kettle-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
113 lines (98 loc) · 3.83 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
<project name="kettle-manager" default="default" basedir=".">
<description>
打包
</description>
<tstamp prefix="start" />
<!-- 指定环境变量参数为:SystemVariable -->
<property environment="SystemVariable" />
<property name="cr" value="${line.separator}" />
<!-- 修改概率较高的参数 -->
<property name="kettle_dir" location="${SystemVariable.KETTLE_HOME}" />
<property name="temp_dir" value="/temp/${ant.project.name}" />
<property name="extLib" value="${kettle_dir}/ext-lib" />
<property name="src" location="src" />
<property name="resources" location="resources" />
<property name="doc" location="doc" />
<property name="lib" location="webapp/WEB-INF/lib" />
<property name="target" location="${temp_dir}/${ant.project.name}" />
<property name="classes" location="${temp_dir}/classes" />
<target name="init">
<echo>初始化</echo>
<tstamp />
<delete dir="${target}" />
<mkdir dir="${classes}" />
<mkdir dir="${target}" />
<mkdir dir="${extLib}" />
<copy todir="${extLib}">
<fileset dir="${doc}/ext-lib" includes="**/*.jar" />
</copy>
<copy todir="${target}/lib">
<fileset dir="${lib}" includes="**/*.jar" />
</copy>
</target>
<target name="compile" depends="init">
<echo>编译代码</echo>
<javac srcdir="${src}" destdir="${classes}" debug="true">
<classpath id="cpath">
<fileset dir="${kettle_dir}/lib" includes="*.jar" />
<fileset dir="${extLib}" includes="*.jar" />
<fileset dir="${target}/lib" includes="*.jar" />
<fileset dir="${classes}" includes="*.class" />
</classpath>
</javac>
</target>
<target name="copy" depends="compile">
<echo>拷贝附属文件</echo>
<copy todir="${classes}">
<fileset dir="${resources}" includes="**/*.png,**/*.xml,**/*.properties"
excludes="log4j.xml"/>
</copy>
</target>
<target name="jar" depends="copy" description="生成jar包">
<echo>生成jar包</echo>
<jar jarfile="${temp_dir}/${ant.project.name}.jar" basedir="${classes}" includes="**/*" />
</target>
<target name="deploy" depends="jar">
<echo>生成部署包</echo>
<copy todir="${target}/lib">
<fileset dir="${temp_dir}" includes="${ant.project.name}.jar" />
</copy>
<copy todir="${target}/webapp">
<fileset dir="webapp" includes="**" excludes="WEB-INF/lib/**,WEB-INF/classes/**"/>
</copy>
<copy todir="${target}">
<fileset file="doc/杂物/start.bat"/>
<fileset dir="${resources}" includes="default/*" />
<fileset dir="" includes="doc/**" />
<fileset dir="" includes="plugins/**" />
</copy>
<copy todir="${target}">
<fileset file="doc/杂物/start.bat"/>
</copy>
<replace dir="${target}" includes="default/**" encoding="UTF-8">
<replacefilter token="@project-name@" value="${ant.project.name}"/>
<replacefilter token="@ext-lib@" value="%KETTLE_HOME%/ext-lib/*"/>
<replacefilter token="@temp-dir@" value="${temp_dir}"/>
<replacefilter token="@host@" value="127.0.0.1"/>
<replacefilter token="@port@" value="86"/>
<replacefilter token="@job-view-name@" value="v_job"/>
</replace>
<replace dir="${target}" includes="start.bat" encoding="GBK">
<replacefilter token="@project-name@" value="${ant.project.name}"/>
<replacefilter token="@ext-lib@" value="%KETTLE_HOME%/ext-lib/*"/>
<replacefilter token="@temp-dir@" value="${temp_dir}"/>
<replacefilter token="@port@" value="86"/>
</replace>
<zip destfile="${temp_dir}/${ant.project.name}.zip">
<fileset dir="${target}" includes="**"/>
<fileset dir="${kettle_dir}" includes="ext-lib/**" />
</zip>
<delete dir="${classes}" />
<delete file="${temp_dir}/${ant.project.name}.jar"/>
</target>
<target name="clean">
<echo>删除已经生成的文件</echo>
<delete file="${temp_dir}/${ant.project.name}.zip" />
</target>
<target name="default" depends="clean,deploy" description="默认删除已经生成的文件重新生成" />
</project>