Mercurial > public > develkit
annotate ssdt-common-build.xml @ 13:dc7212d33458
move netbeans-copylibs jar to .ssdt instead of .ant/lib
author | smith@nwoca.org |
---|---|
date | Thu, 23 Dec 2010 23:32:10 -0500 |
parents | 9c847b8c7e9c |
children | d2901f1c52c3 |
rev | line source |
---|---|
4 | 1 <?xml version="1.0" encoding="UTF-8"?> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
2 <project name="ssdt-common-build" default="all" basedir="." xmlns:tomcat="http://ssdt-ohio.org/ant/tomcat"> |
4 | 3 <!-- |
4 ssdt common build functions. Contains generalized tasks to perform | |
5 common functions. Assumes some standard properties from a NetBeans | |
6 project are provided. | |
7 | |
8 Properties used for webapps: | |
9 | |
10 build.web.dir - docBase of build webapp. | |
11 web.docbase.dir - source docBase of webapp | |
12 web.context.path - path to install webapp in Tomcat | |
13 tomcat.username - Tomcat manager username | |
14 tomcat.password - Tomcat manager password | |
15 | |
16 --> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
17 <target name="project.cvs.update" |
4 | 18 depends="project.init" |
19 unless="build.devel.bamboo"> | |
20 <!-- Get the latest from CVS --> | |
21 <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
|
22 </target> |
4 | 23 |
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 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
|
25 <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
|
26 <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
|
27 <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
|
28 <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
|
29 <property name="project.version.file" value="${build.classes.dir}/version.properties"/> |
4 | 30 </target> |
31 | |
32 <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
|
33 <propertyfile file="${project.version.file}" comment="Version build information"> |
4 | 34 <entry key="projectName" value="${project.name}"/> |
35 <entry key="projectVersion" value="${project.version}"/> | |
36 <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
|
37 <entry key="buildNumber" value="${build.number}"/> |
4 | 38 <entry key="built.by" value="${ant.version}"/> |
39 <entry key="build.java.version" value="${ant.java.version}"/> | |
40 <entry key="built.on" value="${os.name} ${os.arch} ${os.version} (${user.name})"/> | |
41 </propertyfile> | |
42 </target> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
43 |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
44 <target name="-project.pre-init" depends="init"> |
4 | 45 <condition property="tomcat.available"> |
46 <and> | |
47 <available file="${tomcat.home}" type="dir"/> | |
48 </and> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
49 </condition> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
50 </target> |
4 | 51 |
52 <target name="-project.init-tomcat" depends="-project.pre-init" if="tomcat.available"> | |
53 <property name="tomcat.url" value="http://localhost:8084"/> | |
54 <property name="tomcat.manager.url" value="${tomcat.url}/manager"/> | |
55 | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
56 <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
|
57 <classpath> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
58 <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
|
59 </classpath> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
60 </taskdef> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
61 </target> |
4 | 62 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
63 <target name="project.web.context" depends="-project.init-tomcat,init"> |
4 | 64 <dirname property="docBase.dir.name" file="${build.web.dir}/WEB-INF"/> |
65 | |
66 <property name="project.context.file" value="${web.docbase.dir}/META-INF/context.xml"/> | |
67 | |
68 <copy file="${project.context.file}" | |
69 tofile="${build.web.dir}/META-INF/context-dev.xml" | |
70 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
|
71 <filterchain> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
72 <tokenfilter> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
73 <filetokenizer/> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
74 <replaceregex |
4 | 75 pattern="<Context.*>" |
76 replace="<Context path="${web.context.path}" docBase="@DOCBASE" >" | |
77 /> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
78 </tokenfilter> |
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
79 </filterchain> |
4 | 80 </copy> |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
81 <replace file="${build.web.dir}/META-INF/context-dev.xml" |
4 | 82 token="@DOCBASE" |
83 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
|
84 </target> |
4 | 85 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
86 <target name="project.undeploy" depends="-project.init-tomcat"> |
4 | 87 <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
|
88 <tomcat:undeploy password="${tomcat.password}" |
4 | 89 url="${tomcat.manager.url}" username="${tomcat.username}" |
90 path="${web.context.path}" | |
91 failonerror="false" | |
92 /> | |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
93 </target> |
4 | 94 |
5
9c847b8c7e9c
TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents:
4
diff
changeset
|
95 <target name="project.deploy" depends="project.undeploy,project.web.context"> |
4 | 96 <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
|
97 <tomcat:deploy password="${tomcat.password}" |
4 | 98 url="${tomcat.manager.url}" username="${tomcat.username}" |
99 path="${web.context.path}" | |
100 config="${build.web.dir.path}/META-INF/context-dev.xml" | |
101 /> | |
102 <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
|
103 </target> |
4 | 104 |
105 </project> |