annotate ssdt-common-build.xml @ 342:9791f84cfc67

Add github init40 gradle plugin script
author Marc Davis <marc.davis@mcoecn.org>
date Fri, 09 Jun 2023 14:28:13 -0400
parents 6c62c55b613f
children
rev   line source
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
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
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
6 ssdt common build functions. Contains generalized tasks to perform
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
7 common functions. Assumes some standard properties from a NetBeans
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
8 project are provided.
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
9
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
10 Properties used for webapps:
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
11
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
12 build.web.dir - docBase of build webapp.
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
13 web.docbase.dir - source docBase of webapp
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
14 web.context.path - path to install webapp in Tomcat
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
15 tomcat.username - Tomcat manager username
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
16 tomcat.password - Tomcat manager password
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
17
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
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
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
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
32
9480be99ec76 Restore -project.init.groovy.task for backwards compatibility
smith@nwoca.org
parents: 28
diff changeset
26 <target name="-project.init.groovy.task">
9480be99ec76 Restore -project.init.groovy.task for backwards compatibility
smith@nwoca.org
parents: 28
diff changeset
27 <echo message="Note: -project.init.groovy.task is a noop. Please remove from dependency."/>
9480be99ec76 Restore -project.init.groovy.task for backwards compatibility
smith@nwoca.org
parents: 28
diff changeset
28 </target>
9480be99ec76 Restore -project.init.groovy.task for backwards compatibility
smith@nwoca.org
parents: 28
diff changeset
29
28
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
30 <if>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
31 <available classpath="${run.test.classpath}" classname="org.codehaus.groovy.ant.Groovy"/>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
32 <then>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
33 <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${run.test.classpath}"/>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
34 </then>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
35 <else>
321
6c62c55b613f USASR-5111: Adding legacy jars.
Jason Klinger <klinger@nwoca.org>
parents: 315
diff changeset
36 <property name="ssdt.groovy.jar.src" value="${ssdt.devel.kit.src}/legacy.jars/groovy-all.jar"/>
28
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
37 <ssdt:fetch dest="${ssdt.devel.kit}/groovy-all.jar" src="${ssdt.groovy.jar.src}"/>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
38 <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${ssdt.devel.kit}/groovy-all.jar"/>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
39 </else>
ad0a75e20f7b TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
smith@nwoca.org
parents: 15
diff changeset
40 </if>
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
41
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
42 <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
43 <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
44 <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
45 <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
46 <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
47 <property name="project.version.file" value="${build.classes.dir}/version.properties"/>
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
48 </target>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
49
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
50 <target name="project.version" depends="project.init" >
46
8b682fce9900 correct version problem
smith@nwoca.org
parents: 45
diff changeset
51 <mkdir dir="${build.classes.dir}"/>
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
52 <propertyfile file="${project.version.file}" comment="Version build information">
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
53 <entry key="projectName" value="${project.name}"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
54 <entry key="projectVersion" value="${project.version}"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
55 <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
56 <entry key="buildNumber" value="${build.number}"/>
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
57 <entry key="built.by" value="${ant.version}"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
58 <entry key="build.java.version" value="${ant.java.version}"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
59 <entry key="built.on" value="${os.name} ${os.arch} ${os.version} (${user.name})"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
60 </propertyfile>
58
426d160e1e4a USPSR-221: Include version properties as ant properties
smith@nwoca.org
parents: 46
diff changeset
61 <property file="${project.version.file}" prefix="version"/>
426d160e1e4a USPSR-221: Include version properties as ant properties
smith@nwoca.org
parents: 46
diff changeset
62
46
8b682fce9900 correct version problem
smith@nwoca.org
parents: 45
diff changeset
63 </target>
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
64
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
65 <target name="-project.pre-init" depends="init">
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
66 <condition property="tomcat.available">
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
67 <and>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
68 <available file="${tomcat.home}" type="dir"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
69 </and>
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
70 </condition>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
71 </target>
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
72
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
73 <target name="-project.init-tomcat" depends="-project.pre-init" if="tomcat.available">
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
74 <property name="tomcat.url" value="http://localhost:8084"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
75 <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
76
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
77 <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
78 <classpath>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
79 <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
80 </classpath>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
81 </taskdef>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
82 </target>
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
83
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 name="project.web.context" depends="-project.init-tomcat,init">
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
85 <dirname property="docBase.dir.name" file="${build.web.dir}/WEB-INF"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
86
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
87 <property name="project.context.file" value="${web.docbase.dir}/META-INF/context.xml"/>
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
88
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
89 <copy file="${project.context.file}"
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
90 tofile="${build.web.dir}/META-INF/context-dev.xml"
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
91 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
92 <filterchain>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
93 <tokenfilter>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
94 <filetokenizer/>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
95 <replaceregex
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
96 pattern="&lt;Context.*&gt;"
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
97 replace="&lt;Context path=&quot;${web.context.path}&quot; docBase=&quot;@DOCBASE&quot; &gt;"
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
98 />
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
99 </tokenfilter>
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
100 </filterchain>
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
101 </copy>
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
102 <replace file="${build.web.dir}/META-INF/context-dev.xml"
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
103 token="@DOCBASE"
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
104 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
105 </target>
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
106
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
107 <target name="project.undeploy" depends="-project.init-tomcat">
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
108 <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
109 <tomcat:undeploy password="${tomcat.password}"
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
110 url="${tomcat.manager.url}" username="${tomcat.username}"
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
111 path="${web.context.path}"
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
112 failonerror="false"
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
113 />
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
114 </target>
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
115
5
9c847b8c7e9c TL-32: Update ssdt-common-build to remove obsolte tasks and remove CVS assumptions.
smith@nwoca.org
parents: 4
diff changeset
116 <target name="project.deploy" depends="project.undeploy,project.web.context">
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
117 <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
118 <tomcat:deploy password="${tomcat.password}"
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
119 url="${tomcat.manager.url}" username="${tomcat.username}"
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
120 path="${web.context.path}"
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
121 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
122 />
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
123 <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
124 </target>
45
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
125 <macrodef name="junit-summary"
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
126 description="creates a summary of junit results"
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
127 uri="http://www.ssdt-ohio.org/ant/common">
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
128 <attribute name="dir" description="JUNIT test results" default="${build.test.results.dir}"/>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
129 <attribute name="file" description="output file" default="${build.test.results.dir}/summary.txt"/>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
130 <sequential>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
131 <junitreport tofile="@{dir}/combined.xml">
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
132 <fileset dir="@{dir}">
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
133 <include name="TEST-*.xml"/>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
134 </fileset>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
135 </junitreport>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
136 <xslt in="@{dir}/combined.xml" out="@{file}">
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
137 <style>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
138 <javaresource name="org/ssdt_ohio/tools/ant/junit-summary_1.xsl" classpath="${user.home}/.ant/lib/ssdt-ant.jar"/>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
139 </style>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
140 </xslt>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
141 </sequential>
cc9b1cd6098b add macro for summary text junit report
smith@nwoca.org
parents: 32
diff changeset
142 </macrodef>
15
d2901f1c52c3 Add common task for initialiaing groovy ant task.
smith@nwoca.org
parents: 5
diff changeset
143
4
be1051bf262f add globally common ant scripts
smith@nwoca.org
parents:
diff changeset
144 </project>