-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·74 lines (65 loc) · 3.72 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="restsql-website" default="dist">
<property file="build.properties" />
<target name="dist" depends="index,web-xml,overview,download,lib" description="generates distribution files">
<copy todir="obj/WebContent">
<fileset dir="WebContent" />
</copy>
<tar destfile="obj/WebContent.tar" basedir="obj/WebContent" />
<tar destfile="obj/system.tar" basedir="system" />
</target>
<target name="index" description="changes sdk href in restsql's index.html">
<mkdir dir="obj/WebContent/usr/local/tomcat/webapps/restsql" />
<copy file="../restsql/WebContent/index.html" todir="obj/WebContent/usr/local/tomcat/webapps/restsql" />
<replace token="../restsql-sdk/" value="../">
<fileset file="obj/WebContent/usr/local/tomcat/webapps/restsql/index.html" />
</replace>
</target>
<target name="web-xml" description="adds security contstraints to both webapps web.xmls">
<mkdir dir="obj/WebContent/usr/local/tomcat/webapps/restsql/WEB-INF" />
<copy file="../restsql/WebContent/WEB-INF/web.xml" todir="obj/WebContent/usr/local/tomcat/webapps/restsql/WEB-INF" />
<loadfile property="web-xml" srcFile="template/restsql/WEB-INF/web-xml" />
<replace token="</web-app>" value="${web-xml}">
<fileset file="obj/WebContent/usr/local/tomcat/webapps/restsql/WEB-INF/web.xml" />
</replace>
<mkdir dir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/WEB-INF" />
<copy file="../restsql-sdk/WebContent/WEB-INF/web.xml" todir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/WEB-INF" />
<loadfile property="web-xml-sdk" srcFile="template/restsql-sdk/WEB-INF/web-xml" />
<replace token="</web-app>" value="${web-xml-sdk}">
<fileset file="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/WEB-INF/web.xml" />
</replace>
</target>
<target name="overview" description="injects google analytics into Overview.html">
<mkdir dir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/doc" />
<copy file="../restsql-sdk/WebContent/doc/Overview.html" todir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/doc" />
<loadfile property="GoogleAnalytics" srcFile="template/restsql-sdk/doc/GoogleAnalytics.js" />
<replace token="</head>" value="${GoogleAnalytics}">
<fileset file="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/doc/Overview.html" />
</replace>
</target>
<target name="download" description="generates download pages">
<mkdir dir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/download" />
<copy todir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/download">
<fileset dir="template/restsql-sdk/download" />
</copy>
<mkdir dir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/doc" />
<copy todir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/doc">
<fileset dir="template/restsql-sdk/doc" includes="*.html" />
</copy>
<replace includes="restsql-*.html" token="@@build.version@@" value="${build.version}">
<fileset file="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/doc/Download.html" />
<fileset dir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/download" />
</replace>
</target>
<target name="lib" description="sets up the dist binaries">
<mkdir dir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/dist" />
<copy todir="obj/WebContent/usr/local/tomcat/webapps/restsql-sdk/dist">
<fileset dir="../restsql-sdk/obj/lib" includes="*.war" />
<fileset dir="../restsql/obj/lib" includes="*.jar,*.war" />
</copy>
<echo message="Don't forget to push the current release to dist-archive!" />
</target>
<target name="clean">
<delete dir="obj" failonerror="false" includeEmptyDirs="true" quiet="true" />
</target>
</project>