forked from pentaho/pdi-platform-utils-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
130 lines (103 loc) · 5.41 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
118
119
120
121
122
123
124
125
126
127
128
129
130
<project name="BA Server Utils" basedir="." default="dist"
xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
This build file is used to create the kettle plugin BA Server Utils.
</description>
<!-- import top level build properties -->
<property file="build.properties" description="top level properties"/>
<echo message="project.revision = ${project.revision}"/>
<!-- import subfloor file which contains all the default tasks -->
<import file="build-res/subfloor-pkg.xml" id="subfloor"/>
<!-- add additional properties -->
<property name="project.jarfile" value="${ivy.artifact.id}-${project.revision}.jar"/>
<property name="project.zipfile" value="${ivy.artifact.id}-${project.revision}.zip"/>
<property name="stage.dir" value="${bin.dir}/stage" description="stage directory"/>
<property name="samples.dir" value="${basedir}/samples" description="samples directory"/>
<!--==========================================================================================
target: stage
prepare this project for distribution / installation
===========================================================================================-->
<target name="stage" depends="clean,resolve,compile.compile,jar" description="prepares files for distribution">
<!-- create the stage folder tree -->
<mkdir dir="${stage.dir}"/>
<mkdir dir="${stage.dir}/${project.id}"/>
<!-- jar things up, including properties files and icons, and copy to stage -->
<copy todir="${classes.dir}">
<fileset dir="${src.dir}" includes="**/*.properties"/>
</copy>
<jar jarfile="${stage.dir}/${project.id}/${project.jarfile}">
<fileset dir="${classes.dir}"/>
<fileset dir="${res.dir}" includes="**/*.png"/>
</jar>
<copy todir="${stage.dir}/${project.id}">
<fileset file="package-res/settings.xml"/>
</copy>
<!-- copy samples to stage -->
<copy todir="${stage.dir}/${project.id}/samples" overwrite="true">
<fileset dir="${samples.dir}"/>
</copy>
<!-- copy readme to stage -->
<copy todir="${stage.dir}/${project.id}" overwrite="true">
<fileset file="README.md"/>
</copy>
<!-- create the version file -->
<tstamp/>
<property name="build.id" value="manual-${DSTAMP}"/>
<echo file="${stage.dir}/${project.id}/version.xml"
message="<version branch='${project.stage}' buildId='${build.id}'>${project.version}</version>"/>
</target>
<!--==========================================================================================
target: dist
creates a distribution of this project in a zip ready for marketplace (overrides subfloor dist)
===========================================================================================-->
<target name="dist" depends="stage" description="creates a distribution">
<!-- create dist folder -->
<mkdir dir="${dist.dir}"/>
<!-- create a zip file -->
<zip zipfile="${dist.dir}/${project.zipfile}" basedir="${stage.dir}"
includes="**/*"
excludes="**/Thumbs.db **/.DS_Store"/>
<!-- create market_entry.xml file -->
<copy file="${basedir}/market_entry.xml" tofile="${dist.dir}/market_entry.xml" overwrite="true">
<filterset>
<filter token="project.stage" value="${project.stage}"/>
<filter token="project.version" value="${project.version}"/>
<filter token="project.revision" value="${project.revision}"/>
<filter token="project.package" value="${project.zipfile}"/>
</filterset>
</copy>
</target>
<!--==========================================================================================
target: uninstall
uninstalls this project from local PDI
===========================================================================================-->
<target name="uninstall" depends="" description="uninstalls from local PDI">
<!-- check PDI path -->
<available file="${kettle.dir}" type="dir" property="kettle.dir.exists"/>
<fail unless="kettle.dir.exists"
message="PDI installation not found in '${kettle.dir}'. Please specify the path to your PDI installation in 'build.properties'."/>
<property name="steps.dir" value="${kettle.dir}/plugins/steps"/>
<!-- check BA Server path -->
<available file="${baserver.dir}" type="dir" property="baserver.dir.exists"/>
<fail unless="baserver.dir.exists"
message="BA Server not found in '${baserver.dir}'. Please specify the path to your BA Server installation in 'build.properties'."/>
<property name="steps2.dir" value="${baserver.dir}/pentaho-solutions/system/kettle/plugins/steps"/>
<!-- remove installation -->
<delete dir="${steps.dir}/${project.id}"/>
<delete dir="${steps2.dir}/${project.id}"/>
</target>
<!--==========================================================================================
target: install
installs this project into local PDI
===========================================================================================-->
<target name="install" depends="uninstall,stage" description="installs into local PDI">
<!-- put stage files in place -->
<copy todir="${steps.dir}">
<fileset dir="${stage.dir}" includes="**/*.*"/>
</copy>
<copy todir="${steps2.dir}">
<fileset dir="${stage.dir}" includes="**/*.*"/>
</copy>
<echo message="Installed '${project.id}' in PDI. To test, please restart Spoon."/>
</target>
</project>