Mercurial > public > develkit
annotate ssdt-common-build.xml @ 17:fc114dab4c50
TL-32: Add task (ssdt:properties) to create properties file in any directory.
author | smith@nwoca.org |
---|---|
date | Thu, 30 Dec 2010 14:53:49 -0500 |
parents | d2901f1c52c3 |
children | ad0a75e20f7b |
rev | line source |
---|---|
4 | 1 <?xml version="1.0" encoding="UTF-8"?> |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
2 <project name="ssdt-common-build" default="all" basedir="." |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
3 xmlns:tomcat="http://ssdt-ohio.org/ant/tomcat" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
4 xmlns:ssdt="http://www.ssdt-ohio.org/ant/common"> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
5 <!-- |
4 | 6 ssdt common build functions. Contains generalized tasks to perform |
7 common functions. Assumes some standard properties from a NetBeans | |
8 project are provided. | |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
9 |
4 | 10 Properties used for webapps: |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
11 |
4 | 12 build.web.dir - docBase of build webapp. |
13 web.docbase.dir - source docBase of webapp | |
14 web.context.path - path to install webapp in Tomcat | |
15 tomcat.username - Tomcat manager username | |
16 tomcat.password - Tomcat manager password | |
17 | |
18 --> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
19 <target name="project.cvs.update" |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
20 depends="project.init" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
21 unless="build.devel.bamboo"> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
22 <!-- Get the latest from CVS --> |
4 | 23 <cvs command="up -d -P"/> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
24 </target> |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
25 |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
26 <target name="-project.init.groovy.task" depends="init"> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
27 <if> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
28 <available classpath="${run.test.classpath}" classname="org.codehaus.groovy.ant.Groovy"/> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
29 <then> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
30 <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${run.test.classpath}"/> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
31 </then> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
32 <else> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
33 <property name="ssdt.groovy.jar.src" value="http://ivy.ssdt.nwoca.org/repository/groovy/groovy-all.jar"/> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
34 <ssdt:fetch dest="${ssdt.devel.kit}/groovy-all.jar" src="${ssdt.groovy.jar.src}"/> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
35 <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${ssdt.devel.kit}/groovy-all.jar"/> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
36 </else> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
37 </if> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
38 </target> |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
39 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
40 <target name="project.init" depends="init"> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
41 <property file="build-number.txt" description="Bamboo build number"/> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
42 <property name="build.number" value="-1" description="Unknown build number"/> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
43 <property name="project.version" value="${ivy.revision}"/> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
44 <property name="project.name" value="${ivy.module}"/> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
45 <property name="project.version.file" value="${build.classes.dir}/version.properties"/> |
4 | 46 </target> |
47 | |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
48 <target name="project.version" depends="project.init" > |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
49 <propertyfile file="${project.version.file}" comment="Version build information"> |
4 | 50 <entry key="projectName" value="${project.name}"/> |
51 <entry key="projectVersion" value="${project.version}"/> | |
52 <entry key="buildDate" type="date" value="now"/> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
53 <entry key="buildNumber" value="${build.number}"/> |
4 | 54 <entry key="built.by" value="${ant.version}"/> |
55 <entry key="build.java.version" value="${ant.java.version}"/> | |
56 <entry key="built.on" value="${os.name} ${os.arch} ${os.version} (${user.name})"/> | |
57 </propertyfile> | |
58 </target> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
59 |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
60 <target name="-project.pre-init" depends="init"> |
4 | 61 <condition property="tomcat.available"> |
62 <and> | |
63 <available file="${tomcat.home}" type="dir"/> | |
64 </and> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
65 </condition> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
66 </target> |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
67 |
4 | 68 <target name="-project.init-tomcat" depends="-project.pre-init" if="tomcat.available"> |
69 <property name="tomcat.url" value="http://localhost:8084"/> | |
70 <property name="tomcat.manager.url" value="${tomcat.url}/manager"/> | |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
71 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
72 <taskdef resource="org/apache/catalina/ant/antlib.xml" uri="http://ssdt-ohio.org/ant/tomcat"> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
73 <classpath> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
74 <fileset dir="${tomcat.home}" includes="**/lib/catalina-ant.jar"/> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
75 </classpath> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
76 </taskdef> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
77 </target> |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
78 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
79 <target name="project.web.context" depends="-project.init-tomcat,init"> |
4 | 80 <dirname property="docBase.dir.name" file="${build.web.dir}/WEB-INF"/> |
81 | |
82 <property name="project.context.file" value="${web.docbase.dir}/META-INF/context.xml"/> | |
83 | |
84 <copy file="${project.context.file}" | |
85 tofile="${build.web.dir}/META-INF/context-dev.xml" | |
86 overwrite="true"> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
87 <filterchain> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
88 <tokenfilter> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
89 <filetokenizer/> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
90 <replaceregex |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
91 pattern="<Context.*>" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
92 replace="<Context path="${web.context.path}" docBase="@DOCBASE" >" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
93 /> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
94 </tokenfilter> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
95 </filterchain> |
4 | 96 </copy> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
97 <replace file="${build.web.dir}/META-INF/context-dev.xml" |
4 | 98 token="@DOCBASE" |
99 value="${docBase.dir.name}"/> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
100 </target> |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
101 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
102 <target name="project.undeploy" depends="-project.init-tomcat"> |
4 | 103 <dirname property="build.web.dir.path" file="${build.web.dir}/WEB-INF"/> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
104 <tomcat:undeploy password="${tomcat.password}" |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
105 url="${tomcat.manager.url}" username="${tomcat.username}" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
106 path="${web.context.path}" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
107 failonerror="false" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
108 /> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
109 </target> |
4 | 110 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
111 <target name="project.deploy" depends="project.undeploy,project.web.context"> |
4 | 112 <dirname property="build.web.dir.path" file="${build.web.dir}/WEB-INF"/> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
113 <tomcat:deploy password="${tomcat.password}" |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
114 url="${tomcat.manager.url}" username="${tomcat.username}" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
115 path="${web.context.path}" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
116 config="${build.web.dir.path}/META-INF/context-dev.xml" |
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
117 /> |
4 | 118 <delete file="${build.web.dir.path}/META-INF/context-dev.xml" failonerror="false"/> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
119 </target> |
15
d2901f1c52c3
Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents:
5
diff
changeset
|
120 |
4 | 121 </project> |