-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
77 lines (65 loc) · 3.06 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="app-template">
<xmlproperty file="expath-pkg.xml"/>
<!--<property name="app.name" value=""/>-->
<property name="project.version" value="${package(version)}"/>
<property name="project.app" value="${package(abbrev)}"/>
<property name="build.dir" value="build"/>
<target name="prepare" description="copy actual web components into bower_components dir to avoid path referencing problems.">
<mkdir dir="${basedir}/bower_components/${package(abbrev)}"/>
<copy todir="${basedir}/bower_components/${package(abbrev)}">
<fileset dir="${basedir}" includes="*-*.html"/>
</copy>
</target>
<target name="xar" depends="prepare">
<mkdir dir="${build.dir}"/>
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}.xar" excludes="bower.json.ignores build.xml ${build.dir}/**, node_modules/**, doc/**, gulpfile.js, package.json"/>
</target>
<!--
cleans a the Polymer build directories
-->
<target name="clean-polymer-build">
<delete dir="${build.dir}/unbundled"/>
<delete dir="${build.dir}/bundled"/>
</target>
<!--
produces a production version for Polymer apps. This will compress all imported web components into a single html.
This is highly advisable for final distributions as it boils down the package dramatically.
Note: in the context of a single component this target might be of minor importance but is put here for usage
in your own projects.
-->
<target name="polymer-build-production" depends="clean-polymer-build">
<exec executable="polymer">
<arg value="build"/>
<arg value="--shell"/>
<arg value="index.html"/>
</exec>
</target>
<!--
creates a xar file with optimized Polymer components
-->
<target name="production-xar" depends="polymer-build-production">
<mkdir dir="${build.dir}"/>
<copy file="controller.xql" todir="${build.dir}/bundled"/>
<copy file="expath-pkg.xml" todir="${build.dir}/bundled"/>
<copy file="configuration.xml" todir="${build.dir}/bundled"/>
<copy file="repo.xml" todir="${build.dir}/bundled"/>
<copy file="icon.png" todir="${build.dir}/bundled"/>
<copydir src="${basedir}/modules" dest="${build.dir}/bundled/modules" />
<copydir src="${basedir}/resources" dest="${build.dir}/bundled/resources" />
<zip basedir="${build.dir}/bundled" destfile="${build.dir}/${project.app}-${project.version}-prod.xar" excludes="demo"/>
</target>
<!--
This should be called once you have unpacked the template app to start your own application.
-->
<target name="init">
<input
message="Please enter new app name:"
addproperty="app.name"
/>
<echo message="${app.name}"></echo>
<replace dir="${basedir}" includes="**/*.*" excludes="build.xml"
token="app-template"
value="${app.name}"/>
</target>
</project>