-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
144 lines (130 loc) · 6.08 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="core" basedir="." name="Lucee"
xmlns:if="ant:if"
xmlns:unless="ant:unless"
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<path id="maven-ant-tasks.classpath" path="ant/lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
<property name="cache" location="lucee-download-cache"/>
<property name="temp" location="temp"/>
<property name="ant" location="${rootDir}/ant"/>
<property name="webroot" location="sample"/>
<property name="execute" value="/index.cfm"/>
<property name="extensions" value=""/>
<!-- allow installing extensions from a directory, i.e. extension dist dir -->
<property name="extensionDir" value=""/>
<property name="compile" value=""/>
<!-- use .CFConfig.json file -->
<property name="luceeCFConfig" value=""/>
<!-- enable java debugging -->
<property name="debugger" value=""/>
<!-- delete the Lucee working dir before -->
<property name="preCleanup" value="true"/>
<!-- delete the Lucee working dir afterwards -->
<property name="postCleanup" value="true"/>
<!-- scripts can be run as an include, or via internalRequest (default) which picks up any Application.cfc -->
<property name="executeScriptByInclude" value=""/>
<property name="luceeCdnUrl" value="https://cdn.lucee.org"/>
<property name="luceeUpdateProvider" value="https://update.lucee.org/rest/update/provider/latest/"/>
<property name="luceeVersion" value="6.0.3.1"/>
<property name="luceeVersionQuery" value=""/> <!-- i.e. 5.4/stable/jar -->
<!--<target name="core" depends="setEnv,check-lucee-jar,check-lucee-lco,download-lucee-jar,download-lucee-lco,run-cfml">-->
<target name="core" depends="setEnv,use-version,query-version,check-lucee-jar,download-lucee-jar,run-cfml">
</target>
<target name="setEnv">
<artifact:pom id="pom" file="pom.xml"/>
<artifact:dependencies filesetId="mydeps" pomRefId="pom" />
<pathconvert property="dependencies" refid="mydeps"/>
<property name="runtime_classpath" value="${java.class.path}:${dependencies}"/>
<echo message="${luceeVersionQuery}"/>
<condition property="no-query-version">
<length string="${luceeVersionQuery}" trim="true" length="0"/>
</condition>
</target>
<target name="use-version" if="no-query-version">
<property name="useLuceeVersion" value="${luceeVersion}"/>
<property name="luceeVersionUrl" value="${luceeCdnUrl}/lucee-${useLuceeVersion}.jar"/>
<property name="luceeFilename" value="lucee-${useLuceeVersion}.jar"/>
</target>
<target name="query-version" unless="no-query-version">
<echo message="Getting latest Lucee version for ${luceeVersionQuery}" />
<tempfile property="temp.file" suffix=".txt" prefix="lucee-version-query" deleteonexit="true"/>
<get src="${luceeUpdateProvider}${luceeVersionQuery}/filename" dest="${temp.file}" verbose="true"/>
<loadfile property="luceeFilename" srcFile="${temp.file}">
<filterchain>
<tokenfilter>
<replaceregex pattern='"' replace="" flags="g"/>
</tokenfilter>
</filterchain>
</loadfile>
<property name="luceeVersionUrl" value="${luceeCdnUrl}/${luceeFilename}"/>
<property name="useLuceeVersion" value="${luceeFilename}"/>
<echo message="Lucee version: ${useLuceeVersion}" />
</target>
<target name="check-lucee-jar">
<available file="${cache}/${luceeFilename}" property="lucee.jar.present"/>
</target>
<target name="download-lucee-jar" unless="lucee.jar.present">
<mkdir dir="${cache}"/>
<get src="${luceeVersionUrl}" dest="${cache}/${luceeFilename}" verbose="true"/>
</target>
<target name="run-cfml">
<echo message="Java: ${java.version}, ${java.home}" />
<echo message="Lucee: ${useLuceeVersion}" />
<echo message="Webroot: ${webroot}" />
<echo message="Execute: ${execute}" />
<echo message="ExtensionDir: ${extensionDir}" />
<echo message="Extensions: ${extensions}" />
<echo message="executeScriptByInclude: ${executeScriptByInclude}" />
<echo message="luceeCFConfig: ${luceeCFConfig}" />
<echo message="javaDebugger: ${debugger}" />
<echo message="" />
<!-- execute CFML testcases -->
<delete dir="${temp}" if:true="${preCleanup}"/>
<mkdir dir="${temp}"/>
<mkdir dir="${temp}/lucee"/>
<mkdir dir="${temp}/lucee/web"/>
<mkdir dir="${temp}/lucee/lucee-server/context"/>
<mkdir dir="${temp}/lucee/lucee-server/deploy"/>
<!-- set a default admin password
<echo file="${temp}/lucee/lucee-server/context/password.txt" append="false">admin</echo>
-->
<!--
<echoproperties destFile="${temp}/lucee/ant_args.properties"/>
-->
<java classname="org.apache.tools.ant.launch.Launcher" dir="${temp}/lucee" fork="true" failonerror="true" errorproperty="errorOut">
<classpath path="${java.class.path}">
<pathelement location="${cache}/${luceeFilename}"/>
<pathelement path="${runtime_classpath}"/>
</classpath>
<arg value="-f"/>
<arg value="../../build-run-cfml.xml"/>
<jvmarg value="-Dlucee.base.dir=${temp}/lucee"/>
<jvmarg value="-Dlucee.web.dir=${temp}/lucee/web"/>
<jvmarg value="-Dwebroot=${webroot}"/>
<jvmarg value="-Dexecute=${execute}"/>
<jvmarg value="-DexecuteScriptByInclude=${executeScriptByInclude}"/>
<jvmarg value="-DextensionDir=${extensionDir}"/>
<jvmarg value="-Dlucee.extensions=${extensions}"/>
<jvmarg value="-Dlucee.mapping.first=true"/>
<jvmarg value="-Dcompile=${compile}"/>
<!--
<jvmarg value="-Dlucee.cli.printExceptions=true"/>
-->
<jvmarg value="-Dlucee.base.config=${luceeCFConfig}"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5000" if:true="${debugger}"/>
<!--
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>
<jvmarg value="-Djava.net.useSystemProxies=true"/>
<jvmarg value="-Dhttps.proxyHost=127.0.0.1"/>
<jvmarg value="-Dhttps.proxyPort=8188"/>
<jvmarg value="-Dhttp.proxyHost=127.0.0.1"/>
<jvmarg value="-Dhttp.proxyPort=8188"/>
-->
</java>
<echo>${errorOut}</echo>
<delete dir="${temp}" if:true="${postCleanup}"/>
<echo message="Finished!" />
</target>
</project>