You are viewing a plain text version of this content. The canonical link for it is here.
Posted to easyant-commits@incubator.apache.org by hi...@apache.org on 2011/02/22 15:09:32 UTC
svn commit: r1073358 [2/6] - in /incubator/easyant/easyant4e/trunk:
org.apache.easyant4e.releng/ org.apache.easyant4e.releng/build-files/
org.apache.easyant4e.releng/build-files/automatedTests/
org.apache.easyant4e.tests/datas/simplejavaproject/ org.ap...
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.properties
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.properties?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.properties (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.properties Tue Feb 22 15:09:30 2011
@@ -42,7 +42,7 @@ collectingFolder=${archivePrefix}
#The list can only contain the configuration for which the desired format is different than zip.
# E.g. win32,win32,x86 - antZip
#archivesFormat=
-
+
# Set to true for Jnlp generation
# @category jnlp
# @type Boolean
@@ -66,7 +66,7 @@ collectingFolder=${archivePrefix}
# Set to ${configs} in order to filter the content of the generated jnlp files based on the configuration being built
# @category jnlp
# @type enum values=${configs}
-# jnlp.configs=
+# jnlp.configs=
# Check if you want to sign jars
# @type Boolean
@@ -222,4 +222,4 @@ p2.artifact.repo.name=Artifact Repo Name
# @category hidden
p2.flavor=tooling
# @category hidden
-p2.publish.artifacts=true
\ No newline at end of file
+p2.publish.artifacts=true
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.xml?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.xml (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build.xml Tue Feb 22 15:09:30 2011
@@ -19,241 +19,241 @@
If you modify this script it is likely that the build will not work on the server
-->
<project name="Build Facade" default="main">
- <taskdef resource="org/pluginbuilder/anttasks/pluginbuildertasks.properties" classpath="build-files/pluginbuilder-anttasks.jar" />
-
- <GetHostName />
- <property file="build_${hostname}.properties" />
- <property file="build_local.properties" />
- <property name="eclipse.installation.dir" value="${eclipseDir}"/>
- <import file="build-files/build_shared.xml"/>
-
- <target name="-properties">
-
- <!-- versioning -->
- <property name="build.version" value="HEAD"/>
- <property name="releaseConfigFile" value="releases/${build.version}.properties"/>
- <condition property="releaseConfigFile.exists">
- <available file="${releaseConfigFile}"/>
- </condition>
- <fail message="Could not read release config file: ${releaseConfigFile}" unless="releaseConfigFile.exists"/>
- <property file="${releaseConfigFile}" />
-
- <tstamp>
- <format property="version.qualifier" pattern="yyyyMMddHHmm" timezone="GMT" unit="minute"/>
- </tstamp>
-
- <property name="buildTypePresentation" value=""/>
- <property name="version.full" value="${version}.${version.qualifier}${buildTypePresentation}"/>
-
- <!-- includes -->
- <GetHostName />
- <property file="build_${hostname}.properties" />
- <property file="build_local.properties" />
- <property file="pluginbuilder.config" />
-
- <!-- set defaults -->
- <property name="buildTarget" value="main"/>
- <property name="verboseAnt" value="-Ddummy=true"/>
-
- <!-- check if clean should be called -->
- <condition property="is.clean">
- <or>
- <equals arg1="main" arg2="${buildTarget}" trim="true"/>
- <equals arg1="fetch" arg2="${buildTarget}" trim="true"/>
- </or>
- </condition>
-
- <condition property="no.rcp.build" value="true">
- <not>
- <equals arg1="${pluginbuilder.is.rcpbuild}" arg2="true"/>
- </not>
- </condition>
-
- </target>
-
- <target name="-prepare.build.host">
-
- <antcall target="unpack.eclipse"/>
-
- <available type="dir" file="${eclipseDir}/plugins" property="eclipseDir.plugins.exists"/>
- <fail message="Could not find directory ${eclipseDir}/plugins. Please check eclipseDir in build_local.properties" unless="eclipseDir.plugins.exists"/>
-
- <!-- determine buildfiles -->
- <BundleFileLocator eclipseInstallationRoot="${eclipseDir}" bundleId="org.eclipse.pde.build" filePath="scripts/build.xml" property="regularbuildfile" />
- <dirname file="${regularbuildfile}" property="scriptdir"/>
- <property name="productbuildfile" value="${scriptdir}/productBuild/productBuild.xml"/>
-
- <!-- determine launcher -->
- <BundleFileLocator eclipseInstallationRoot="${eclipseDir}" bundleId="org.eclipse.equinox.launcher" property="equinoxjar" />
-
- </target>
-
- <target name="-clean" if="is.clean">
- <echo level="info" message="Cleaning directory ${buildDirectory}"/>
- <delete dir="${buildDirectory}" verbose="false"/>
- <mkdir dir="${buildDirectory}"/>
- </target>
-
- <target name="-build" depends="-properties,-clean,-prepare.build.host">
- <condition property="no.rcp.build" value="true">
- <not>
- <equals arg1="${pluginbuilder.is.rcpbuild}" arg2="true"/>
- </not>
- </condition>
- <antcall target="-build.internal">
- <param name="buildfile" value="${regularbuildfile}"/>
- </antcall>
- <!-- build rcp omitting fetch -->
- <property name="buildSystemProperty.skipFetch" value="true"/>
- <antcall target="-build.rcp.internal"/>
- </target>
-
- <target name="-build.rcp.internal" unless="no.rcp.build">
- <property prefix="buildSystemProperty." file="${buildHome}/build-files/build_rcp.properties"/>
- <antcall target="-checkProductProperty"/>
- <antcall target="-build.internal">
- <param name="buildfile" value="${productbuildfile}"/>
- </antcall>
- </target>
-
- <target name="-checkProductProperty">
- <condition property="isProductSet">
- <and>
- <isset property="buildSystemProperty.product"/>
- <not><equals arg1="${product}" arg2=""/></not>
- </and>
- </condition>
- <fail message="Building an RCP application requires a Product Configuration file to be specified ('product' property)." unless="isProductSet"/>
- </target>
-
- <target name="rcp" depends="-properties,-clean,-prepare.build.host" description="Build RCP only">
- <fail message="Please enable and configure an RCP build in the Plug-in Builder Editor before calling this target." if="no.rcp.build"/>
- <antcall target="-build.rcp.internal"/>
- </target>
-
- <target name="-build.internal">
- <property name="buildResultsDirectory" value="${buildDirectory}/results" />
-
- <java classname="org.eclipse.equinox.launcher.Main" fork="true"
- failonerror="true" errorproperty="build.stderr">
- <arg value="-ws" />
- <arg value="${ws}" />
- <arg value="-os" />
- <arg value="${os}" />
- <arg value="-application" />
- <arg value="org.eclipse.ant.core.antRunner" />
- <arg value="-buildfile" />
- <arg value="${buildfile}" />
- <arg value="${buildTarget}" />
- <arg value="-data" />
- <arg value="${buildDirectory}/workspace" />
- <arg value="${verboseAnt}"/>
- <jvmarg value="-Dbasews=${ws}" />
- <jvmarg value="-Dbaseos=${os}" />
- <jvmarg value="-Dbasearch=${arch}" />
- <jvmarg value="-Dbuilder=${buildHome}/build-files" />
- <jvmarg value="-DjavacFailOnError=true"/>
- <jvmarg value="-DbuildDirectory=${buildDirectory}"/>
- <jvmarg value="-DbuildResultsDirectory=${buildResultsDirectory}"/>
- <jvmarg value="-DbaseLocation=${eclipseDir}"/>
- <jvmarg value="-DbuildHome=${buildHome}"/>
- <jvmarg value="-Dversion.full=${version.full}"/>
- <jvmarg value="-Dversion.qualifier=${version.qualifier}${buildTypePresentation}"/>
- <jvmarg value="-DbuildType=${buildType}"/>
- <jvmarg value="-DfetchTag=${fetchTag}"/>
- <jvmarg value="-DbuildProperties=${buildHome}/build-files/build.properties"/>
-
- <classpath>
- <pathelement location="${equinoxjar}" />
- </classpath>
-
- <syspropertyset>
- <propertyset>
- <propertyref prefix="buildSystemProperty"/>
- <mapper type="glob" from="buildSystemProperty.*" to="*"/>
- </propertyset>
- </syspropertyset>
- </java>
-
- <!-- save stderr for scrutinizing later -->
- <echo file="${buildDirectory}/stderr.txt">${build.stderr}</echo>
-
- <echo taskname="stderr">${build.stderr}</echo>
-
- <condition property="is.build.error" value="true">
- <contains string="${build.stderr}" substring="BUILD FAILED"/>
- </condition>
- <!-- Note that the fail task throws an exception which will be intercepted
- from calling antcalls. During that processing the status will
- be lost and set to 1. Therefor ethe processing of TESTS FAILED which should
- return an exit status of 2 can only take place in main targets. -->
- <fail message="PDE Build failed" if="is.build.error" status="1"/>
-
- </target>
-
- <target name="main-cc"
- description="This target is suited to be run from cruisecontrol. The property 'label' is expected to be set from cruisecontrol.">
- <!-- Note that pluginbuilder also provides an EclipseLabelIncrementer which creates Eclipse version labels.
- see http://www.pluginbuilder.org/faq.html -->
- <property name="version.full" value="${label}"/>
- <SetRegex input="${label}" match=".+\..+\..+\.(.*)" property="version.qualifier" value="\1" />
- <antcall target="-build"/>
- </target>
-
- <target name="main" description="Run the main target of customTargets.xml. Return status 0,1,2 for Success, Build Failure and Test Failure">
- <property name="buildTarget" value="main"/>
- <antcall target="-build"/>
-
- <!-- this must be done in a top level target because otherwise the
- status would not get throuhg. If fail is called somewhere within
- an antcall the created exception will be caught which would result
- in a return status of 1 -->
- <loadfile srcFile="${buildDirectory}/stderr.txt" property="build.stderr"/>
- <condition property="is.tests.failed" value="true">
- <contains string="${build.stderr}" substring="TESTS FAILED"/>
- </condition>
- <fail message="Tests failed" if="is.tests.failed" status="2"/>
- </target>
-
- <target name="fetch" description="Run the fetch target of customTargets.xml.">
- <property name="buildTarget" value="fetch"/>
- <antcall target="-build"/>
- </target>
-
- <target name="generate" description="Run the generate target of customTargets.xml.">
- <property name="buildTarget" value="generate"/>
- <antcall target="-build"/>
- </target>
-
- <target name="process" description="Run the process target of customTargets.xml.">
- <property name="buildTarget" value="process"/>
- <antcall target="-build"/>
- </target>
-
- <target name="assemble" description="Run the assemble target of customTargets.xml.">
- <property name="buildTarget" value="assemble"/>
- <antcall target="-build"/>
- </target>
-
- <target name="postBuild" description="Run the postBuild target of customTargets.xml.">
- <property name="buildTarget" value="postBuild"/>
- <antcall target="-build"/>
- <!-- see main for a description why this must take place here. It is very ugly -->
- <loadfile srcFile="${buildDirectory}/stderr.txt" property="build.stderr"/>
- <condition property="is.tests.failed" value="true">
- <contains string="${build.stderr}" substring="TESTS FAILED"/>
- </condition>
- <fail message="Tests failed" if="is.tests.failed" status="2"/>
- </target>
-
- <target name="buildProperties" description="Print out derived properties for the current build." depends="-properties">
- <fail message="You have to set the property 'buildPropertiesFile' if calling buildProperties" unless="buildPropertiesFile"/>
- <condition property="subdir" value="nightly" else="releases">
- <equals arg1="${buildType}" arg2="N"/>
- </condition>
- <echo file="${buildPropertiesFile}">relativeServerResultsDir: ${subdir}
+ <taskdef resource="org/pluginbuilder/anttasks/pluginbuildertasks.properties" classpath="build-files/pluginbuilder-anttasks.jar" />
+
+ <GetHostName />
+ <property file="build_${hostname}.properties" />
+ <property file="build_local.properties" />
+ <property name="eclipse.installation.dir" value="${eclipseDir}"/>
+ <import file="build-files/build_shared.xml"/>
+
+ <target name="-properties">
+
+ <!-- versioning -->
+ <property name="build.version" value="HEAD"/>
+ <property name="releaseConfigFile" value="releases/${build.version}.properties"/>
+ <condition property="releaseConfigFile.exists">
+ <available file="${releaseConfigFile}"/>
+ </condition>
+ <fail message="Could not read release config file: ${releaseConfigFile}" unless="releaseConfigFile.exists"/>
+ <property file="${releaseConfigFile}" />
+
+ <tstamp>
+ <format property="version.qualifier" pattern="yyyyMMddHHmm" timezone="GMT" unit="minute"/>
+ </tstamp>
+
+ <property name="buildTypePresentation" value=""/>
+ <property name="version.full" value="${version}.${version.qualifier}${buildTypePresentation}"/>
+
+ <!-- includes -->
+ <GetHostName />
+ <property file="build_${hostname}.properties" />
+ <property file="build_local.properties" />
+ <property file="pluginbuilder.config" />
+
+ <!-- set defaults -->
+ <property name="buildTarget" value="main"/>
+ <property name="verboseAnt" value="-Ddummy=true"/>
+
+ <!-- check if clean should be called -->
+ <condition property="is.clean">
+ <or>
+ <equals arg1="main" arg2="${buildTarget}" trim="true"/>
+ <equals arg1="fetch" arg2="${buildTarget}" trim="true"/>
+ </or>
+ </condition>
+
+ <condition property="no.rcp.build" value="true">
+ <not>
+ <equals arg1="${pluginbuilder.is.rcpbuild}" arg2="true"/>
+ </not>
+ </condition>
+
+ </target>
+
+ <target name="-prepare.build.host">
+
+ <antcall target="unpack.eclipse"/>
+
+ <available type="dir" file="${eclipseDir}/plugins" property="eclipseDir.plugins.exists"/>
+ <fail message="Could not find directory ${eclipseDir}/plugins. Please check eclipseDir in build_local.properties" unless="eclipseDir.plugins.exists"/>
+
+ <!-- determine buildfiles -->
+ <BundleFileLocator eclipseInstallationRoot="${eclipseDir}" bundleId="org.eclipse.pde.build" filePath="scripts/build.xml" property="regularbuildfile" />
+ <dirname file="${regularbuildfile}" property="scriptdir"/>
+ <property name="productbuildfile" value="${scriptdir}/productBuild/productBuild.xml"/>
+
+ <!-- determine launcher -->
+ <BundleFileLocator eclipseInstallationRoot="${eclipseDir}" bundleId="org.eclipse.equinox.launcher" property="equinoxjar" />
+
+ </target>
+
+ <target name="-clean" if="is.clean">
+ <echo level="info" message="Cleaning directory ${buildDirectory}"/>
+ <delete dir="${buildDirectory}" verbose="false"/>
+ <mkdir dir="${buildDirectory}"/>
+ </target>
+
+ <target name="-build" depends="-properties,-clean,-prepare.build.host">
+ <condition property="no.rcp.build" value="true">
+ <not>
+ <equals arg1="${pluginbuilder.is.rcpbuild}" arg2="true"/>
+ </not>
+ </condition>
+ <antcall target="-build.internal">
+ <param name="buildfile" value="${regularbuildfile}"/>
+ </antcall>
+ <!-- build rcp omitting fetch -->
+ <property name="buildSystemProperty.skipFetch" value="true"/>
+ <antcall target="-build.rcp.internal"/>
+ </target>
+
+ <target name="-build.rcp.internal" unless="no.rcp.build">
+ <property prefix="buildSystemProperty." file="${buildHome}/build-files/build_rcp.properties"/>
+ <antcall target="-checkProductProperty"/>
+ <antcall target="-build.internal">
+ <param name="buildfile" value="${productbuildfile}"/>
+ </antcall>
+ </target>
+
+ <target name="-checkProductProperty">
+ <condition property="isProductSet">
+ <and>
+ <isset property="buildSystemProperty.product"/>
+ <not><equals arg1="${product}" arg2=""/></not>
+ </and>
+ </condition>
+ <fail message="Building an RCP application requires a Product Configuration file to be specified ('product' property)." unless="isProductSet"/>
+ </target>
+
+ <target name="rcp" depends="-properties,-clean,-prepare.build.host" description="Build RCP only">
+ <fail message="Please enable and configure an RCP build in the Plug-in Builder Editor before calling this target." if="no.rcp.build"/>
+ <antcall target="-build.rcp.internal"/>
+ </target>
+
+ <target name="-build.internal">
+ <property name="buildResultsDirectory" value="${buildDirectory}/results" />
+
+ <java classname="org.eclipse.equinox.launcher.Main" fork="true"
+ failonerror="true" errorproperty="build.stderr">
+ <arg value="-ws" />
+ <arg value="${ws}" />
+ <arg value="-os" />
+ <arg value="${os}" />
+ <arg value="-application" />
+ <arg value="org.eclipse.ant.core.antRunner" />
+ <arg value="-buildfile" />
+ <arg value="${buildfile}" />
+ <arg value="${buildTarget}" />
+ <arg value="-data" />
+ <arg value="${buildDirectory}/workspace" />
+ <arg value="${verboseAnt}"/>
+ <jvmarg value="-Dbasews=${ws}" />
+ <jvmarg value="-Dbaseos=${os}" />
+ <jvmarg value="-Dbasearch=${arch}" />
+ <jvmarg value="-Dbuilder=${buildHome}/build-files" />
+ <jvmarg value="-DjavacFailOnError=true"/>
+ <jvmarg value="-DbuildDirectory=${buildDirectory}"/>
+ <jvmarg value="-DbuildResultsDirectory=${buildResultsDirectory}"/>
+ <jvmarg value="-DbaseLocation=${eclipseDir}"/>
+ <jvmarg value="-DbuildHome=${buildHome}"/>
+ <jvmarg value="-Dversion.full=${version.full}"/>
+ <jvmarg value="-Dversion.qualifier=${version.qualifier}${buildTypePresentation}"/>
+ <jvmarg value="-DbuildType=${buildType}"/>
+ <jvmarg value="-DfetchTag=${fetchTag}"/>
+ <jvmarg value="-DbuildProperties=${buildHome}/build-files/build.properties"/>
+
+ <classpath>
+ <pathelement location="${equinoxjar}" />
+ </classpath>
+
+ <syspropertyset>
+ <propertyset>
+ <propertyref prefix="buildSystemProperty"/>
+ <mapper type="glob" from="buildSystemProperty.*" to="*"/>
+ </propertyset>
+ </syspropertyset>
+ </java>
+
+ <!-- save stderr for scrutinizing later -->
+ <echo file="${buildDirectory}/stderr.txt">${build.stderr}</echo>
+
+ <echo taskname="stderr">${build.stderr}</echo>
+
+ <condition property="is.build.error" value="true">
+ <contains string="${build.stderr}" substring="BUILD FAILED"/>
+ </condition>
+ <!-- Note that the fail task throws an exception which will be intercepted
+ from calling antcalls. During that processing the status will
+ be lost and set to 1. Therefor ethe processing of TESTS FAILED which should
+ return an exit status of 2 can only take place in main targets. -->
+ <fail message="PDE Build failed" if="is.build.error" status="1"/>
+
+ </target>
+
+ <target name="main-cc"
+ description="This target is suited to be run from cruisecontrol. The property 'label' is expected to be set from cruisecontrol.">
+ <!-- Note that pluginbuilder also provides an EclipseLabelIncrementer which creates Eclipse version labels.
+ see http://www.pluginbuilder.org/faq.html -->
+ <property name="version.full" value="${label}"/>
+ <SetRegex input="${label}" match=".+\..+\..+\.(.*)" property="version.qualifier" value="\1" />
+ <antcall target="-build"/>
+ </target>
+
+ <target name="main" description="Run the main target of customTargets.xml. Return status 0,1,2 for Success, Build Failure and Test Failure">
+ <property name="buildTarget" value="main"/>
+ <antcall target="-build"/>
+
+ <!-- this must be done in a top level target because otherwise the
+ status would not get throuhg. If fail is called somewhere within
+ an antcall the created exception will be caught which would result
+ in a return status of 1 -->
+ <loadfile srcFile="${buildDirectory}/stderr.txt" property="build.stderr"/>
+ <condition property="is.tests.failed" value="true">
+ <contains string="${build.stderr}" substring="TESTS FAILED"/>
+ </condition>
+ <fail message="Tests failed" if="is.tests.failed" status="2"/>
+ </target>
+
+ <target name="fetch" description="Run the fetch target of customTargets.xml.">
+ <property name="buildTarget" value="fetch"/>
+ <antcall target="-build"/>
+ </target>
+
+ <target name="generate" description="Run the generate target of customTargets.xml.">
+ <property name="buildTarget" value="generate"/>
+ <antcall target="-build"/>
+ </target>
+
+ <target name="process" description="Run the process target of customTargets.xml.">
+ <property name="buildTarget" value="process"/>
+ <antcall target="-build"/>
+ </target>
+
+ <target name="assemble" description="Run the assemble target of customTargets.xml.">
+ <property name="buildTarget" value="assemble"/>
+ <antcall target="-build"/>
+ </target>
+
+ <target name="postBuild" description="Run the postBuild target of customTargets.xml.">
+ <property name="buildTarget" value="postBuild"/>
+ <antcall target="-build"/>
+ <!-- see main for a description why this must take place here. It is very ugly -->
+ <loadfile srcFile="${buildDirectory}/stderr.txt" property="build.stderr"/>
+ <condition property="is.tests.failed" value="true">
+ <contains string="${build.stderr}" substring="TESTS FAILED"/>
+ </condition>
+ <fail message="Tests failed" if="is.tests.failed" status="2"/>
+ </target>
+
+ <target name="buildProperties" description="Print out derived properties for the current build." depends="-properties">
+ <fail message="You have to set the property 'buildPropertiesFile' if calling buildProperties" unless="buildPropertiesFile"/>
+ <condition property="subdir" value="nightly" else="releases">
+ <equals arg1="${buildType}" arg2="N"/>
+ </condition>
+ <echo file="${buildPropertiesFile}">relativeServerResultsDir: ${subdir}
version.full: ${version.full}
version.qualifier: ${version.qualifier}</echo>
- </target>
+ </target>
-</project>
\ No newline at end of file
+</project>
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_local.properties
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_local.properties?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_local.properties (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_local.properties Tue Feb 22 15:09:30 2011
@@ -38,4 +38,4 @@ ws=gtk
# Environment for both the Eclipse build and test host. Determines basearch.
# @category localsettings
-arch=x86
\ No newline at end of file
+arch=x86
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_shared.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_shared.xml?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_shared.xml (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.releng/build_shared.xml Tue Feb 22 15:09:30 2011
@@ -15,7 +15,7 @@
limitations under the License.
-->
<project name="Shared build targets">
- <!-- the following properties must be set from the calling script
+ <!-- the following properties must be set from the calling script
<property name="eclipse.installation.dir" value="${buildDirectory}"/>
<property name="eclipse.local.tar.non.server" value="${test.eclipse.zip}"/>
eclipse.download.cache,pluginbuilder.eclipse.url
@@ -23,110 +23,110 @@
<property name="pluginbuilder.additional.feature.urls" value="featureurl1,featureurl2"/>
-->
- <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildHome}/build-files/ant-contrib.jar" />
-
- <target name="unpack.eclipse">
- <condition property="unpack.eclipse">
- <not>
- <available type="dir" file="${eclipse.installation.dir}"/>
- </not>
- </condition>
- <antcall target="-unpack.eclipse.ifnecessary"/>
- </target>
-
- <!-- call either with or feature.url or pluginbuilder.eclipse.url
- sets property archive.location to the archive path in download cache.
- -->
- <target name="-set.archive.location" if="pluginbuilder.is.server">
- <!-- set default, useful for server where pluginbuilder.eclipse.url.default can be specified in build_local.properties -->
- <property name="pluginbuilder.eclipse.url" value="${pluginbuilder.eclipse.url.default}"/>
- <condition property="archive.url" value="${feature.url}" else="${pluginbuilder.eclipse.url}">
- <isset property="feature.url"/>
- </condition>
- <mkdir dir="${eclipse.download.cache}"/>
- <tempfile destdir="${eclipse.download.cache}" property="tmp.file" suffix=".txt" prefix="downloadurl"/>
- <echo file="${tmp.file}" message="${archive.url}"/>
- <checksum file="${tmp.file}" property="pluginbuilder.eclipse.url.checksum"/>
- <delete file="${tmp.file}"/>
- <property name="archive.location" value="${eclipse.download.cache}/${pluginbuilder.eclipse.url.checksum}"/>
- <!-- <echo message="${archive.location} is archive location for ${archive.url}"/> -->
- </target>
-
- <target name="-set.eclipse.local.tar.server" if="pluginbuilder.is.server" depends="-set.archive.location">
- <property name="eclipse.local.tar" value="${archive.location}"/>
- </target>
-
- <target name="-set.eclipse.local.tar.non.server" unless="pluginbuilder.is.server">
- <property name="eclipse.local.tar" value="${eclipse.local.tar.non.server}"/>
- </target>
-
- <target name="-get.archive.ifnecessary" unless="eclipse.is.downloaded">
- <condition property="archive.url" value="${feature.url}" else="${pluginbuilder.eclipse.url}">
- <isset property="feature.url"/>
- </condition>
- <get src="${archive.url}" dest="${archive.location}" />
- </target>
-
- <target name="-get.archive" depends="-set.archive.location" if="pluginbuilder.is.server">
- <condition property="eclipse.is.downloaded">
- <available file="${archive.location}" property="${eclipse.is.downloaded}"/>
- </condition>
- <antcall target="-get.archive.ifnecessary"/>
- </target>
-
- <target name="-get.features" if="pluginbuilder.is.server" >
- <property name="pluginbuilder.feature.urls" value="${pluginbuilder.feature.urls.default}"/>
- <foreach list="${pluginbuilder.feature.urls}" param="feature.url" delimiter="," target="-get.archive" inheritall="true"/>
- </target>
-
- <target name="-unpack.features" if="pluginbuilder.is.server">
- <property name="pluginbuilder.feature.urls" value="${pluginbuilder.feature.urls.default}"/>
- <foreach list="${pluginbuilder.feature.urls}" param="feature.url" delimiter="," target="-unpack.feature" inheritall="true"/>
- </target>
-
- <target name="-unpack.feature" depends="-set.archive.location">
- <property name="tempunziplocation" value="${buildDirectory}/tmpunzip"/>
- <delete dir="${tempunziplocation}" failonerror="false"/>
- <mkdir dir="${tempunziplocation}"/>
- <unzip src="${archive.location}" overwrite="true" dest="${tempunziplocation}"/>
- <condition property="moveroot" value="${tempunziplocation}/eclipse" else="${tempunziplocation}">
- <available file="${tempunziplocation}/eclipse" type="dir"/>
- </condition>
- <move todir="${eclipse.installation.dir}" includeemptydirs="true">
- <fileset dir="${moveroot}" includes="**"/>
- </move>
- </target>
-
- <target name="-unpack.eclipse.ifnecessary" if="unpack.eclipse">
- <antcall target="-get.archive"/>
- <condition property="is.windows">
- <os family="windows"/>
- </condition>
- <antcall target="-unpack.eclipse.windows"/>
- <antcall target="-unpack.eclipse.linux"/>
- <antcall target="-get.features"/>
- <antcall target="-unpack.features"/>
- </target>
-
- <target name="-unpack.eclipse.windows" if="is.windows" depends="-set.eclipse.local.tar.server,-set.eclipse.local.tar.non.server">
- <unzip src="${eclipse.local.tar}" overwrite="true" dest="${eclipse.installation.dir}/.."/>
- </target>
-
- <target name="-unpack.eclipse.linux" unless="is.windows" depends="-set.eclipse.local.tar.server,-set.eclipse.local.tar.non.server">
- <untar src="${eclipse.local.tar}" overwrite="true" dest="${eclipse.installation.dir}/.." compression="gzip"/>
- </target>
-
- <target name="test">
- <property name="buildDirectory" value="C:/Temp/tst"/>
- <mkdir dir="${buildDirectory}"/>
- <property name="eclipse.download.cache" value="C:/Temp/downloadcache"/>
- <property name="pluginbuilder.is.server" value="true"/>
- <property name="pluginbuilder.eclipse.url" value="http://mirror.yoxos-eclipse-distribution.de/eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/eclipse-PDE-3.2.2.zip"/>
-
- <property name="eclipse.installation.dir" value="C:/Temp/eclipse_root/eclipse"/>
- <delete dir="${eclipse.installation.dir}" failonerror="false"/>
- <property name="pluginbuilder.feature.urls" value="http://self.pluginbuilder.org/0.2.0/org.pluginbuilder.feature-0.2.0.20070218PRD.zip,http://mirror.yoxos-eclipse-distribution.de/eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/eclipse-examples-3.2.2.zip"/>
- <antcall target="unpack.eclipse"/>
- </target>
-
-</project>
\ No newline at end of file
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildHome}/build-files/ant-contrib.jar" />
+
+ <target name="unpack.eclipse">
+ <condition property="unpack.eclipse">
+ <not>
+ <available type="dir" file="${eclipse.installation.dir}"/>
+ </not>
+ </condition>
+ <antcall target="-unpack.eclipse.ifnecessary"/>
+ </target>
+
+ <!-- call either with or feature.url or pluginbuilder.eclipse.url
+ sets property archive.location to the archive path in download cache.
+ -->
+ <target name="-set.archive.location" if="pluginbuilder.is.server">
+ <!-- set default, useful for server where pluginbuilder.eclipse.url.default can be specified in build_local.properties -->
+ <property name="pluginbuilder.eclipse.url" value="${pluginbuilder.eclipse.url.default}"/>
+ <condition property="archive.url" value="${feature.url}" else="${pluginbuilder.eclipse.url}">
+ <isset property="feature.url"/>
+ </condition>
+ <mkdir dir="${eclipse.download.cache}"/>
+ <tempfile destdir="${eclipse.download.cache}" property="tmp.file" suffix=".txt" prefix="downloadurl"/>
+ <echo file="${tmp.file}" message="${archive.url}"/>
+ <checksum file="${tmp.file}" property="pluginbuilder.eclipse.url.checksum"/>
+ <delete file="${tmp.file}"/>
+ <property name="archive.location" value="${eclipse.download.cache}/${pluginbuilder.eclipse.url.checksum}"/>
+ <!-- <echo message="${archive.location} is archive location for ${archive.url}"/> -->
+ </target>
+
+ <target name="-set.eclipse.local.tar.server" if="pluginbuilder.is.server" depends="-set.archive.location">
+ <property name="eclipse.local.tar" value="${archive.location}"/>
+ </target>
+
+ <target name="-set.eclipse.local.tar.non.server" unless="pluginbuilder.is.server">
+ <property name="eclipse.local.tar" value="${eclipse.local.tar.non.server}"/>
+ </target>
+
+ <target name="-get.archive.ifnecessary" unless="eclipse.is.downloaded">
+ <condition property="archive.url" value="${feature.url}" else="${pluginbuilder.eclipse.url}">
+ <isset property="feature.url"/>
+ </condition>
+ <get src="${archive.url}" dest="${archive.location}" />
+ </target>
+
+ <target name="-get.archive" depends="-set.archive.location" if="pluginbuilder.is.server">
+ <condition property="eclipse.is.downloaded">
+ <available file="${archive.location}" property="${eclipse.is.downloaded}"/>
+ </condition>
+ <antcall target="-get.archive.ifnecessary"/>
+ </target>
+
+ <target name="-get.features" if="pluginbuilder.is.server" >
+ <property name="pluginbuilder.feature.urls" value="${pluginbuilder.feature.urls.default}"/>
+ <foreach list="${pluginbuilder.feature.urls}" param="feature.url" delimiter="," target="-get.archive" inheritall="true"/>
+ </target>
+
+ <target name="-unpack.features" if="pluginbuilder.is.server">
+ <property name="pluginbuilder.feature.urls" value="${pluginbuilder.feature.urls.default}"/>
+ <foreach list="${pluginbuilder.feature.urls}" param="feature.url" delimiter="," target="-unpack.feature" inheritall="true"/>
+ </target>
+
+ <target name="-unpack.feature" depends="-set.archive.location">
+ <property name="tempunziplocation" value="${buildDirectory}/tmpunzip"/>
+ <delete dir="${tempunziplocation}" failonerror="false"/>
+ <mkdir dir="${tempunziplocation}"/>
+ <unzip src="${archive.location}" overwrite="true" dest="${tempunziplocation}"/>
+ <condition property="moveroot" value="${tempunziplocation}/eclipse" else="${tempunziplocation}">
+ <available file="${tempunziplocation}/eclipse" type="dir"/>
+ </condition>
+ <move todir="${eclipse.installation.dir}" includeemptydirs="true">
+ <fileset dir="${moveroot}" includes="**"/>
+ </move>
+ </target>
+
+ <target name="-unpack.eclipse.ifnecessary" if="unpack.eclipse">
+ <antcall target="-get.archive"/>
+ <condition property="is.windows">
+ <os family="windows"/>
+ </condition>
+ <antcall target="-unpack.eclipse.windows"/>
+ <antcall target="-unpack.eclipse.linux"/>
+ <antcall target="-get.features"/>
+ <antcall target="-unpack.features"/>
+ </target>
+
+ <target name="-unpack.eclipse.windows" if="is.windows" depends="-set.eclipse.local.tar.server,-set.eclipse.local.tar.non.server">
+ <unzip src="${eclipse.local.tar}" overwrite="true" dest="${eclipse.installation.dir}/.."/>
+ </target>
+
+ <target name="-unpack.eclipse.linux" unless="is.windows" depends="-set.eclipse.local.tar.server,-set.eclipse.local.tar.non.server">
+ <untar src="${eclipse.local.tar}" overwrite="true" dest="${eclipse.installation.dir}/.." compression="gzip"/>
+ </target>
+
+ <target name="test">
+ <property name="buildDirectory" value="C:/Temp/tst"/>
+ <mkdir dir="${buildDirectory}"/>
+ <property name="eclipse.download.cache" value="C:/Temp/downloadcache"/>
+ <property name="pluginbuilder.is.server" value="true"/>
+ <property name="pluginbuilder.eclipse.url" value="http://mirror.yoxos-eclipse-distribution.de/eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/eclipse-PDE-3.2.2.zip"/>
+
+ <property name="eclipse.installation.dir" value="C:/Temp/eclipse_root/eclipse"/>
+ <delete dir="${eclipse.installation.dir}" failonerror="false"/>
+ <property name="pluginbuilder.feature.urls" value="http://self.pluginbuilder.org/0.2.0/org.pluginbuilder.feature-0.2.0.20070218PRD.zip,http://mirror.yoxos-eclipse-distribution.de/eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/eclipse-examples-3.2.2.zip"/>
+ <antcall target="unpack.eclipse"/>
+ </target>
+
+</project>
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/datas/simplejavaproject/module.ivy
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/datas/simplejavaproject/module.ivy?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/datas/simplejavaproject/module.ivy (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/datas/simplejavaproject/module.ivy Tue Feb 22 15:09:30 2011
@@ -15,10 +15,10 @@
limitations under the License.
-->
<ivy-module version="2.0" xmlns:ea="http://www.easyant.org">
- <info organisation="org.apache.easyant" module="simplejavaproject" status="integration" >
- <ea:build type="org.apache.easyant.buildtypes#build-std-java;0.2">
- <ea:property name="run.main.classname" value="org.apache.easyant.example.Example"/>
- <ea:plugin module="org.apache.easyant.plugins#run-java;0.1" as="run"/>
- </ea:build>
- </info>
+ <info organisation="org.apache.easyant" module="simplejavaproject" status="integration" >
+ <ea:build type="org.apache.easyant.buildtypes#build-std-java;0.2">
+ <ea:property name="run.main.classname" value="org.apache.easyant.example.Example"/>
+ <ea:plugin module="org.apache.easyant.plugins#run-java;0.1" as="run"/>
+ </ea:build>
+ </info>
</ivy-module>
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/AbstractEasyAntTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/AbstractEasyAntTest.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/AbstractEasyAntTest.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/AbstractEasyAntTest.java Tue Feb 22 15:09:30 2011
@@ -42,48 +42,48 @@ import org.junit.Before;
import com.google.inject.Inject;
public abstract class AbstractEasyAntTest {
- protected IProject testProject;
- protected IJavaProject testJavaProject;
-
- @Inject
- EasyantCoreService coreService;
-
- @Inject
- EasyantProjectService projectService;
-
- @Before
- public void setUp() throws Exception {
- EasyAntPlugin easyAntPlugin = Activator.getEasyAntPlugin();
- assertNotNull(easyAntPlugin);
- easyAntPlugin.injectMembers(this);
- assertNotNull(coreService);
- assertNotNull(projectService);
-
- //System.out.println("setUp");
- String testProjectName = "TestProject";
- this.testProject = EclipseProjectBuilder.createProject(testProjectName);
- assertNotNull(testProject);
- IFile testModuleDesc = EclipseProjectBuilder.createModuleDescriptorFile(testProject, "org.apache.easyant");
- assertNotNull(testModuleDesc);
- assertTrue(testModuleDesc.exists());
-
- String testJavaProjectName = "TestJavaProject";
- this.testJavaProject = EclipseProjectBuilder.createJavaProject(testJavaProjectName);
- assertNotNull(testProject);
- IFile testJavaModuleDesc = EclipseProjectBuilder.createModuleDescriptorFile(testJavaProject.getProject(), "org.apache.easyant");
- assertNotNull(testJavaModuleDesc);
- assertTrue(testJavaModuleDesc.exists());
- }
-
- @After
- public void tearDown() throws CoreException {
- if(this.testProject!=null){
- EclipseProjectBuilder.deleteProject(testProject);
- this.testProject = null;
- }
- if(this.testJavaProject!=null){
- EclipseProjectBuilder.deleteProject(testJavaProject.getProject());
- this.testJavaProject = null;
- }
- }
+ protected IProject testProject;
+ protected IJavaProject testJavaProject;
+
+ @Inject
+ EasyantCoreService coreService;
+
+ @Inject
+ EasyantProjectService projectService;
+
+ @Before
+ public void setUp() throws Exception {
+ EasyAntPlugin easyAntPlugin = Activator.getEasyAntPlugin();
+ assertNotNull(easyAntPlugin);
+ easyAntPlugin.injectMembers(this);
+ assertNotNull(coreService);
+ assertNotNull(projectService);
+
+ //System.out.println("setUp");
+ String testProjectName = "TestProject";
+ this.testProject = EclipseProjectBuilder.createProject(testProjectName);
+ assertNotNull(testProject);
+ IFile testModuleDesc = EclipseProjectBuilder.createModuleDescriptorFile(testProject, "org.apache.easyant");
+ assertNotNull(testModuleDesc);
+ assertTrue(testModuleDesc.exists());
+
+ String testJavaProjectName = "TestJavaProject";
+ this.testJavaProject = EclipseProjectBuilder.createJavaProject(testJavaProjectName);
+ assertNotNull(testProject);
+ IFile testJavaModuleDesc = EclipseProjectBuilder.createModuleDescriptorFile(testJavaProject.getProject(), "org.apache.easyant");
+ assertNotNull(testJavaModuleDesc);
+ assertTrue(testJavaModuleDesc.exists());
+ }
+
+ @After
+ public void tearDown() throws CoreException {
+ if(this.testProject!=null){
+ EclipseProjectBuilder.deleteProject(testProject);
+ this.testProject = null;
+ }
+ if(this.testJavaProject!=null){
+ EclipseProjectBuilder.deleteProject(testJavaProject.getProject());
+ this.testJavaProject = null;
+ }
+ }
}
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyAntAllTests.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyAntAllTests.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyAntAllTests.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyAntAllTests.java Tue Feb 22 15:09:30 2011
@@ -23,11 +23,11 @@ import org.junit.runners.Suite.SuiteClas
@RunWith(Suite.class)
@SuiteClasses(value = {
- ImportProjectTest.class,
- StartupTest.class,
- EasyantCoreServiceTest.class,
- EasyantProjectServiceTest.class
-
+ ImportProjectTest.class,
+ StartupTest.class,
+ EasyantCoreServiceTest.class,
+ EasyantProjectServiceTest.class
+
})
public class EasyAntAllTests {
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantCoreServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantCoreServiceTest.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantCoreServiceTest.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantCoreServiceTest.java Tue Feb 22 15:09:30 2011
@@ -32,46 +32,46 @@ import org.junit.Test;
public class EasyantCoreServiceTest extends AbstractEasyAntTest {
/*
- @Test
- public void testGetIvyInstance() {
- Ivy ivy = coreService.getIvyInstance(testProject);
- assertNotNull(ivy);
- }
+ @Test
+ public void testGetIvyInstance() {
+ Ivy ivy = coreService.getIvyInstance(testProject);
+ assertNotNull(ivy);
+ }
*/
- @Test
- public void testGetPluginsRepositoryPath() {
- String pluginsRepositoryPath = coreService.getPluginsRepositoryPath();
- assertNotNull(pluginsRepositoryPath);
- String pluginPath = System.getProperty("user.home") + "/.easyant/repository";
- assertEquals(pluginPath, pluginsRepositoryPath);
- }
-
- @Test
- public void testInstallPluginsRepository() {
- String pluginsRepositoryPath = coreService.getPluginsRepositoryPath();
- File pluginsRepositoryDir = new File(pluginsRepositoryPath);
- assertTrue(deleteDirectory(pluginsRepositoryDir));
- assertFalse(pluginsRepositoryDir.exists());
- coreService.installPluginsRepository();
- assertTrue(pluginsRepositoryDir.exists());
- }
-
- private boolean deleteDirectory(File path) {
- boolean resultat = true;
-
- if (path.exists()) {
- File[] files = path.listFiles();
- for (int i = 0; i < files.length; i++) {
- if (files[i].isDirectory()) {
- resultat &= deleteDirectory(files[i]);
- } else {
- resultat &= files[i].delete();
- }
- }
- }
- resultat &= path.delete();
- return (resultat);
- }
+ @Test
+ public void testGetPluginsRepositoryPath() {
+ String pluginsRepositoryPath = coreService.getPluginsRepositoryPath();
+ assertNotNull(pluginsRepositoryPath);
+ String pluginPath = System.getProperty("user.home") + "/.easyant/repository";
+ assertEquals(pluginPath, pluginsRepositoryPath);
+ }
+
+ @Test
+ public void testInstallPluginsRepository() {
+ String pluginsRepositoryPath = coreService.getPluginsRepositoryPath();
+ File pluginsRepositoryDir = new File(pluginsRepositoryPath);
+ assertTrue(deleteDirectory(pluginsRepositoryDir));
+ assertFalse(pluginsRepositoryDir.exists());
+ coreService.installPluginsRepository();
+ assertTrue(pluginsRepositoryDir.exists());
+ }
+
+ private boolean deleteDirectory(File path) {
+ boolean resultat = true;
+
+ if (path.exists()) {
+ File[] files = path.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ if (files[i].isDirectory()) {
+ resultat &= deleteDirectory(files[i]);
+ } else {
+ resultat &= files[i].delete();
+ }
+ }
+ }
+ resultat &= path.delete();
+ return (resultat);
+ }
}
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantProjectServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantProjectServiceTest.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantProjectServiceTest.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantProjectServiceTest.java Tue Feb 22 15:09:30 2011
@@ -34,83 +34,83 @@ import org.junit.Test;
public class EasyantProjectServiceTest extends AbstractEasyAntTest {
/*
- @Test
- public void testGetIvyInstance() {
- Ivy ivy = projectService.getIvyInstance(testProject);
- assertNotNull(ivy);
- }
+ @Test
+ public void testGetIvyInstance() {
+ Ivy ivy = projectService.getIvyInstance(testProject);
+ assertNotNull(ivy);
+ }
*/
-
- // @Test
- // public void testAddNature(){
- // assertFalse(projectService.hasEasyAntNature(testProject));
- // projectService.addNature(testProject);
- // assertTrue(projectService.hasEasyAntNature(testProject));
- // assertFalse(projectService.hasEasyAntBuilder(testProject));
- // }
- //
- // @Test
- // public void testRemoveNature(){
- // assertFalse(projectService.hasEasyAntNature(testProject));
- // projectService.addNature(testProject);
- // assertTrue(projectService.hasEasyAntNature(testProject));
- // assertFalse(projectService.hasEasyAntBuilder(testProject));
- // projectService.removeNature(testProject);
- // assertFalse(projectService.hasEasyAntNature(testProject));
- // assertFalse(projectService.hasEasyAntBuilder(testProject));
- // }
-
- @Test
- public void testAddNatureOnJavaProject() {
- IProject javaProject = testJavaProject.getProject();
- assertFalse(projectService.hasEasyAntNature(javaProject));
- assertFalse(projectService.hasEasyAntBuilder(javaProject));
- projectService.addNature(javaProject);
- assertTrue(projectService.hasEasyAntNature(javaProject));
- assertTrue(projectService.hasEasyAntBuilder(javaProject));
- // TODO check classpath and source folder
- }
-
- @Test
- public void testRemoveNatureOnJavaProject() {
- IProject javaProject = testJavaProject.getProject();
- assertFalse(projectService.hasEasyAntNature(javaProject));
- projectService.addNature(javaProject);
- assertTrue(projectService.hasEasyAntNature(javaProject));
- assertTrue(projectService.hasEasyAntBuilder(javaProject));
- projectService.removeNature(javaProject);
- assertFalse(projectService.hasEasyAntNature(javaProject));
- assertFalse(projectService.hasEasyAntBuilder(javaProject));
- // TODO check classpath and source folder
- }
-
- @Test
- public void testGetPhases() {
- IProject javaProject = testJavaProject.getProject();
- IFile ivyFile = javaProject.getFile("module.ivy");
- assertNotNull(ivyFile);
- List<PhaseReport> phases = projectService.getPhases(ivyFile);
- assertNotNull(phases);
- assertTrue("nb phases:" + phases.size(), phases.size() > 0);
- }
-
- @Test
- public void testGetTargets() {
- IProject javaProject = testJavaProject.getProject();
- IFile ivyFile = javaProject.getFile("module.ivy");
- assertNotNull(ivyFile);
- List<TargetReport> targets = projectService.getTargets(ivyFile);
- assertNotNull(targets);
- assertTrue("nb targets:" + targets.size(), targets.size() > 0);
- }
-
- @Test
- public void testRunBuild() {
- try {
- projectService.runBuild(testJavaProject.getProject(), "compile", EasyAntConstants.ANT_LOGLEVEL_DEBUG, null);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- }
+
+ // @Test
+ // public void testAddNature(){
+ // assertFalse(projectService.hasEasyAntNature(testProject));
+ // projectService.addNature(testProject);
+ // assertTrue(projectService.hasEasyAntNature(testProject));
+ // assertFalse(projectService.hasEasyAntBuilder(testProject));
+ // }
+ //
+ // @Test
+ // public void testRemoveNature(){
+ // assertFalse(projectService.hasEasyAntNature(testProject));
+ // projectService.addNature(testProject);
+ // assertTrue(projectService.hasEasyAntNature(testProject));
+ // assertFalse(projectService.hasEasyAntBuilder(testProject));
+ // projectService.removeNature(testProject);
+ // assertFalse(projectService.hasEasyAntNature(testProject));
+ // assertFalse(projectService.hasEasyAntBuilder(testProject));
+ // }
+
+ @Test
+ public void testAddNatureOnJavaProject() {
+ IProject javaProject = testJavaProject.getProject();
+ assertFalse(projectService.hasEasyAntNature(javaProject));
+ assertFalse(projectService.hasEasyAntBuilder(javaProject));
+ projectService.addNature(javaProject);
+ assertTrue(projectService.hasEasyAntNature(javaProject));
+ assertTrue(projectService.hasEasyAntBuilder(javaProject));
+ // TODO check classpath and source folder
+ }
+
+ @Test
+ public void testRemoveNatureOnJavaProject() {
+ IProject javaProject = testJavaProject.getProject();
+ assertFalse(projectService.hasEasyAntNature(javaProject));
+ projectService.addNature(javaProject);
+ assertTrue(projectService.hasEasyAntNature(javaProject));
+ assertTrue(projectService.hasEasyAntBuilder(javaProject));
+ projectService.removeNature(javaProject);
+ assertFalse(projectService.hasEasyAntNature(javaProject));
+ assertFalse(projectService.hasEasyAntBuilder(javaProject));
+ // TODO check classpath and source folder
+ }
+
+ @Test
+ public void testGetPhases() {
+ IProject javaProject = testJavaProject.getProject();
+ IFile ivyFile = javaProject.getFile("module.ivy");
+ assertNotNull(ivyFile);
+ List<PhaseReport> phases = projectService.getPhases(ivyFile);
+ assertNotNull(phases);
+ assertTrue("nb phases:" + phases.size(), phases.size() > 0);
+ }
+
+ @Test
+ public void testGetTargets() {
+ IProject javaProject = testJavaProject.getProject();
+ IFile ivyFile = javaProject.getFile("module.ivy");
+ assertNotNull(ivyFile);
+ List<TargetReport> targets = projectService.getTargets(ivyFile);
+ assertNotNull(targets);
+ assertTrue("nb targets:" + targets.size(), targets.size() > 0);
+ }
+
+ @Test
+ public void testRunBuild() {
+ try {
+ projectService.runBuild(testJavaProject.getProject(), "compile", EasyAntConstants.ANT_LOGLEVEL_DEBUG, null);
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
}
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EclipseProjectBuilder.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EclipseProjectBuilder.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EclipseProjectBuilder.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EclipseProjectBuilder.java Tue Feb 22 15:09:30 2011
@@ -43,206 +43,208 @@ import org.eclipse.jdt.launching.JavaRun
*/
public class EclipseProjectBuilder {
- // private IProject project;
- // private IJavaProject javaProject;
- // private IPackageFragmentRoot sourceFolder;
-
- public EclipseProjectBuilder() throws CoreException {
- // IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- // project = root.getProject("TestProject");
- // project.create(null);
- // project.open(null);
- // javaProject = JavaCore.create(project);
- //
- // IFolder binFolder = createBinFolder();
- //
- // setJavaNature();
- // javaProject.setRawClasspath(new IClasspathEntry[0], null);
- //
- // createOutputFolder(binFolder);
- // addSystemLibraries();
- }
-
- public static IProject createProject(String name) throws CoreException {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = root.getProject(name);
- project.create(null);
- project.open(null);
- return project;
- }
-
- public static IJavaProject createJavaProject(String name) throws CoreException {
- IProject project = createProject(name);
- IJavaProject javaProject = JavaCore.create(project);
- addJavaNature(project);
- javaProject.setRawClasspath(new IClasspathEntry[0], null);
- createOutputFolder(javaProject);
- addSystemLibraries(javaProject);
- return javaProject;
- }
-
- private static void addJavaNature(IProject project) throws CoreException {
- IProjectDescription description = project.getDescription();
- description.setNatureIds(new String[] { JavaCore.NATURE_ID });
- project.setDescription(description, null);
- }
-
- private static void createOutputFolder(IJavaProject javaProject) throws CoreException {
- IFolder binFolder = createBinFolder(javaProject.getProject());
- IPath outputLocation = binFolder.getFullPath();
- javaProject.setOutputLocation(outputLocation, null);
- }
-
- private static IFolder createBinFolder(IProject project) throws CoreException {
- IFolder binFolder = project.getFolder("bin");
- binFolder.create(false, true, null);
- return binFolder;
- }
-
- private static void addSystemLibraries(IJavaProject javaProject) throws JavaModelException {
- IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
- IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
- System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
- newEntries[oldEntries.length] = JavaRuntime.getDefaultJREContainerEntry();
- javaProject.setRawClasspath(newEntries, null);
- }
-
- public static IFile createModuleDescriptorFile(IProject project, String org) throws CoreException {
- IFile moduleDescFile = project.getFile("module.ivy");
- String content = ""
- + "<ivy-module version=\"2.0\" xmlns:ea=\"http://www.easyant.org\">"
- + " <info organisation=\"" + org + "\" module=\"" + project.getName() + "\" status=\"integration\" >"
- + " <description>project description</description>"
- + " <ea:build type=\"org.apache.easyant.buildtypes#build-std-java;0.2\" />"
- + " </info>"
- + "</ivy-module>";
- InputStream in = new ByteArrayInputStream(content.getBytes());
- moduleDescFile.create(in, true, null);
- return moduleDescFile;
- }
-
- public static void deleteProject(IProject project) throws CoreException {
- // waitForIndexer();
- deleteProject(project, true);
- }
-
- public static void deleteProject(IProject project, boolean deleteContent) throws CoreException {
- // waitForIndexer();
- project.delete(deleteContent, true, new NullProgressMonitor());
- }
-
- // public IJavaProject getJavaProject() {
- // return javaProject;
- // }
-
- // public void addJar(String plugin, String jar) throws
- // MalformedURLException,
- // IOException, JavaModelException {
- // Path result = findFileInPlugin(plugin, jar);
- // IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
- // IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length +
- // 1];
- // System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
- // newEntries[oldEntries.length] = JavaCore.newLibraryEntry(result, null,
- // null);
- // javaProject.setRawClasspath(newEntries, null);
- // }
- //
- // public IPackageFragment createPackage(String name) throws CoreException {
- // if (sourceFolder == null)
- // sourceFolder = createSourceFolder();
- // return sourceFolder.createPackageFragment(name, false, null);
- // }
- //
- // public IType createType(IPackageFragment pack, String cuName, String
- // source)
- // throws JavaModelException {
- // StringBuffer buf = new StringBuffer();
- // buf.append("package " + pack.getElementName() + ";\n");
- // buf.append("\n");
- // buf.append(source);
- // ICompilationUnit cu = pack.createCompilationUnit(cuName,
- // buf.toString(), false, null);
- // return cu.getTypes()[0];
- // }
- //
- // /**
- // * Wait for autobuild notification to occur, that is
- // * for the autbuild to finish.
- // */
- // public void waitForAutoBuild() {
- // boolean wasInterrupted = false;
- // do {
- // try {
- // Platform.getJobManager().join(
- // ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- // wasInterrupted = false;
- // } catch (OperationCanceledException e) {
- // throw (e);
- // } catch (InterruptedException e) {
- // wasInterrupted = true;
- // }
- // } while (wasInterrupted);
- // }
- //
- // public void dispose() throws CoreException {
- // waitForIndexer();
- // project.delete(true, true, null);
- // }
- //
-
- //
- // public IFolder createXmlFolder() throws CoreException {
- // IFolder xmlFolder = project.getFolder("xml");
- // if (!xmlFolder.exists()) {
- // xmlFolder.create(false, true, null);
- // }
- // return xmlFolder;
- // }
- //
-
- //
- // private IPackageFragmentRoot createSourceFolder() throws CoreException {
- // IFolder folder = project.getFolder("src");
- // folder.create(false, true, null);
- // IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
- //
- // IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
- // IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length +
- // 1];
- // System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
- // newEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());
- // javaProject.setRawClasspath(newEntries, null);
- // return root;
- // }
- //
-
- // private Path findFileInPlugin(String plugin, String file)
- // throws MalformedURLException, IOException {
- // IPluginRegistry registry = Platform.getPluginRegistry();
- // IPluginDescriptor descriptor = registry.getPluginDescriptor(plugin);
- // URL pluginURL = descriptor.getInstallURL();
- // URL jarURL = new URL(pluginURL, file);
- // URL localJarURL = Platform.asLocalURL(jarURL);
- // return new Path(localJarURL.getPath());
- // }
- //
- // private void waitForIndexer() throws JavaModelException {
- // new SearchEngine().searchAllTypeNames(ResourcesPlugin.getWorkspace(),
- // null, null, IJavaSearchConstants.EXACT_MATCH,
- // IJavaSearchConstants.CASE_SENSITIVE,
- // IJavaSearchConstants.CLASS, SearchEngine
- // .createJavaSearchScope(new IJavaElement[0]),
- // new ITypeNameRequestor() {
- // public void acceptClass(char[] packageName,
- // char[] simpleTypeName, char[][] enclosingTypeNames,
- // String path) {
- // }
- //
- // public void acceptInterface(char[] packageName,
- // char[] simpleTypeName, char[][] enclosingTypeNames,
- // String path) {
- // }
- // }, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
- // }
+ // private IProject project;
+ // private IJavaProject javaProject;
+ // private IPackageFragmentRoot sourceFolder;
+
+ public EclipseProjectBuilder() throws CoreException {
+ // IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ // project = root.getProject("TestProject");
+ // project.create(null);
+ // project.open(null);
+ // javaProject = JavaCore.create(project);
+ //
+ // IFolder binFolder = createBinFolder();
+ //
+ // setJavaNature();
+ // javaProject.setRawClasspath(new IClasspathEntry[0], null);
+ //
+ // createOutputFolder(binFolder);
+ // addSystemLibraries();
+ }
+
+ public static IProject createProject(String name) throws CoreException {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = root.getProject(name);
+ project.create(null);
+ project.open(null);
+ return project;
+ }
+
+ public static IJavaProject createJavaProject(String name) throws CoreException {
+ IProject project = createProject(name);
+ IJavaProject javaProject = JavaCore.create(project);
+ addJavaNature(project);
+ javaProject.setRawClasspath(new IClasspathEntry[0], null);
+ createOutputFolder(javaProject);
+ addSystemLibraries(javaProject);
+ return javaProject;
+ }
+
+ private static void addJavaNature(IProject project) throws CoreException {
+ IProjectDescription description = project.getDescription();
+ description.setNatureIds(new String[] { JavaCore.NATURE_ID });
+ project.setDescription(description, null);
+ }
+
+ private static void createOutputFolder(IJavaProject javaProject) throws CoreException {
+ IFolder binFolder = createBinFolder(javaProject.getProject());
+ IPath outputLocation = binFolder.getFullPath();
+ javaProject.setOutputLocation(outputLocation, null);
+ }
+
+ private static IFolder createBinFolder(IProject project) throws CoreException {
+ IFolder binFolder = project.getFolder("bin");
+ binFolder.create(false, true, null);
+ return binFolder;
+ }
+
+ private static void addSystemLibraries(IJavaProject javaProject) throws JavaModelException {
+ IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
+ IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
+ System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+ newEntries[oldEntries.length] = JavaRuntime.getDefaultJREContainerEntry();
+ javaProject.setRawClasspath(newEntries, null);
+ }
+
+ public static IFile createModuleDescriptorFile(IProject project, String org) throws CoreException {
+ IFile moduleDescFile = project.getFile("module.ivy");
+ String content = ""
+ + "<ivy-module version=\"2.0\" xmlns:ea=\"http://www.easyant.org\">"
+ + " <info organisation=\"" + org + "\" module=\"" + project.getName() + "\" status=\"integration\" >"
+ + " <description>project description</description>"
+ + " <ea:build type=\"org.apache.easyant.buildtypes#build-std-java;0.2\" />"
+ + " </info>"
+ + "</ivy-module>";
+ InputStream in = new ByteArrayInputStream(content.getBytes());
+ moduleDescFile.create(in, true, null);
+ return moduleDescFile;
+ }
+
+ public static void deleteProject(IProject project) throws CoreException {
+ // waitForIndexer();
+ deleteProject(project, true);
+ }
+
+ public static void deleteProject(IProject project, boolean deleteContent) throws CoreException {
+ // waitForIndexer();
+ project.delete(deleteContent, true, new NullProgressMonitor());
+ }
+
+ // public IJavaProject getJavaProject() {
+ // return javaProject;
+ // }
+
+ // public void addJar(String plugin, String jar) throws
+ // MalformedURLException,
+ // IOException, JavaModelException {
+ // Path result = findFileInPlugin(plugin, jar);
+ // IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
+ // IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length +
+ // 1];
+ // System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+ // newEntries[oldEntries.length] = JavaCore.newLibraryEntry(result, null,
+ // null);
+ // javaProject.setRawClasspath(newEntries, null);
+ // }
+ //
+ // public IPackageFragment createPackage(String name) throws CoreException {
+ // if (sourceFolder == null)
+ // sourceFolder = createSourceFolder();
+ // return sourceFolder.createPackageFragment(name, false, null);
+ // }
+ //
+ // public IType createType(IPackageFragment pack, String cuName, String
+ // source)
+ // throws JavaModelException {
+ // StringBuffer buf = new StringBuffer();
+ // buf.append("package " + pack.getElementName() + ";
+");
+ // buf.append("
+");
+ // buf.append(source);
+ // ICompilationUnit cu = pack.createCompilationUnit(cuName,
+ // buf.toString(), false, null);
+ // return cu.getTypes()[0];
+ // }
+ //
+ // /**
+ // * Wait for autobuild notification to occur, that is
+ // * for the autbuild to finish.
+ // */
+ // public void waitForAutoBuild() {
+ // boolean wasInterrupted = false;
+ // do {
+ // try {
+ // Platform.getJobManager().join(
+ // ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ // wasInterrupted = false;
+ // } catch (OperationCanceledException e) {
+ // throw (e);
+ // } catch (InterruptedException e) {
+ // wasInterrupted = true;
+ // }
+ // } while (wasInterrupted);
+ // }
+ //
+ // public void dispose() throws CoreException {
+ // waitForIndexer();
+ // project.delete(true, true, null);
+ // }
+ //
+
+ //
+ // public IFolder createXmlFolder() throws CoreException {
+ // IFolder xmlFolder = project.getFolder("xml");
+ // if (!xmlFolder.exists()) {
+ // xmlFolder.create(false, true, null);
+ // }
+ // return xmlFolder;
+ // }
+ //
+
+ //
+ // private IPackageFragmentRoot createSourceFolder() throws CoreException {
+ // IFolder folder = project.getFolder("src");
+ // folder.create(false, true, null);
+ // IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(folder);
+ //
+ // IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
+ // IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length +
+ // 1];
+ // System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+ // newEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());
+ // javaProject.setRawClasspath(newEntries, null);
+ // return root;
+ // }
+ //
+
+ // private Path findFileInPlugin(String plugin, String file)
+ // throws MalformedURLException, IOException {
+ // IPluginRegistry registry = Platform.getPluginRegistry();
+ // IPluginDescriptor descriptor = registry.getPluginDescriptor(plugin);
+ // URL pluginURL = descriptor.getInstallURL();
+ // URL jarURL = new URL(pluginURL, file);
+ // URL localJarURL = Platform.asLocalURL(jarURL);
+ // return new Path(localJarURL.getPath());
+ // }
+ //
+ // private void waitForIndexer() throws JavaModelException {
+ // new SearchEngine().searchAllTypeNames(ResourcesPlugin.getWorkspace(),
+ // null, null, IJavaSearchConstants.EXACT_MATCH,
+ // IJavaSearchConstants.CASE_SENSITIVE,
+ // IJavaSearchConstants.CLASS, SearchEngine
+ // .createJavaSearchScope(new IJavaElement[0]),
+ // new ITypeNameRequestor() {
+ // public void acceptClass(char[] packageName,
+ // char[] simpleTypeName, char[][] enclosingTypeNames,
+ // String path) {
+ // }
+ //
+ // public void acceptInterface(char[] packageName,
+ // char[] simpleTypeName, char[][] enclosingTypeNames,
+ // String path) {
+ // }
+ // }, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
+ // }
}
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ExtensionRegistryTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ExtensionRegistryTest.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ExtensionRegistryTest.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ExtensionRegistryTest.java Tue Feb 22 15:09:30 2011
@@ -31,50 +31,50 @@ import org.junit.Test;
public class ExtensionRegistryTest {
- @Test
- public void testRemoveExtension() {
- IExtensionRegistry reg = RegistryFactory.getRegistry();
-
- //assertNull(reg.getExtension("org.apache.ivyde.eclipse.ui.actions.ResolveAction"));
- //assertNull(reg.getExtension("org.eclipse.ui.popupMenus","org.apache.ivyde.eclipse.ui.actions.ResolveAction"));
- //assertNull(reg.getExtension("org.eclipse.ui","popupMenus","org.apache.ivyde.eclipse.ui.actions.ResolveAction"));
+ @Test
+ public void testRemoveExtension() {
+ IExtensionRegistry reg = RegistryFactory.getRegistry();
+
+ //assertNull(reg.getExtension("org.apache.ivyde.eclipse.ui.actions.ResolveAction"));
+ //assertNull(reg.getExtension("org.eclipse.ui.popupMenus","org.apache.ivyde.eclipse.ui.actions.ResolveAction"));
+ //assertNull(reg.getExtension("org.eclipse.ui","popupMenus","org.apache.ivyde.eclipse.ui.actions.ResolveAction"));
- IDynamicExtensionRegistry reg2 = (IDynamicExtensionRegistry)reg;
- for(IContributor contributor : reg2.getAllContributors()){
- if("org.apache.ivyde.eclipse".equals(contributor.getName())){
- System.out.println("--> contributor "+contributor);
- reg2.removeContributor(contributor, ((ExtensionRegistry) reg2).getTemporaryUserToken());
- System.out.println("--> remove all extensions ");
- }
- }
-
-// IExtension[] extensions = reg.getExtensions("org.apache.ivyde.eclipse");
-// assertNotNull(extensions);
-// for(IExtension extension:extensions){
-// if("org.eclipse.ui.popupMenus".equals(extension.getExtensionPointUniqueIdentifier())){
-// reg.removeExtension(extension, ((ExtensionRegistry) reg).getTemporaryUserToken());
-// }
-// System.out.println(extension.getNamespaceIdentifier() +" - "+extension.getExtensionPointUniqueIdentifier());
-// final IConfigurationElement[] configElements = extension.getConfigurationElements();
-// for (IConfigurationElement element:configElements) {
-// System.out.println("\t--> "+element.getName()+" : "+element.getAttribute("id"));
-// }
-// }
-
-
- }
+ IDynamicExtensionRegistry reg2 = (IDynamicExtensionRegistry)reg;
+ for(IContributor contributor : reg2.getAllContributors()){
+ if("org.apache.ivyde.eclipse".equals(contributor.getName())){
+ System.out.println("--> contributor "+contributor);
+ reg2.removeContributor(contributor, ((ExtensionRegistry) reg2).getTemporaryUserToken());
+ System.out.println("--> remove all extensions ");
+ }
+ }
+
+// IExtension[] extensions = reg.getExtensions("org.apache.ivyde.eclipse");
+// assertNotNull(extensions);
+// for(IExtension extension:extensions){
+// if("org.eclipse.ui.popupMenus".equals(extension.getExtensionPointUniqueIdentifier())){
+// reg.removeExtension(extension, ((ExtensionRegistry) reg).getTemporaryUserToken());
+// }
+// System.out.println(extension.getNamespaceIdentifier() +" - "+extension.getExtensionPointUniqueIdentifier());
+// final IConfigurationElement[] configElements = extension.getConfigurationElements();
+// for (IConfigurationElement element:configElements) {
+// System.out.println("\t--> "+element.getName()+" : "+element.getAttribute("id"));
+// }
+// }
+
+
+ }
-// private void removeExtension(String extensionPointId, String extensionId) {
-// IExtensionRegistry reg = RegistryFactory.getRegistry();
-// IExtension extension = reg.getExtension(extensionPointId, extensionId);
-// if (extension != null) {
-// reg.removeExtension(extension, getUserToken());
-// }
-// }
+// private void removeExtension(String extensionPointId, String extensionId) {
+// IExtensionRegistry reg = RegistryFactory.getRegistry();
+// IExtension extension = reg.getExtension(extensionPointId, extensionId);
+// if (extension != null) {
+// reg.removeExtension(extension, getUserToken());
+// }
+// }
//
-// private Object getUserToken() {
-// IExtensionRegistry registry = RegistryFactory.getRegistry();
-// // return null; // require -Declipse.registry.nulltoken=true
-// return ((ExtensionRegistry) registry).getTemporaryUserToken();
-// }
+// private Object getUserToken() {
+// IExtensionRegistry registry = RegistryFactory.getRegistry();
+// // return null; // require -Declipse.registry.nulltoken=true
+// return ((ExtensionRegistry) registry).getTemporaryUserToken();
+// }
}
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ImportProjectTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ImportProjectTest.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ImportProjectTest.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ImportProjectTest.java Tue Feb 22 15:09:30 2011
@@ -56,104 +56,104 @@ import org.junit.Test;
import com.google.inject.Inject;
public class ImportProjectTest{
- @Inject
- EasyantProjectService projectService;
-
- @Before
- public void setUp() throws Exception {
- EasyAntPlugin easyAntPlugin = Activator.getEasyAntPlugin();
- assertNotNull(easyAntPlugin);
- easyAntPlugin.injectMembers(this);
- assertNotNull(projectService);
- }
-
- IProject simpleJavaProject;
- @Test
- public void testImportSimpleProject() throws Exception {
- final String projectName = "simplejavaproject";
- IProjectDescription description = Activator.getEasyAntPlugin().getPluginWorkspace().newProjectDescription(projectName);
- assertNotNull(description);
- URL url = getClass().getResource("/datas/"+projectName);
- assertNotNull(url);
- String filePath = url.getFile();
- assertNotNull(filePath);
- //String testWorkspacePath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
-
- IPath projectLocation = getSimpleJavaProjectLocation(filePath);
- assertNotNull(projectLocation);
- description.setLocation(projectLocation);
- final String comment = projectName+ " description";
- description.setComment(comment);
- String[] newNatures= {};
- description.setNatureIds(newNatures);
-
- Thread.sleep(2000);
- Shell messageShell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
- assertNotNull(messageShell);
- simpleJavaProject = projectService.importProject(description, messageShell, new NullProgressMonitor());
- assertNotNull(simpleJavaProject);
- assertTrue(simpleJavaProject.exists());
- assertTrue(simpleJavaProject.isOpen());
- assertEquals(projectName, simpleJavaProject.getName());
- try {
- assertEquals(comment, simpleJavaProject.getDescription().getComment());
- } catch (CoreException e) {
- fail(e.getMessage());
- }
- assertTrue(projectService.hasEasyAntNature(simpleJavaProject));
-
- //Assert source folders
- assertTrue(simpleJavaProject.hasNature(JavaCore.NATURE_ID));
- IJavaProject javaProject = (IJavaProject)simpleJavaProject.getNature(JavaCore.NATURE_ID);
- assertNotNull(javaProject);
- List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
- entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
- assertTrue(entries.size()>0);
- boolean srcMainJavaSourceFolderFound=false;
- boolean srcTestJavaSourceFolderFound=false;
- boolean srcMainResourcesSourceFolderFound=false;
- boolean srcTestResourcesSourceFolderFound=false;
- for(IClasspathEntry entry:entries){
- if(IClasspathEntry.CPE_SOURCE==entry.getEntryKind()){
- String path = entry.getPath().toOSString();
- assertNotNull(path);
- if("/simplejavaproject/src/main/java".equals(path)){
- srcMainJavaSourceFolderFound=true;
- }else if("/simplejavaproject/src/test/java".equals(path)){
- srcTestJavaSourceFolderFound=true;
- }else if("/simplejavaproject/src/main/resources".equals(path)){
- srcMainResourcesSourceFolderFound=true;
- }else if("/simplejavaproject/src/test/resources".equals(path)){
- srcTestResourcesSourceFolderFound=true;
- }
- }
- }
- assertTrue(srcMainJavaSourceFolderFound);
- assertTrue(srcTestJavaSourceFolderFound);
- assertTrue(srcMainResourcesSourceFolderFound);
- assertTrue(srcTestResourcesSourceFolderFound);
-
- //TODO assert classpath
- //org.eclipse.jdt.launching.JRE_CONTAINER
- //org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/module.ivy/*
- }
-
- private IPath getSimpleJavaProjectLocation(String projectPath){
- IPluginModelBase model = PluginRegistry.findModel(TestPlugin.PLUGIN_ID);
- assertNotNull(model);
- IPath projectLocation=null;
- if (model != null && model.getInstallLocation() != null) {
- File modelNode = new File(model.getInstallLocation());
- String pluginPath = modelNode.getAbsolutePath();
- projectLocation = new Path(pluginPath + "/" + projectPath);
- }
- return projectLocation;
- }
+ @Inject
+ EasyantProjectService projectService;
+
+ @Before
+ public void setUp() throws Exception {
+ EasyAntPlugin easyAntPlugin = Activator.getEasyAntPlugin();
+ assertNotNull(easyAntPlugin);
+ easyAntPlugin.injectMembers(this);
+ assertNotNull(projectService);
+ }
+
+ IProject simpleJavaProject;
+ @Test
+ public void testImportSimpleProject() throws Exception {
+ final String projectName = "simplejavaproject";
+ IProjectDescription description = Activator.getEasyAntPlugin().getPluginWorkspace().newProjectDescription(projectName);
+ assertNotNull(description);
+ URL url = getClass().getResource("/datas/"+projectName);
+ assertNotNull(url);
+ String filePath = url.getFile();
+ assertNotNull(filePath);
+ //String testWorkspacePath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
+
+ IPath projectLocation = getSimpleJavaProjectLocation(filePath);
+ assertNotNull(projectLocation);
+ description.setLocation(projectLocation);
+ final String comment = projectName+ " description";
+ description.setComment(comment);
+ String[] newNatures= {};
+ description.setNatureIds(newNatures);
+
+ Thread.sleep(2000);
+ Shell messageShell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ assertNotNull(messageShell);
+ simpleJavaProject = projectService.importProject(description, messageShell, new NullProgressMonitor());
+ assertNotNull(simpleJavaProject);
+ assertTrue(simpleJavaProject.exists());
+ assertTrue(simpleJavaProject.isOpen());
+ assertEquals(projectName, simpleJavaProject.getName());
+ try {
+ assertEquals(comment, simpleJavaProject.getDescription().getComment());
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ assertTrue(projectService.hasEasyAntNature(simpleJavaProject));
+
+ //Assert source folders
+ assertTrue(simpleJavaProject.hasNature(JavaCore.NATURE_ID));
+ IJavaProject javaProject = (IJavaProject)simpleJavaProject.getNature(JavaCore.NATURE_ID);
+ assertNotNull(javaProject);
+ List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
+ entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
+ assertTrue(entries.size()>0);
+ boolean srcMainJavaSourceFolderFound=false;
+ boolean srcTestJavaSourceFolderFound=false;
+ boolean srcMainResourcesSourceFolderFound=false;
+ boolean srcTestResourcesSourceFolderFound=false;
+ for(IClasspathEntry entry:entries){
+ if(IClasspathEntry.CPE_SOURCE==entry.getEntryKind()){
+ String path = entry.getPath().toOSString();
+ assertNotNull(path);
+ if("/simplejavaproject/src/main/java".equals(path)){
+ srcMainJavaSourceFolderFound=true;
+ }else if("/simplejavaproject/src/test/java".equals(path)){
+ srcTestJavaSourceFolderFound=true;
+ }else if("/simplejavaproject/src/main/resources".equals(path)){
+ srcMainResourcesSourceFolderFound=true;
+ }else if("/simplejavaproject/src/test/resources".equals(path)){
+ srcTestResourcesSourceFolderFound=true;
+ }
+ }
+ }
+ assertTrue(srcMainJavaSourceFolderFound);
+ assertTrue(srcTestJavaSourceFolderFound);
+ assertTrue(srcMainResourcesSourceFolderFound);
+ assertTrue(srcTestResourcesSourceFolderFound);
+
+ //TODO assert classpath
+ //org.eclipse.jdt.launching.JRE_CONTAINER
+ //org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/module.ivy/*
+ }
+
+ private IPath getSimpleJavaProjectLocation(String projectPath){
+ IPluginModelBase model = PluginRegistry.findModel(TestPlugin.PLUGIN_ID);
+ assertNotNull(model);
+ IPath projectLocation=null;
+ if (model != null && model.getInstallLocation() != null) {
+ File modelNode = new File(model.getInstallLocation());
+ String pluginPath = modelNode.getAbsolutePath();
+ projectLocation = new Path(pluginPath + "/" + projectPath);
+ }
+ return projectLocation;
+ }
- @After
- public void tearDown() throws CoreException {
- if(simpleJavaProject!=null){
- EclipseProjectBuilder.deleteProject(simpleJavaProject,false);
- }
- }
+ @After
+ public void tearDown() throws CoreException {
+ if(simpleJavaProject!=null){
+ EclipseProjectBuilder.deleteProject(simpleJavaProject,false);
+ }
+ }
}
Modified: incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/StartupTest.java
URL: http://svn.apache.org/viewvc/incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/StartupTest.java?rev=1073358&r1=1073357&r2=1073358&view=diff
==============================================================================
--- incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/StartupTest.java (original)
+++ incubator/easyant/easyant4e/trunk/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/StartupTest.java Tue Feb 22 15:09:30 2011
@@ -30,48 +30,48 @@ import org.eclipse.ui.views.navigator.Re
import org.junit.Test;
public class StartupTest extends AbstractEasyAntTest{
-
- @Test
- public void testActivatorStartup() {
- EasyAntPlugin easyAntPlugin = Activator.getEasyAntPlugin();
- assertNotNull(easyAntPlugin);
- }
+
+ @Test
+ public void testActivatorStartup() {
+ EasyAntPlugin easyAntPlugin = Activator.getEasyAntPlugin();
+ assertNotNull(easyAntPlugin);
+ }
- @Test
- public void testEasyAntCoreServiceInit() {
- assertNotNull(coreService);
- }
-
- @Test
- public void testEasyAntProjectServiceInit() {
- assertNotNull(projectService);
- }
-
- @Test
- public void testGetCurrentProject() {
- ResourceNavigator resourceNavigator = getResourceNavigator();
- assertNotNull(resourceNavigator);
-
- resourceNavigator.selectReveal(new StructuredSelection(testProject));
- IProject project1 = Activator.getEasyAntPlugin().getCurrentProject();
- assertNotNull(project1);
- assertEquals(testProject, project1);
-
- resourceNavigator.selectReveal(new StructuredSelection(testJavaProject));
- IProject project2 = Activator.getEasyAntPlugin().getCurrentProject();
- assertNotNull(project2);
- assertEquals(testJavaProject.getProject(), project2);
- }
-
- private ResourceNavigator getResourceNavigator(){
- ResourceNavigator navigator = null;
- try {
- navigator = (ResourceNavigator) PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.views.ResourceNavigator");
- } catch (PartInitException e) {
- throw new RuntimeException(e);
- }
- return navigator;
- }
-
+ @Test
+ public void testEasyAntCoreServiceInit() {
+ assertNotNull(coreService);
+ }
+
+ @Test
+ public void testEasyAntProjectServiceInit() {
+ assertNotNull(projectService);
+ }
+
+ @Test
+ public void testGetCurrentProject() {
+ ResourceNavigator resourceNavigator = getResourceNavigator();
+ assertNotNull(resourceNavigator);
+
+ resourceNavigator.selectReveal(new StructuredSelection(testProject));
+ IProject project1 = Activator.getEasyAntPlugin().getCurrentProject();
+ assertNotNull(project1);
+ assertEquals(testProject, project1);
+
+ resourceNavigator.selectReveal(new StructuredSelection(testJavaProject));
+ IProject project2 = Activator.getEasyAntPlugin().getCurrentProject();
+ assertNotNull(project2);
+ assertEquals(testJavaProject.getProject(), project2);
+ }
+
+ private ResourceNavigator getResourceNavigator(){
+ ResourceNavigator navigator = null;
+ try {
+ navigator = (ResourceNavigator) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.views.ResourceNavigator");
+ } catch (PartInitException e) {
+ throw new RuntimeException(e);
+ }
+ return navigator;
+ }
+
}