-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
128 lines (122 loc) · 5.98 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
<project name="" basedir="." default="dist" xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
This build file is used to create the IvyGS project
and works with the common_build.xml file.
</description>
<!-- Import the common_build.xml file which contains all the default tasks -->
<import file="build-res/subfloor-pkg.xml" id="subfloor" />
<property name="plugin.name" value="IvyGS" description="Name of the plugin" />
<property name="stage.dir" value="${bin.dir}/stage" description="Name of the resource directory" />
<tstamp />
<!-- Build the project.revision property -->
<property name="distribution.version" value="${project.revision}" />
<echo>distribution.version = ${distribution.version}</echo>
<property name="plugin.artifact.id" value="${plugin.name}" />
<property name="plugin.zipfile" value="${plugin.artifact.id}.zip" />
<target name="checkstyle" description="Generates a report of code convention violations." depends="init-checkstyle">
<!-- See http://checkstyle.sourceforge.net/anttask.html for full options of using checkstyle with ant-->
<checkstyle config="build-res/checkstyle.xml" failureProperty="${bin.dir}/checkstyle.failure" failOnViolation="false">
<formatter type="xml" tofile="${bin.dir}/checkstyle-result.xml" />
<fileset dir="src" includes="**/*.java" />
</checkstyle>
</target>
<target name="init-checkstyle" depends="resolve">
<path id="checkstyle.lib.path">
<fileset dir="runtime-lib" includes="*.jar" />
</path>
<!-- Sevntu custom checks are retrieved by Ivy into lib folder and will be accessible to checkstyle-->
<taskdef resource="checkstyletask.properties" classpathref="checkstyle.lib.path" />
</target>
<!--=======================================================================
dist
Creates a distribution of this project's plugin zip
====================================================================-->
<target name="dist" depends="clean,resolve,build,checkstyle" description="Creates a distribution">
<!-- delete and re-create the plugin dist folder tree -->
<mkdir dir="${stage.dir}" />
<mkdir dir="${stage.dir}/${plugin.name}" />
<mkdir dir="${stage.dir}/${plugin.name}" />
<mkdir dir="${dist.dir}" />
<!-- copy the entire plugin to that folder -->
<copy todir="${stage.dir}/${plugin.name}/" overwrite="true">
<fileset dir=".">
<include name="**/*" />
<exclude name="bin/" />
<exclude name="dev-lib/" />
<exclude name="test-lib/" />
<exclude name="build/" />
<exclude name="runtime-lib/" />
<exclude name=".settings/" />
<exclude name="src/" />
<exclude name="dist/" />
<exclude name="package-res/" />
<exclude name="build-res/" />
<exclude name="build.xml" />
<exclude name="build.properties" />
<exclude name="ivy.xml" />
<exclude name="ivysettings.xml" />
<exclude name=".project" />
<exclude name=".classpath" />
</fileset>
</copy>
<copy todir="./lib" overwrite="true">
<fileset dir="${devlib.dir}">
<include name="*.jar" />
</fileset>
</copy>
<copy todir="${stage.dir}/${plugin.name}/lib" overwrite="true">
<fileset dir="${devlib.dir}">
<include name="*.jar" />
</fileset>
</copy>
<copy todir="${stage.dir}/${plugin.name}/lib" overwrite="true">
<fileset dir="${dist.dir}">
<include name="${ivy.artifact.id}-${project.revision}.jar" />
</fileset>
</copy>
<copy todir="./lib" overwrite="true">
<fileset dir="${dist.dir}">
<include name="${ivy.artifact.id}-${project.revision}.jar" />
</fileset>
</copy>
<!-- create the version file -->
<tstamp />
<property name="sequential.build.id" value="manual-${DSTAMP}" />
<echo file="${stage.dir}/${plugin.name}/version.xml" message="<version branch='STABLE' buildId='${sequential.build.id}'>${distribution.version}</version>" />
<!-- create a zip file -->
<zip zipfile="${dist.dir}/${plugin.zipfile}" basedir="${stage.dir}" includes="${plugin.name}/**/*" excludes="**/Thumbs.db" />
<echo file="${dist.dir}/marketplace.xml"><version>
<branch>TRUNK</branch>
<version>${distribution.version}</version>
<name>Trunk</name>
<package_url>not defined</package_url>
<description>@PLUGIN_PACKAGE_DESCRIPTION</description>
<build_id>${sequential.build.id}</build_id>
</version> </echo>
</target>
<!--=======================================================================
install-plugin
Installs the plugin locally
====================================================================-->
<target name="install-plugin" depends="clean, resolve, dist" description="Installs the plugin locally">
<fail message="plugin.local.install.solutions.dir not set - cannot copy" unless="plugin.local.install.solutions.dir" />
<delete dir="${plugin.local.install.solutions.dir}/system/${plugin.name}" />
<copy todir="${plugin.local.install.solutions.dir}/system/${plugin.name}">
<fileset dir="${stage.dir}/${plugin.name}">
<include name="**/*" />
</fileset>
</copy>
<get src="http://127.0.0.1:8080/pentaho/Publish?publish=now&class=org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter&userid=${plugin.local.install.user}&password=${plugin.local.install.pass}" dest="${stage.dir}/blah.html" />
</target>
<!-- Overriding resolve target so we can add resolve-dev -->
<target name="resolve" depends="resolve-default, resolve-test, resolve-codegen, resolve-runtime, ivy.check-releasable" description="Retrieves all the dependent libraries" />
<target name="resolve-runtime" depends="resolve-init">
<ivy:resolve file="${ivyfile}" conf="runtime" />
<ivy:retrieve conf="runtime" pattern="${runtimelib.dir}/[module]-[revision](-[classifier]).[ext]" />
</target>
<target name="clean-jars">
<delete dir="${lib.dir}" />
<delete dir="${testlib.dir}" />
<delete dir="${runtimelib.dir}" />
</target>
</project>