changeset 9:ae7d512164d0

TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
author smith@nwoca.org
date Sat, 18 Dec 2010 19:41:10 -0500
parents 26a4d8410fdf
children 3c87d0aee1f9
files README bootstrap.xml groovy-ant.xml
diffstat 3 files changed, 141 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/README	Sat Dec 18 14:20:32 2010 -0500
+++ b/README	Sat Dec 18 19:41:10 2010 -0500
@@ -1,4 +1,26 @@
 
-   SSDT Development tools.
+SSDT Development tools.
+=======================
+
+Contains scripts and utilities to bootstrap development and build environment.
+
+All scripts should be placed in ${user.home}/.ssdt
+
+Scripts will be downloaded from SSDT web server if the server is available
+and when new versions are available.
+
+  bootstrap.xml  -- initial script to include base scripts and provide tasks
+                    to download other scripts.
 
-   Contains scripts and utilities to bootstrap development and build envirnoment.
+  antcontrib.xml -- Makes Ant Contrib tasks available to all builds
+
+  groovy-ant.xml -- FOr Groovy based projects, customizes NetBeans builds.
+
+  ivy-ant.xml    -- Common Ivy routines to customize how IvyBeans handles builds.
+
+  ssdt-common-build.xml
+                 -- Common project targets and targets for deploying to SSDT
+                    devel servers.
+
+  ssdt.default.ivy.settings.xml
+                 -- Standard ivysetting.xml
--- a/bootstrap.xml	Sat Dec 18 14:20:32 2010 -0500
+++ b/bootstrap.xml	Sat Dec 18 19:41:10 2010 -0500
@@ -13,12 +13,19 @@
     <macrodef name="import-ant" uri="http://www.ssdt-ohio.org/ant/common">
         <attribute name="file"/>
         <sequential>
+            <ssdt:require-ant file="@{file}"/>
+            <import    file="${ssdt.devel.kit}/@{file}"/>
+        </sequential>
+    </macrodef> 
+
+    <macrodef name="require-ant" uri="http://www.ssdt-ohio.org/ant/common">
+        <attribute name="file"/>
+        <sequential>
             <get dest="${ssdt.devel.kit}/@{file}"
                 src="${ssdt.devel.kit.src}/@{file}"
                 usetimestamp="true" verbose="false" ignoreerrors="true" />
-            <import    file="${ssdt.devel.kit}/@{file}"/>
         </sequential>
-    </macrodef> 
+    </macrodef>
 
     <macrodef name="fetch"  uri="http://www.ssdt-ohio.org/ant/common">
         <attribute name="dest" default="${user.home.ant.lib}"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/groovy-ant.xml	Sat Dec 18 19:41:10 2010 -0500
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="groovy-project-tasks" default="all" basedir=".">
+ 
+    <description>Ant tasks shared by Groovy based NetBeans projects.</description>
+
+    <!-- Following targets may need to be copied to the build.xml. -->
+    <target name="-javadoc-build" depends="groovydoc"/>
+    <target name="-init-macrodef-junit" depends="-init-macrodef-junit-groovy"/>
+    <target name="-pre-compile" depends="-groovy-init-macrodef-javac-groovyc"/>
+    <!-- end copy -->
+
+    <target depends="init" name="groovydoc">
+        <taskdef name="groovydoc"
+                 classname="org.codehaus.groovy.ant.Groovydoc"
+                 classpath="${javac.classpath}"/>
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <groovydoc
+            destdir="${dist.javadoc.dir}"
+            sourcepath="${src.dir}"
+            windowtitle="${javadoc.windowtitle}"
+            use="${javadoc.use}"
+            private="${javadoc.private}"
+            author="${javadoc.author}"
+            doctitle="${javadoc.windowtitle}">
+            <link packages="java.,org.xml.,javax.,org.xml." href="http://java.sun.com/javase/6/docs/api/"/>
+            <link packages="org.apache.ant.,org.apache.tools.ant." href="http://www.dpml.net/api/ant/1.7.0"/>
+            <link packages="org.junit.,junit.framework." href="http://junit.sourceforge.net/junit3.8.1/javadoc/"/>
+            <link packages="groovy.,org.codehaus.groovy." href="http://groovy.codehaus.org/api/"/>
+        </groovydoc>
+    </target>
+
+    <target name="-init-macrodef-junit-groovy">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <sequential>
+                <if>
+                    <isset property="java.agent.jar"/>
+                    <then>
+                        <property name="jvm.agent" value="-javaagent:${java.agent.jar}"/>
+                    </then>
+                    <else>
+                        <property name="jvm.agent" value=""/>
+                    </else>
+                </if>
+                <propertyregex input="@{includes}" property="testg.includes" regexp="\.groovy" replace=".class" defaultValue="@{includes}"/>
+                <junit  dir="${work.dir}"
+                        errorproperty="tests.failed"
+                        failureproperty="tests.failed"
+                        fork="true"
+                        forkmode="once"
+                        showoutput="true">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes}" includes="${testg.includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${jvm.agent}"/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+
+    <target name="-groovy-init-macrodef-javac-groovyc">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute name="srcdir" default="${src.dir}"/>
+            <attribute name="destdir" default="${build.classes.dir}"/>
+            <attribute name="classpath" default="${javac.classpath}"/>
+            <attribute name="includes" default="${includes}"/>
+            <attribute name="excludes" default="${excludes}"/>
+            <attribute name="debug" default="${javac.debug}"/>
+            <attribute name="sourcepath" default="${empty.dir}"/>
+            <attribute name="gensrcdir" default="${empty.dir}"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <taskdef name="groovyc" classpath="${javac.classpath}" classname="org.codehaus.groovy.ant.Groovyc"/>
+                <property name="empty.dir" location="${build.dir}/empty"/>
+                <mkdir dir="${empty.dir}"/>
+                <groovyc fork="true" srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" encoding="${source.encoding}" includes="@{includes}" excludes="@{excludes}" includeAntRuntime="false">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <javac debug="@{debug}" deprecation="${javac.deprecation}" encoding="${source.encoding}" source="${javac.source}" target="${javac.target}">
+                        <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
+                        <customize/>
+                    </javac>
+                </groovyc>
+            </sequential>
+        </macrodef>
+    </target>
+</project>