-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbuild.xml
executable file
·159 lines (137 loc) · 6.11 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
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
<?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="bundle.dir" value="build/production"/>
<property name="build.dir" value="build"/>
<target name="xar">
<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"/>
<delete dir="${build.dir}/production"/>
</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"/>
</exec>
</target>
<target name="polymer-build-production2" depends="clean-polymer-build">
<exec executable="polymer">
<arg value="build"/>
<!--<arg value="--bundle"/>-->
<arg value="--sources"/>
<arg value="*-*.html"/>
<arg value="--entrypoint"/>
<arg value="index.html"/>
<arg value="rewriteUrlsInTemplate"/>
<arg value="true"/>
<arg value="--html-minify"/>
<!--<arg value="-v"/>-->
</exec>
</target>
<!--
creates a xar file with optimized Polymer components
-->
<target name="production-xar" depends="polymer-build-production">
<mkdir dir="${build.dir}"/>
<copy todir="${bundle.dir}">
<fileset dir="${basedir}">
<include name="modules/**" />
<include name="resources/**" />
<include name="*.xml" />
<include name="*.xql" />
<include name="*.html" />
<include name="icon.svg" />
</fileset>
</copy>
<!-- unfortunately haven't a better way yet. -->
<!-- ##### DO NOT INCLUDE HTML AS THIS HAS GONE THOUGH OPTIMIZER IN `polymer-build-production` TARGET-->
<copy todir="${bundle.dir}/bower_components/existdb-launcher">
<fileset dir="${basedir}/bower_components/existdb-launcher">
<include name="modules/**" />
<include name="resources/**" />
<include name="*.xml" />
<include name="*.xql" />
<include name="icon.svg" />
</fileset>
</copy>
<copy todir="${bundle.dir}/bower_components/existdb-packagemanager">
<fileset dir="${basedir}/bower_components/existdb-packagemanager">
<include name="modules/**" />
<include name="resources/**" />
<include name="*.xml" />
<include name="*.xql" />
<include name="icon.svg" />
</fileset>
</copy>
<copy todir="${bundle.dir}/bower_components/existdb-usermanager">
<fileset dir="${basedir}/bower_components/existdb-usermanager">
<include name="modules/**" />
<include name="resources/**" />
<include name="*.xml" />
<include name="*.xql" />
<include name="icon.svg" />
</fileset>
</copy>
<copy todir="${bundle.dir}/bower_components/existdb-backup">
<fileset dir="${basedir}/bower_components/existdb-backup">
<include name="modules/**" />
<include name="resources/**" />
<include name="*.xml" />
<include name="*.xql" />
<include name="icon.svg" />
</fileset>
</copy>
<copy todir="${bundle.dir}/bower_components/vaadin-progress-bar" overwrite="true">
<fileset dir="${basedir}/bower_components/vaadin-progress-bar">
<include name="modules/**" />
<include name="resources/**" />
<include name="src/**" />
<include name="theme/**" />
<include name="*.xml" />
<include name="*.xql" />
<include name="**/*.html" />
<include name="icon.svg" />
</fileset>
</copy>
<!--
<copy file="admin.xql" todir="${build.dir}/bundled"/>
<copy file="controller.xql" todir="${build.dir}/bundled"/>
<copy file="expath-pkg.xml" todir="${build.dir}/bundled"/>
<copy file="config.xml" todir="${build.dir}/bundled"/>
<copy file="index.html" 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="${bundle.dir}" destfile="${build.dir}/${project.app}-${project.version}.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>