-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubfloor-js.xml
More file actions
195 lines (162 loc) · 7.61 KB
/
Copy pathsubfloor-js.xml
File metadata and controls
195 lines (162 loc) · 7.61 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!--===========================================================================
Copyright (c) 2012, Pentaho Engineering Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Pentaho Corporation nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY Pentaho Engineering Team ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
============================================================================-->
<!--===========================================================================
== SUBFLOOR-JS ==
$Rev: 1 $
$Date: 2012-02-22 9:58:26 -0500 (Wed, 09 Dec 2009) $
Project Home: http://code.google.com/p/subfloor/
Provides default targets for creating application archives such as zip and tar.gzip
files.
============================================================================-->
<project name="subfloor-js" basedir="." default="default" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Import the next subfloor instance, defaults to -pkg, but configurable -->
<echo message="JS importing pkg file: ${subfloor-js-pkg.file}"/>
<import file="subfloor-pkg.xml"/>
<property name="js-lib.dir" value="js-lib"/>
<!-- location of module scripts -->
<property name="module.script.dir" value="package-res/module-scripts"/>
<property name="module.script.namespace" value=""/>
<!-- directory to unzip all dependent JS zips -->
<property name="module.script.collected.dir" value="build-res/module-scripts"/>
<property name="package.script.dest.dir" value="bin/stage/script"/>
<property name="js.build.output.dir" value="bin/scriptOutput"/>
<!-- Name of the jd build file -->
<property name="js.build.file" value="build-res/javascript.build.js"/>
<property name="package.artifact.pomfile"
value="package-js.xml"
description="The Maven pom file for project scripts" />
<target name="js.clean" extensionOf="clean"
description="Cleans all the files generated from a build with the exception of IVY-downloaded jars (see clean-all)">
<delete dir="${module.script.collected.dir}"/>
</target>
<target name="resolve-js" extensionOf="resolve">
<ivy:resolve file="ivy.xml" conf="js"/>
<ivy:retrieve conf="js" pattern="${js-lib.dir}/[module]-[revision](-[classifier]).[ext]"/>
</target>
<target name="clean-js" extensionOf="clean-jars">
<delete dir="${js-lib.dir}" />
</target>
<target name="build-js" extensionOf="dist">
<delete dir="bin/common-ui-js-build"/>
<echo message="module.script.collected.dir: ${module.script.collected.dir}"/>
<mkdir dir="${module.script.collected.dir}" />
<unzip dest="${module.script.collected.dir}">
<fileset dir=".">
<include name="${js-lib.dir}/*.zip"/>
</fileset>
</unzip>
<copy todir="${module.script.collected.dir}/${module.script.namespace}">
<fileset dir="${module.script.dir}">
<include name="**/*"/>
</fileset>
</copy>
<path id="build.classpath">
<fileset dir="build-res/pentaho-js-build/libs"> <!-- temporary until core build files in artifactory -->
<include name="*.jar" />
</fileset>
</path>
<!-- uncomment once core build in artifactory, placed in dev-lib for now -->
<!--<java classname="org.mozilla.javascript.tools.shell.Main"-->
<!--fork="true"-->
<!--classpathref="build.classpath"-->
<!--args="${module.script.collected.dir}/r.js -o ${js.build.file}">-->
<!--</java>-->
<mkdir dir="${js.build.output.dir}"/>
<java classname="org.mozilla.javascript.tools.shell.Main"
fork="true"
classpathref="build.classpath"
args="build-res/pentaho-js-build/r.js -o ${js.build.file}">
</java>
<copy todir="${package.script.dest.dir}">
<fileset dir="${js.build.output.dir}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="dist-js" extensionOf="dist-source">
<echo message="dist-js: ${module.script.dir}"/>
<mkdir dir="bin/js-source/${module.script.namespace}"/>
<copy todir="bin/js-source/${module.script.namespace}">
<fileset dir="${module.script.dir}">
<include name="**/*"/>
</fileset>
</copy>
<zip destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}-js.zip">
<zipfileset dir="bin/js-source" includes="**/*"/>
</zip>
</target>
<target name="pkg.publish-nojar" extensionOf="publish-nojar">
<antcall target="maven-publish-js-source">
<param name="publish.groupId" value="${ivy.artifact.group}" />
<param name="publish.artifactId" value="${ivy.artifact.id}" />
<param name="publish.version" value="${project.revision}" />
<param name="publish.file" value="${dist.dir}/${ivy.artifact.id}-${project.revision}-js.zip" />
</antcall>
</target>
<target name="maven-publish-js-source" depends="install-antcontrib">
<sequential>
<fail message="No file found at: ${publish.file}">
<condition>
<not>
<available file="${publish.file}" />
</not>
</condition>
</fail>
<if>
<isset property="isWindows" />
<then>
<exec executable="cmd" failonerror="true">
<arg value="/c" />
<arg value="mvn.bat" />
<arg value="deploy:deploy-file" />
<arg value="-DrepositoryId=${ivy.repository.id}" />
<arg value="-Durl=${ivy.repository.publish}" />
<arg value="-DgroupId=${publish.groupId}" />
<arg value="-DartifactId=${publish.artifactId}" />
<arg value="-Dversion=${publish.version}" />
<arg value="-DgeneratePom=true" />
<arg value="-Dpackaging=zip" />
<arg value="-Dclassifier=js" />
<arg value="-Dfile=${publish.file}" />
</exec>
</then>
<else>
<exec executable="mvn" failonerror="true">
<arg value="deploy:deploy-file" />
<arg value="-DrepositoryId=${ivy.repository.id}" />
<arg value="-Durl=${ivy.repository.publish}" />
<arg value="-DgroupId=${publish.groupId}" />
<arg value="-DartifactId=${publish.artifactId}" />
<arg value="-Dversion=${publish.version}" />
<arg value="-DgeneratePom=true" />
<arg value="-Dpackaging=zip" />
<arg value="-Dclassifier=js" />
<arg value="-Dfile=${publish.file}" />
</exec>
</else>
</if>
</sequential>
</target>
</project>