[297277] Need CI build for Vex
diff --git a/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.properties b/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.properties
index 7c5ea26..177cd8d 100644
--- a/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.properties
+++ b/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.properties
@@ -31,7 +31,6 @@
parallelCompilation=true
generateFeatureVersionSuffix=true
individualSourceBundles=true
-forceContextQualifier=v${env.BUILD_ID}
writableBuildRoot=${WORKSPACE}/build
## END PROJECT BUILD PROPERTIES ##
diff --git a/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.xml b/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.xml
index 2c5d111..8907096 100644
--- a/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.xml
+++ b/sourceediting/development/org.eclipse.wst.xml.vex.releng/build.xml
@@ -1,53 +1,51 @@
<project default="run" name="org.eclipse.wst.xml.xpath2.releng/build.xml - Run a PsychoPath build using the Athena CBI">
- <target name="run">
- <!-- load properties and set timestamp for the build -->
- <property environment="env"/>
- <property name="WORKSPACE" location="${env.WORKSPACE}"/>
- <property file="build.properties" />
- <tstamp>
- <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
- </tstamp>
-<!--
- <property name="forceContextQualifier" value="v${buildTimestamp}" />
- <property name="fetchTag" value="HEAD" />
--->
- <!-- calculate workspaceDir as parent of this folder, the project's .releng folder (relengBuilderDir) -->
- <property name="relengBuilderDir" value="${basedir}" />
- <dirname file="${relengBuilderDir}" property="workspaceDir" />
+ <!-- load properties and set timestamp for the build -->
+ <property environment="env"/>
+ <property name="WORKSPACE" location="${env.WORKSPACE}"/>
+ <property file="build.properties" />
+ <tstamp>
+ <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
+ </tstamp>
+ <property name="forceContextQualifier" value="v${buildTimestamp}" />
+ <property name="fetchTag" value="HEAD" />
+
+ <!-- calculate workspaceDir as parent of this folder, the project's .releng folder (relengBuilderDir) -->
+ <property name="relengBuilderDir" value="${basedir}" />
+ <import file="findbugs.xml"/>
+ <import file="pmd.xml"/>
+ <dirname file="${relengBuilderDir}" property="workspaceDir" />
- <!--
- can build in /tmp, eg., in /tmp/build, or in workspace, eg.,
- ${WORKSPACE}/build
- -->
- <property name="writableBuildRoot" value="${WORKSPACE}/build" />
+ <!--
+ can build in /tmp, eg., in /tmp/build, or in workspace, eg.,
+ ${WORKSPACE}/build
+ -->
+ <property name="writableBuildRoot" value="/tmp/build" />
+ <property name="sdkzipUrl" value="https://build.eclipse.org/hudson/job/cbi-wtp-wst.xsl.psychopath/ws/build/athena/"/>
- <!--
- can be simple path, eg.,
- ${writableBuildRoot}/${buildType}${buildTimestamp} or longer, eg.,
- ${writableBuildRoot}/${topprojectName}/${projectName}/downloads/drops/${version}/${buildType}${buildTimestamp} or
- ${writableBuildRoot}/${topprojectName}/${projectName}/${subprojectName}/downloads/drops/${version}/${buildType}${buildTimestamp}
- -->
- <property name="buildDir" value="${writableBuildRoot}/athena" />
+ <!--
+ can be simple path, eg.,
+ ${writableBuildRoot}/${buildType}${buildTimestamp} or longer, eg.,
+ ${writableBuildRoot}/${topprojectName}/${projectName}/downloads/drops/${version}/${buildType}${buildTimestamp} or
+ ${writableBuildRoot}/${topprojectName}/${projectName}/${subprojectName}/downloads/drops/${version}/${buildType}${buildTimestamp}
+ -->
+ <property name="buildDir" value="${writableBuildRoot}/athena" />
+
+ <target name="init">
+ <delete dir="${buildDir}" failonerror="false"/>
+ </target>
- <delete dir="${writableBuildRoot}"/>
+ <target name="run" depends="init">
<echo message="Workspace: ${WORKSPACE}"/>
<echo message="Writable Build Root: ${writableBuildRoot}"/>
- <echo message="Common builder Dir: ${relengCommonBuilderDir}"/>
+ <mkdir dir="${writableBuildRoot}"/>
<!-- invoke a new Eclipse process and launch the build from the common.releng folder -->
<property name="relengCommonBuilderDir" value="${workspaceDir}/org.eclipse.dash.common.releng" />
- <echo message="RelengBuilderDir: ${relengBuilderDir}"/>
- <mkdir dir="${writableBuildRoot}"/>
-
- <ant antfile="${relengCommonBuilderDir}/buildAll.xml" target="runEclipse" dir="${relengCommonBuilderDir}">
- <property file="build.properties"/>
- </ant>
-
+ <ant antfile="${relengCommonBuilderDir}/buildAll.xml" target="runEclipse" dir="${relengCommonBuilderDir}" />
+ <antcall target="findbugs" inheritall="true"/>
<cleanUpBuild/>
+ <antcall target="duplicateCode" inheritall="true"/>
</target>
-
- <!-- = = = = = = = = = = = = = = = = =
- macrodef: cleanUpBuild
- = = = = = = = = = = = = = = = = = -->
+
<macrodef name="cleanUpBuild">
<sequential>
<delete dir="${buildDir}/eclipse" failonerror="false" />
@@ -55,13 +53,32 @@
<delete dir="${buildDir}/compilelogs" failonerror="false"/>
<delete dir="${buildDir}/testResults/consolelogs" failonerror="false"/>
<delete dir="${buildDir}/testResults/html" failonerror="false"/>
+ <delete dir="${writableBuildRoot}/athena/findbugs"/>
+ <delete dir="${writableBuildRoot}/athena/findbugsclasses"/>
<delete>
<fileset dir="${buildDir}">
<include name="*AllFeatures*.zip*"/>
<include name="*Master*.zip*"/>
</fileset>
</delete>
-
</sequential>
- </macrodef>
+ </macrodef>
+
+
+ <!-- =================================
+ target: default
+ ================================= -->
+ <target name="findbugs" description="Run a find bugs analysis based on a ZIP file contents.">
+ <patternset id="xpathjars">
+ <include name="eclipse/plugins/org.eclipse.wst.xml.xpath2.processor*.jar"/>
+ </patternset>
+ <getFindBugs downloadDir="${writableBuildRoot}/downloads" destDir="${writableBuildRoot}/3rdPartyJars/findbugs"/>
+ <extractJarsForAnalysis src="${sdkzipUrl}${zipPrefix}-SDK-${buildType}${buildTimestamp}.zip" refid="xpathjars"/>
+ <findBugs outputfile="${writableBuildRoot}/athena/fb-xpath20processor.xml"/>
+ </target>
+
+ <target name="duplicateCode" description="Run PMD duplicate code analysis">
+ <getPMD downloadDir="${writableBuildRoot}/downloads" destDir="${writableBuildRoot}/3rdPartyJars/pmd"/>
+ <cpd outputfile="${writableBuildRoot}/athena/cpd-xpath20processor.xml" srcdir="${WORKSPACE}"/>
+ </target>
</project>
diff --git a/sourceediting/development/org.eclipse.wst.xml.vex.releng/findbugs.xml b/sourceediting/development/org.eclipse.wst.xml.vex.releng/findbugs.xml
new file mode 100644
index 0000000..fed9c7d
--- /dev/null
+++ b/sourceediting/development/org.eclipse.wst.xml.vex.releng/findbugs.xml
@@ -0,0 +1,52 @@
+<project name="findBugs">
+
+ <macrodef name="getFindBugs">
+ <attribute name="downloadDir"/>
+ <attribute name="destDir"/>
+ <sequential>
+ <mkdir dir="@{downloadDir}"/>
+ <get src="http://downloads.sourceforge.net/project/findbugs/findbugs/1.3.9/findbugs-1.3.9.zip?use_mirror=voxel" dest="@{downloadDir}/findbugs.zip"/>
+ <unzip src="${writableBuildRoot}/downloads/findbugs.zip" dest="@{destDir}"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="extractJarsForAnalysis">
+ <attribute name="refid"/>
+ <attribute name="src"/>
+ <sequential>
+ <get src="@{src}" dest="${writableBuildRoot}/eclipse.zip"/>
+ <delete dir="${writableBuildRoot}/athena/findbugs"/>
+ <mkdir dir="${writableBuildRoot}/athena/findbugs"/>
+ <unzip src="${writableBuildRoot}/eclipse.zip" dest="${writableBuildRoot}/athena/findbugs/">
+ <patternset refid="@{refid}"/>
+ </unzip>
+ <unzip dest="${writableBuildRoot}/athena/findbugsclasses/">
+ <fileset dir="${writableBuildRoot}/athena/findbugs/">
+ <include name="**/*.jar"/>
+ </fileset>
+ </unzip>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="findBugs">
+ <attribute name="outputfile"/>
+ <sequential>
+ <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
+ <classpath>
+ <path>
+ <fileset dir="${writableBuildRoot}/3rdPartyJars/findbugs/findbugs-1.3.9/lib" includes="*.jar"/>
+ </path>
+ </classpath>
+ </taskdef>
+
+ <findbugs home="${writableBuildRoot}/3rdPartyJars/findbugs/findbugs-1.3.9/lib"
+ output="xml"
+ outputFile="@{outputfile}" >
+ <class location="${writableBuildRoot}/athena/findbugsclasses"/>
+ </findbugs>
+ </sequential>
+ </macrodef>
+
+
+
+</project>
\ No newline at end of file
diff --git a/sourceediting/development/org.eclipse.wst.xml.vex.releng/pmd.xml b/sourceediting/development/org.eclipse.wst.xml.vex.releng/pmd.xml
new file mode 100644
index 0000000..40edb41
--- /dev/null
+++ b/sourceediting/development/org.eclipse.wst.xml.vex.releng/pmd.xml
@@ -0,0 +1,34 @@
+<project name="pmd">
+
+ <macrodef name="getPMD">
+ <attribute name="downloadDir"/>
+ <attribute name="destDir"/>
+ <sequential>
+ <mkdir dir="@{downloadDir}"/>
+ <get src="http://downloads.sourceforge.net/project/pmd/pmd/4.2.5/pmd-bin-4.2.5.zip?use_mirror=softlayer" dest="@{downloadDir}/pmd.zip" usetimestamp="true"/>
+ <unzip src="${writableBuildRoot}/downloads/pmd.zip" dest="@{destDir}"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="cpd">
+ <attribute name="outputfile"/>
+ <attribute name="srcdir"/>
+ <sequential>
+ <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask">
+ <classpath>
+ <path>
+ <fileset dir="${writableBuildRoot}/3rdPartyJars/pmd/pmd-4.2.5/lib" includes="*.jar"/>
+ </path>
+ </classpath>
+ </taskdef>
+ <cpd minimumTokenCount="100" format="xml" outputFile="@{outputfile}">
+ <fileset dir="@{srcdir}">
+ <include name="**/*.java"/>
+ </fileset>
+ </cpd>
+ </sequential>
+ </macrodef>
+
+
+
+</project>
\ No newline at end of file
diff --git a/sourceediting/development/org.eclipse.wst.xml.vex.releng/testing.properties b/sourceediting/development/org.eclipse.wst.xml.vex.releng/testing.properties
index 77b5380..cce9518 100644
--- a/sourceediting/development/org.eclipse.wst.xml.vex.releng/testing.properties
+++ b/sourceediting/development/org.eclipse.wst.xml.vex.releng/testing.properties
@@ -1,7 +1,7 @@
#csv list of test plugins to run
-testPluginsToRun=org.eclipse.wst.xml.vex.core.tests
+testPluginsToRun=org.eclipse.wst.xml.xpath2.processor.tests
#,org.eclipse.zest.tests # need an aggregate test suite first!
#map name of test plugin to testsuite class to run
-org.eclipse.wst.xml.vex.core.tests.suite=org.eclipse.wst.xml.vex.core.tests.VEXCoreTestSuite
-extraVMargs=-Dorg.eclipse.swt.browser.XULRunnerPath=/shared/common/mozilla-xulrunner181-1.8.1.4-30.ppc
+org.eclipse.wst.xml.xpath2.processor.tests.suite=org.eclipse.wst.xml.xpath2.processor.test.AllPsychoPathTests
+extraVMargs=-Dorg.eclipse.swt.browser.XULRunnerPath=/shared/common/mozilla-xulrunner181-1.8.1.4-30.ppc
\ No newline at end of file