-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
113 lines (113 loc) · 5.45 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="" basedir="." default="dist"
xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
This build file is used to create the Cubeguard 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="cubeguard"
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.stage}-${project.version}"/>
<echo>distribution.version = ${distribution.version}</echo>
<property name="plugin.artifact.id" value="${plugin.name}"/>
<property name="plugin.zipfile" value="${plugin.artifact.id}-${distribution.version}.zip"/>
<!--=======================================================================
dist
Creates a distribution of this project's plugin zip
====================================================================-->
<target name="dist" depends="clean,resolve" 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="${dist.dir}"/>
<!-- copy the entire plugin to that folder -->
<copy todir="${stage.dir}/${plugin.name}/" overwrite="true">
<fileset dir=".">
<include name="**/*"/>
<exclude name="bin/"/>
</fileset>
</copy>
<!-- create the version file -->
<tstamp/>
<property name="sequential.build.id" value="manual-${DSTAMP}"/>
<!-- create a zip file -->
<zip zipfile="${dist.dir}/${plugin.zipfile}"
basedir="${stage.dir}"
includes="${plugin.name}/**/*"
excludes="**/Thumbs.db"/>
<!-- create version.xml file -->
<echoxml file="${stage.dir}/${plugin.name}/version.xml">
<version branch='${project.stage}' buildId='${sequential.build.id}'>${distribution.version}</version>
</echoxml>
<!-- create marketplace.xml file -->
<echoxml file="${dist.dir}/marketplace.xml">
<version>
<branch>${project.stage}</branch>
<version>${distribution.version}</version>
<name>${project.stage.name}</name>
<package_url>
${package.url}
</package_url>
<description>${project.description}</description>
<build_id>${sequential.build.id}</build_id>
<min_parent_version>5.0</min_parent_version>
<development_stage>
<lane>Community</lane>
<phase>1</phase>
</development_stage>
</version>
</echoxml>
<!-- <echo file="${dist.dir}/marketplace.xml"> <version> -->
<!-- <branch>${project.stage}</branch> -->
<!-- <version>${distribution.version}</version> -->
<!-- <name>${project.stage}</name> -->
<!-- <package_url> -->
<!-- ${package.url} -->
<!-- </package_url> -->
<!-- <description>${project.description}</description> -->
<!-- <build_id>${sequential.build.id}</build_id> -->
<!-- <min_parent_version>5.0</min_parent_version> -->
<!-- <development_stage> -->
<!-- <lane>Community</lane> -->
<!-- <phase>1</phase> -->
<!-- </development_stage> -->
<!-- </version></echo> -->
<move tofile="${dist.dir}/${ivy.artifact.id}-${project.revision}.zip" file="${dist.dir}/${plugin.zipfile}"/>
</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>