This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
176 lines (151 loc) · 6.05 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="FreeMarker Site" default="pack" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:docgen="http://freemarker.org/docgen"
>
<!-- Ivy project coordinates: -->
<property name="moduleOrg" value="org.freemarker" />
<property name="moduleName" value="site" />
<property name="moduleBranch" value="1.0" />
<!-- Will be overidden on the server: -->
<property name="server.ivy.repo.root" value="${basedir}/build/dummy-server-ivy-repo" />
<target name="init">
<condition property="deps.available">
<available file=".ivy" />
</condition>
<antcall target="_autoget-deps" />
<tstamp>
<format property="timeStamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="GMT" />
</tstamp>
</target>
<target name="site">
<!-- Ensure that we have an empty build/site directory: -->
<mkdir dir="build/docgen"/>
<delete includeEmptyDirs="true">
<fileset dir="build/docgen">
<include name="*/**"/>
</fileset>
</delete>
<!-- Generate the new content: -->
<ivy:cachepath pathid="ivy.dep" />
<taskdef resource="org/freemarker/docgen/antlib.properties"
uri="http://freemarker.org/docgen"
classpathref="ivy.dep"
/>
<docgen:transform
srcdir="src/main/docgen" destdir="build/docgen"
offline="@{offline}"
/>
</target>
<target name="clean">
<delete dir="build"/>
</target>
<target name="all" depends="clean, site"/>
<target name="pack" depends="site">
<tar tarfile="build/site.tar" basedir="build/docgen"/>
<mkdir dir="build/artifacts" />
<gzip zipfile="build/artifacts/site.tar.gz" src="build/site.tar"/>
<delete file="build/site.tar"/>
</target>
<target name="artifacts" depends="pack"
description="Creates the artifacts for Ivy."
/>
<!-- ================================================================== -->
<!-- Dependency management (keep it exactly identical for all projects) -->
<!-- ================================================================== -->
<target name="_autoget-deps" unless="deps.available">
<antcall target="update-deps" />
</target>
<target name="update-deps"
description="Gets the latest version of the dependencies from the Web"
>
<echo>Getting dependencies...</echo>
<echo>-------------------------------------------------------</echo>
<ivy:settings id="remote" url="http://freemarker.org/repos/ivy/ivysettings-remote.xml" />
<!-- Build an own repository that will serve us even offline: -->
<ivy:retrieve settingsRef="remote" sync="true"
ivypattern=".ivy.part/repo/[organisation]/[module]/ivy-[revision].xml"
pattern=".ivy.part/repo/[organisation]/[module]/[artifact]-[revision].[ext]"
/>
<echo>-------------------------------------------------------</echo>
<echo>*** Successfully acquired dependencies from the Web ***</echo>
<echo>Eclipse users: Now right-click on ivy.xml and Resolve! </echo>
<echo>-------------------------------------------------------</echo>
<!-- Only now that we got all the dependencies will we delete anything. -->
<!-- Thus a net or repo outage doesn't left us without the dependencies. -->
<!-- Save the resolution cache from the soon coming <delete>: -->
<move todir=".ivy.part/update-deps-reso-cache">
<fileset dir=".ivy/update-deps-reso-cache" />
</move>
<!-- Drop all the old stuff: -->
<delete dir=".ivy" />
<!-- And use the new stuff instead: -->
<move todir=".ivy">
<fileset dir=".ivy.part" />
</move>
</target>
<!-- Do NOT call this from 'clean'; offline guys would stuck after that. -->
<target name="clean-deps"
description="Deletes all dependencies"
>
<delete dir=".ivy" />
</target>
<target name="publish-override" depends="artifacts"
description="Ivy-publishes THIS project locally as an override"
>
<ivy:resolve />
<ivy:publish
pubrevision="${moduleBranch}-branch-head"
overwrite="true" forcedeliver="true"
resolver="freemarker-devel-local-override"
>
<artifacts pattern="build/artifacts/[artifact].[ext]" />
</ivy:publish>
<echo>-------------------------------------------------------</echo>
<echo>*** Don't forget to `ant unpublish-override` later! ***</echo>
</target>
<target name="unpublish-override"
description="Undoes publish-override (made in THIS project)"
>
<delete dir="${user.home}/.ivy2/freemarker-devel-local-override/${moduleOrg}/${moduleName}" />
<delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache/${moduleOrg}/${moduleName}" />
</target>
<target name="unpublish-override-all"
description="Undoes publish-override-s made in ALL projects"
>
<delete dir="${user.home}/.ivy2/freemarker-devel-local-override" />
<delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache" />
</target>
<target name="uninstall"
description="Deletes external files created by FreeMarker developement"
>
<delete dir="${user.home}/.ivy2/freemarker-devel-cache" />
<delete dir="${user.home}/.ivy2/freemarker-devel-local-override" />
<delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache " />
</target>
<target name="report-deps"
description="Creates a HTML document that summarizes the dependencies."
>
<mkdir dir="build/deps-report" />
<ivy:resolve />
<ivy:report todir="build/deps-report" />
</target>
<!--
This meant to be called on the Continuous Integration server, so the
integration builds appear in the freemarker.org public Ivy repository.
The artifacts must be already built.
-->
<target name="server-publish-last-build"
description="(For the Continuous Integration server only)"
>
<delete dir="build/dummy-server-ivy-repo" />
<ivy:resolve />
<ivy:publish
pubrevision="${moduleBranch}-branch-head"
overwrite="true" forcedeliver="true"
resolver="server-publishing-target"
>
<artifacts pattern="build/artifacts/[artifact].[ext]" />
</ivy:publish>
</target>
</project>