initial import of easyant4e
git-svn-id: https://svn.apache.org/repos/asf/incubator/easyant/easyant4e/trunk@1071768 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.easyant/.classpath b/org.apache.easyant/.classpath
new file mode 100644
index 0000000..60e8dce
--- /dev/null
+++ b/org.apache.easyant/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/ant-launcher.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/ivy.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/ant.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/easyant-core.jar" sourcepath="/home/jerome/tools/easyant/easyant.git/src/main/java"/>
+ <classpathentry exported="true" kind="lib" path="lib/jdtCompilerAdapter.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.apache.easyant/.project b/org.apache.easyant/.project
new file mode 100644
index 0000000..7f0d6aa
--- /dev/null
+++ b/org.apache.easyant/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.easyant</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.apache.easyant/META-INF/MANIFEST.MF b/org.apache.easyant/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..fc2146a
--- /dev/null
+++ b/org.apache.easyant/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Easyant Core
+Bundle-SymbolicName: org.apache.easyant
+Bundle-Version: 0.6.0.qualifier
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: lib/ant.jar,
+ lib/ant-launcher.jar,
+ lib/easyant-core.jar,
+ lib/jdtCompilerAdapter.jar,
+ lib/ivy.jar,
+ .
+Export-Package: org.apache.easyant.core,
+ org.apache.easyant.core.ant,
+ org.apache.easyant.core.descriptor,
+ org.apache.easyant.core.factory,
+ org.apache.easyant.core.parser,
+ org.apache.easyant.core.report,
+ org.apache.easyant.core.services,
+ org.apache.easyant.core.services.impl,
+ org.apache.easyant.tasks
+Require-Bundle: org.eclipse.osgi,
+ org.eclipse.jdt.launching,
+ org.eclipse.jdt.core
diff --git a/org.apache.easyant/build.properties b/org.apache.easyant/build.properties
new file mode 100644
index 0000000..775e87c
--- /dev/null
+++ b/org.apache.easyant/build.properties
@@ -0,0 +1,8 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ lib/ant.jar,\
+ lib/easyant-core.jar,\
+ lib/jdtCompilerAdapter.jar,\
+ lib/ivy.jar,\
+ lib/ant-launcher.jar
diff --git a/org.apache.easyant/lib/ant-launcher.jar b/org.apache.easyant/lib/ant-launcher.jar
new file mode 100644
index 0000000..06548a3
--- /dev/null
+++ b/org.apache.easyant/lib/ant-launcher.jar
Binary files differ
diff --git a/org.apache.easyant/lib/ant.jar b/org.apache.easyant/lib/ant.jar
new file mode 100644
index 0000000..aaa605c
--- /dev/null
+++ b/org.apache.easyant/lib/ant.jar
Binary files differ
diff --git a/org.apache.easyant/lib/easyant-core.jar b/org.apache.easyant/lib/easyant-core.jar
new file mode 100644
index 0000000..4b7ab19
--- /dev/null
+++ b/org.apache.easyant/lib/easyant-core.jar
Binary files differ
diff --git a/org.apache.easyant/lib/ivy.jar b/org.apache.easyant/lib/ivy.jar
new file mode 100644
index 0000000..9723963
--- /dev/null
+++ b/org.apache.easyant/lib/ivy.jar
Binary files differ
diff --git a/org.apache.easyant/lib/jdtCompilerAdapter.jar b/org.apache.easyant/lib/jdtCompilerAdapter.jar
new file mode 100644
index 0000000..17c7152
--- /dev/null
+++ b/org.apache.easyant/lib/jdtCompilerAdapter.jar
Binary files differ
diff --git a/org.apache.easyant/lib/readme.txt b/org.apache.easyant/lib/readme.txt
new file mode 100644
index 0000000..9775771
--- /dev/null
+++ b/org.apache.easyant/lib/readme.txt
@@ -0,0 +1,2 @@
+all jars is used to bootstrap easyant-core and resolved internal plugins dependencies.
+The ivy.jar is the dedicated version for easyant-core
\ No newline at end of file
diff --git a/org.apache.easyant4e.feature/.project b/org.apache.easyant4e.feature/.project
new file mode 100644
index 0000000..476e2a8
--- /dev/null
+++ b/org.apache.easyant4e.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.easyant4e.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.apache.easyant4e.feature/build.properties b/org.apache.easyant4e.feature/build.properties
new file mode 100644
index 0000000..64f93a9
--- /dev/null
+++ b/org.apache.easyant4e.feature/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/org.apache.easyant4e.feature/feature.xml b/org.apache.easyant4e.feature/feature.xml
new file mode 100644
index 0000000..95aee7e
--- /dev/null
+++ b/org.apache.easyant4e.feature/feature.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.apache.easyant4e.feature"
+ label="EasyAnt for Eclipse"
+ version="1.0.0.qualifier"
+ provider-name="EasyAnt.Org">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <includes
+ id="org.apache.ivyde.feature"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.apache.easyant4e"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.easyant"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/org.apache.easyant4e.releng/.project b/org.apache.easyant4e.releng/.project
new file mode 100644
index 0000000..e0f44de
--- /dev/null
+++ b/org.apache.easyant4e.releng/.project
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.easyant4e.releng</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ <nature>org.pluginbuilder.core.pluginBuilderNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.apache.easyant4e.releng/build-files/allElements.xml b/org.apache.easyant4e.releng/build-files/allElements.xml
new file mode 100644
index 0000000..245038f
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/allElements.xml
@@ -0,0 +1,87 @@
+<project name="allElements delegation and assemble customTargets.xml">
+<!-- FILE WILL BE OVERWRITTEN WHEN GENERATED -->
+ <target name="allElementsExceptSvnFetch" unless="is.svn.fetch">
+ <antcall target="norcpbuild"/>
+ <antcall target="rcpbuild"/>
+ </target>
+
+ <target name="norcpbuild" unless="build.container.feature">
+ <ant antfile="${genericTargets}" target="${target}">
+ <property name="type" value="feature" />
+ <property name="id" value="org.apache.easyant4e.feature" />
+ </ant>
+
+ </target>
+
+ <target name="rcpbuild" if="build.container.feature">
+ <ant antfile="${genericTargets}" target="${target}">
+ <property name="type" value="feature" />
+ <property name="id" value="org.eclipse.pde.build.container.feature" />
+ </ant>
+ </target>
+
+ <!-- generated assemble targets -->
+ <target name="assemble.org.apache.easyant4e.feature">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="zipargs" value="" />
+ </ant>
+ </target>
+
+
+ <!-- assmble targets for RCP build -->
+ <target name="assemble.org.eclipse.pde.build.container.feature.win32.win32.x86">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-win32.win32.x86.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.linux.gtk.x86">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-linux.gtk.x86.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.linux.gtk.ppc">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-linux.gtk.ppc.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.linux.gtk.x86_64">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-linux.gtk.x86_64.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.linux.motif.x86">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-linux.motif.x86.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.solaris.motif.sparc">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-solaris.motif.sparc.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.solaris.gtk.sparc">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-solaris.gtk.sparc.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.aix.motif.ppc">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-aix.motif.ppc.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.hpux.motif.PA_RISC">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-hpux.motif.PA_RISC.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.macosx.carbon.ppc">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-macosx.carbon.ppc.zip"/>
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.pde.build.container.feature.macosx.carbon.x86">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="archiveName" value="${archiveNamePrefix}-macosx.carbon.x86.zip"/>
+ </ant>
+ </target>
+</project>
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/ant-contrib-LICENSE.txt b/org.apache.easyant4e.releng/build-files/ant-contrib-LICENSE.txt
new file mode 100644
index 0000000..4d8c2fb
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/ant-contrib-LICENSE.txt
@@ -0,0 +1,47 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001-2003 Ant-Contrib project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Ant-Contrib project (http://sourceforge.net/projects/ant-contrib)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The name Ant-Contrib must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
+ * written permission, please contact
+ * ant-contrib-developers@lists.sourceforge.net.
+ *
+ * 5. Products derived from this software may not be called "Ant-Contrib"
+ * nor may "Ant-Contrib" appear in their names without prior written
+ * permission of the Ant-Contrib project.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE ANT-CONTRIB PROJECT OR ITS
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
diff --git a/org.apache.easyant4e.releng/build-files/ant-contrib.jar b/org.apache.easyant4e.releng/build-files/ant-contrib.jar
new file mode 100644
index 0000000..ea817cd
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/ant-contrib.jar
Binary files differ
diff --git a/org.apache.easyant4e.releng/build-files/automatedTests/eclipse-test-framework-3.4.1.zip b/org.apache.easyant4e.releng/build-files/automatedTests/eclipse-test-framework-3.4.1.zip
new file mode 100644
index 0000000..a6434a0
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/automatedTests/eclipse-test-framework-3.4.1.zip
Binary files differ
diff --git a/org.apache.easyant4e.releng/build-files/automatedTests/emma.jar b/org.apache.easyant4e.releng/build-files/automatedTests/emma.jar
new file mode 100644
index 0000000..b07cfd2
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/automatedTests/emma.jar
Binary files differ
diff --git a/org.apache.easyant4e.releng/build-files/automatedTests/emma.jar.version b/org.apache.easyant4e.releng/build-files/automatedTests/emma.jar.version
new file mode 100644
index 0000000..a239f01
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/automatedTests/emma.jar.version
@@ -0,0 +1,2 @@
+emma.jar is a patched 2.0.5312 which fixes an AIOB exception on 64 bit linux
+http://lukas.zapletalovi.com/blog:emma_code_coverage_tool_fixed_version
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/automatedTests/emma_ant.jar b/org.apache.easyant4e.releng/build-files/automatedTests/emma_ant.jar
new file mode 100644
index 0000000..3f28c2c
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/automatedTests/emma_ant.jar
Binary files differ
diff --git a/org.apache.easyant4e.releng/build-files/automatedTests/org.pluginbuilder.autotestsuite.feature-0.5.0.20090721PRD.zip b/org.apache.easyant4e.releng/build-files/automatedTests/org.pluginbuilder.autotestsuite.feature-0.5.0.20090721PRD.zip
new file mode 100644
index 0000000..968ecac
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/automatedTests/org.pluginbuilder.autotestsuite.feature-0.5.0.20090721PRD.zip
Binary files differ
diff --git a/org.apache.easyant4e.releng/build-files/automatedTests/run-tests.properties b/org.apache.easyant4e.releng/build-files/automatedTests/run-tests.properties
new file mode 100644
index 0000000..0749cac
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/automatedTests/run-tests.properties
@@ -0,0 +1,91 @@
+# test.eclipse.host denotes the Eclipse installation which is the host for the test run.
+# The directory given here is expected to have an eclipse subdirectory.
+# The default is to use the same host as the build host but in general this should be changed to
+# a separate installation. You can also set this directory to a non existing location and provide
+# a zip file (see next property) which will then be extracted.
+# The test host does not have to be a full Java/PDE SDK, the Eclipse platform is fully sufficient. Please ALWAYS USE FORWARD SLASHES.
+# @category testGeneral
+# @type Directory
+test.eclipse.host=${eclipseDir}/..
+
+# If you specify a non existing test.eclipse.host, you can provide a zipped Eclipse installation here,
+# e.g. eclipse-platform-3.3.2-win32.zip. You can set the test.eclipse.host to a subdirectory of the
+# buildDirectory if you want to have a fresh installation for every test run, e.g. test.eclipse.host=${buildDirectory}/testhost
+# @category testGeneral
+# @type File
+test.eclipse.zip=
+
+# The location of the Eclipse extension site. It consists of the built features,
+# the Eclipse test framework and the autotestsuite. The extension site will be
+# added with the standalone update manager to ${test.eclipse.host}.
+# @category testGeneral
+# @type Directory
+test.eclipseExtensionDirectory=${buildDirectory}/eclipseextension/eclipse
+
+# Enable the autotestsuite trace in order to see which plugins and classes the autotestsuite searches for tests.
+# Useful for debugging the filter expressions below.
+# @category testGeneral
+# @type Boolean
+autotestsuite.trace=true
+
+# Decides if the autotestsuite should run headless or not. Running headless means that the workbench does
+# not get started and the tests are executed directly instead. Cannot be used for UI tests, therefore.
+# @category testGeneral
+# @type Boolean
+autotestsuite.headless=false
+
+# Set the test application which the autoTestApplication runs with the test harness in place. This is useful to
+# test the UI of an RCP application. This property is ignored if the headless mode is turned on.
+# @category testGeneral
+#autotest.testapplication=org.eclipse.ide.ui.workbench
+
+# Directory where the reports are collected
+# @category testHidden
+test.result.dir=${buildDirectory}/test-reports
+
+# Specifies the overall report in ${test.result.dir}/xml
+# @category testHidden
+test.aggregated.report=testReport_${buildLabel}.xml
+
+# Workspace for the tests. Particularly useful is ${test.workspace}/.metadata/.log
+# @category testHidden
+test.workspace=${buildDirectory}/test-workspace
+
+# Defaults for autotestsuite
+# @category testHidden
+autotestsuite.plugin.inclusions=
+
+# Defaults for autotestsuite
+# @category testHidden
+autotestsuite.plugin.exclusions=
+
+# Defaults for autotestsuite
+# @category testHidden
+autotestsuite.class.inclusions=
+
+# Defaults for autotestsuite
+# @category testHidden
+autotestsuite.class.exclusions=
+
+# Denotes the ant script where the target ui-test is defined. Note that this property is
+# only necessary if you want to use the Eclipse test framework to run your test. If you
+# run the tests with the autotestsuite (i.e. you use the include/exclude filters below)
+# this property is not being used.
+# @category testHidden
+test.library.xml=${test.eclipseExtensionDirectory}/plugins/org.eclipse.test_3.1.0/library.xml
+
+# Enablement for code coverage.
+# @category testCoverage
+# @type Boolean
+pluginbuilder.is.runcoverage=false
+
+# Take a look at http://emma.sourceforge.net/reference/ch02s06s02.html#filtersyntax.ANT for the filter syntax.
+# @category testCoverage
+pluginbuilder.coverage.exclusionfilter=
+
+# @category testCoverage
+pluginbuilder.coverage.inclusionfilter=
+
+# Place for runtime data.
+# @category coverageHidden
+emma.coverage.output=${buildDirectory}/coverage.ec
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/automatedTests/run-tests.xml b/org.apache.easyant4e.releng/build-files/automatedTests/run-tests.xml
new file mode 100644
index 0000000..d54ecfa
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/automatedTests/run-tests.xml
@@ -0,0 +1,255 @@
+<project name="Run automated Tests" default="run" basedir=".">
+ <taskdef resource="org/pluginbuilder/anttasks/pluginbuildertasks.properties" classpath="../pluginbuilder-anttasks.jar" />
+ <typedef resource="org/pluginbuilder/anttasks/pluginbuildertypes.properties" classpath="../pluginbuilder-anttasks.jar" />
+
+ <GetHostName />
+ <property file="../../build_${hostname}.properties" />
+ <property file="../../build_local.properties" />
+ <property file="run-tests.properties" />
+ <property name="test.eclipse.host.eclipse" value="${test.eclipse.host}/eclipse" />
+
+ <import file="../build_shared.xml" />
+
+ <condition property="is.emma">
+ <equals arg1="${pluginbuilder.is.runcoverage}" arg2="true"/>
+ </condition>
+
+ <target name="-init" depends="-emmaInit">
+ <antcall target="-unpackEclipse"/>
+ <antcall target="-installEclipseExtensionLocation"/>
+ <antcall target="umAddSite" />
+ <!-- Useful for debugging
+ <antcall target="umListFeaturesSite" />
+ -->
+ </target>
+
+ <target name="-installEclipseExtensionLocation">
+ <echo message="Installing plug-ins for testing into eclipse extension location" />
+ <mkdir dir="${test.eclipseExtensionDirectory}"/>
+ <condition property="buildResultZipDest" value="${test.eclipseExtensionDirectory}/.." else="${test.eclipseExtensionDirectory}">
+ <equals arg1="${archivePrefix}" arg2="eclipse" />
+ </condition>
+ <unzip dest="${buildResultZipDest}">
+ <fileset dir="${buildDirectory}" includes="${buildType}-**/*.zip" excludes="**/${archiveNamePrefix}-*"/>
+ </unzip>
+ <antcall target="-emmaInstrument"/>
+ <unzip dest="${test.eclipseExtensionDirectory}/..">
+ <fileset dir="." includes="eclipse-test-framework*.zip" />
+ </unzip>
+ <unzip dest="${test.eclipseExtensionDirectory}">
+ <fileset dir="." includes="org.pluginbuilder.autotestsuite*.zip" />
+ </unzip>
+ <echo file="${test.eclipseExtensionDirectory}/.eclipseextension">id=org.eclipse.platform
+name=Eclipse Platform
+version=3.1.0</echo>
+ </target>
+
+ <target name="-unpackEclipse" unless="isEclipseInstallationAvailable">
+ <antcall target="unpack.eclipse">
+ <param name="eclipse.installation.dir" value="${test.eclipse.host.eclipse}"/>
+ <param name="eclipse.local.tar.non.server" value="${test.eclipse.zip}"/>
+ </antcall>
+ </target>
+
+ <!-- Example target which demonstrates how to run a test suite with the Eclipse test fwk.
+ Note that it is not needed if you use the autotestsuite
+
+ <target name="-runTestSuite" description="Should be called from allTests.xml only">
+ <ant target="core-test" antfile="${test.library.xml}" dir="${test.eclipse.host.eclipse}">
+ --><!-- inject additional properties for Eclipse startup with data-dir property --><!--
+ <property name="data-dir" value="${test.workspace} -clean -dev ${basedir}/emma.jar" />
+ <property name="plugin-name" value="org.rssowl.core.tests" />
+ <property name="classname" value="org.rssowl.core.tests.AllTests" />
+ <property name="eclipse-home" value="${test.eclipse.host.eclipse}" />
+ <property name="extraVMargs" value="-Demma.coverage.out.file=${emma.coverage.output}" />
+ </ant>
+ </target>
+
+ <target name="run" depends="-init,-runTestSuite,-emmaReport" description="Run manually defined tests and create a report.">
+ <antcall target="umRemoveSite" />
+ <delete dir="${test.result.dir}" />
+ <mkdir dir="${test.result.dir}/xml" />
+ --><!-- collect creates an aggregated report file in ${test.eclipse.host} --><!--
+ <ant target="collect" antfile="${test.library.xml}" dir="${test.eclipse.host.eclipse}">
+ <property name="includes" value="*.xml" />
+ <property name="output-file" value="${test.aggregated.report}" />
+ </ant>
+ <copy file="${test.eclipse.host.eclipse}/${test.aggregated.report}" todir="${test.result.dir}/xml" />
+
+ <BundleFileLocator eclipseInstallationRoot="${test.eclipseExtensionDirectory}" bundleId="org.pluginbuilder.autotestsuite.application" filePath="JUNIT.XSL" property="junit.xsl.file" />
+ <style style="${junit.xsl.file}" basedir="${test.result.dir}/xml" destdir="${test.result.dir}/html" />
+
+ <antcall target="-checkTestResultFileForErrors"/>
+ </target>
+ -->
+
+ <target name="run" depends="-init,-runAutoTests,-emmaReport" description="Run all tests using the autotestsuite and create xml and html reports.">
+ <antcall target="umRemoveSite" />
+ <junitreport todir="${test.result.dir}/xml" tofile="${test.aggregated.report}">
+ <fileset dir="${test.result.dir}/xml">
+ <include name="*.xml" />
+ </fileset>
+ </junitreport>
+
+ <BundleFileLocator eclipseInstallationRoot="${test.eclipseExtensionDirectory}" bundleId="org.pluginbuilder.autotestsuite.application" filePath="JUNIT.XSL" property="junit.xsl.file" />
+
+ <style style="${junit.xsl.file}" basedir="${test.result.dir}/xml" includes="${test.aggregated.report}" destdir="${test.result.dir}/html" />
+ </target>
+
+ <target name="-markErrorOrFailure" if="isErrorOrFailure">
+ <!-- Write Message to stderr and continue the build. Do not let the build fail so that
+ other tasks which come afterwards can be completed. E.g. packaging might take place
+ after test execution -->
+ <echo level="error" message="TESTS FAILED"/>
+ </target>
+
+ <target name="-checkTestResultFileForErrors" unless="isErrorOrFailure" description="Check test result file for errors. Not needed for autotestsuite where the return status is used to signal a failed build.">
+ <echo message="Checke auf Fehler: ${test.aggregated.report}"/>
+
+ <condition property="isErrorOrFailure">
+ <hasErrorOrFailure reportFile="${test.result.dir}/xml/${test.aggregated.report}" />
+ </condition>
+
+ <antcall target="-markErrorOrFailure" />
+ </target>
+
+ <target name="-runAutoTests">
+ <mkdir dir="${test.result.dir}/xml"/>
+ <BundleFileLocator eclipseInstallationRoot="${test.eclipse.host.eclipse}" bundleId="org.eclipse.equinox.launcher" property="equinoxjar" />
+ <condition property="optJvmArg" else="-DdummyVar=NotOnMac" value="-XstartOnFirstThread">
+ <os family="mac"/>
+ </condition>
+ <condition property="testApplication" else="" value="-testApplication ${autotest.testapplication}">
+ <isset property="autotest.testapplication"/>
+ </condition>
+ <java fork="true" dir="." logError="true" classname="org.eclipse.core.launcher.Main" resultproperty="autotestsuite.result">
+
+ <arg line="-application org.pluginbuilder.autotestsuite.application.autoTestApplication ${testApplication}" />
+ <arg line="-data ${test.workspace}" />
+ <arg line="-os ${os}" />
+ <arg line="-ws ${ws}" />
+ <arg line="-arch ${arch}" />
+ <arg line="-clean" />
+ <arg line="-consolelog" />
+ <arg line="-dev ${basedir}/emma.jar" />
+
+ <jvmarg value="-Demma.coverage.out.file=${emma.coverage.output}"/>
+ <jvmarg value="${optJvmArg}"/>
+ <jvmarg value="-Xmx512m"/>
+
+ <sysproperty key="autotestsuite.results.directory" value="${test.result.dir}/xml" />
+ <sysproperty key="autotest.debug" value="${autotestsuite.trace}" />
+ <sysproperty key="autotestsuite.headless" value="${autotestsuite.headless}" />
+ <sysproperty key="autotestsuite.plugin.inclusions" value="${autotestsuite.plugin.inclusions}" />
+ <sysproperty key="autotestsuite.plugin.exclusions" value="${autotestsuite.plugin.exclusions}|^org.eclipse.test$" />
+ <sysproperty key="autotestsuite.class.inclusions" value="${autotestsuite.class.inclusions}" />
+ <sysproperty key="autotestsuite.class.exclusions" value="${autotestsuite.class.exclusions}" />
+
+ <classpath>
+ <pathelement location="${equinoxjar}" />
+ </classpath>
+ </java>
+ <condition property="isErrorOrFailure">
+ <not>
+ <equals arg1="${autotestsuite.result}" arg2="0"/>
+ </not>
+ </condition>
+
+ <antcall target="-markErrorOrFailure"/>
+ </target>
+
+ <target name="umAddSite">
+ <echo message="Adding Extension Site to ${test.eclipse.host}. Might fail if extension already exists."/>
+ <!-- the addSite calls fails if the extension site already exists (for example because it was not removed properly
+ from a previous build. Nonetheless the tests can proceed -->
+ <antcall target="updateManager">
+ <param name="updateManagerCommand" value="addSite"/>
+ <param name="updateManagerCommandParam" value="-from"/>
+ <param name="updateManagerCommandSiteUrl" value="${test.eclipseExtensionDirectory}"/>
+ <param name="updateManagerCommandFailOnError" value="false"/>
+ </antcall>
+ </target>
+
+ <target name="umRemoveSite">
+ <!-- This command might fail if the Extension Site has never been added or was properly removed before. -->
+ <echo message="Removing Extension Site from ${test.eclipse.host}."/>
+
+ <antcall target="updateManager">
+ <param name="updateManagerCommand" value="removeSite"/>
+ <param name="updateManagerCommandParam" value="-to"/>
+ <param name="updateManagerCommandSiteUrl" value="${test.eclipseExtensionDirectory}"/>
+ <param name="updateManagerCommandFailOnError" value="false"/>
+ </antcall>
+ </target>
+
+ <target name="umListFeaturesSite">
+ <antcall target="updateManager">
+ <param name="updateManagerCommand" value="listFeatures"/>
+ <param name="updateManagerCommandParam" value="-from"/>
+ <param name="updateManagerCommandSiteUrl" value="${test.eclipseExtensionDirectory}"/>
+ <param name="updateManagerCommandFailOnError" value="false"/>
+ </antcall>
+
+ </target>
+
+ <target name="updateManager">
+ <BundleFileLocator eclipseInstallationRoot="${test.eclipse.host.eclipse}" bundleId="org.eclipse.equinox.launcher" property="equinoxjar" />
+ <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="${updateManagerCommandFailOnError}">
+ <arg value="-ws" />
+ <arg value="${ws}" />
+ <arg value="-os" />
+ <arg value="${os}" />
+ <arg value="-application" />
+ <arg value="org.eclipse.update.core.standaloneUpdate" />
+ <arg value="-command" />
+ <arg value="${updateManagerCommand}" />
+ <arg value="${updateManagerCommandParam}" />
+ <arg value="${updateManagerCommandSiteUrl}" />
+
+ <classpath>
+ <pathelement location="${equinoxjar}" />
+ </classpath>
+
+ </java>
+ </target>
+
+
+
+ <target name="-emmaInit" if="is.emma">
+ <path id='emma.lib' >
+ <fileset dir='.' includes='*.jar' />
+ </path>
+ <taskdef resource='emma_ant.properties' classpathref='emma.lib' />
+ </target>
+
+ <target name="-emmaReport" if="is.emma">
+ <mkdir dir="${test.result.dir}/coverage" />
+ <emma enabled="${pluginbuilder.is.runcoverage}">
+ <report encoding="UTF-8">
+ <fileset dir="${buildDirectory}" includes="*.emma"/>
+ <fileset file="${emma.coverage.output}"/>
+ <html outfile="${test.result.dir}/coverage/coverage.html" />
+
+ <sourcepath>
+ <dirset dir="${buildDirectory}/plugins">
+ </dirset>
+ </sourcepath>
+
+ </report>
+ </emma>
+ </target>
+
+ <target name="-emmaInstrument" if="is.emma">
+ <!-- <emma enabled="${pluginbuilder.is.runcoverage}"> -->
+ <emma>
+ <instr verbosity="info" metadatafile="${buildDirectory}/metadata.emma" mode="overwrite">
+ <instrpath>
+ <fileset dir="${test.eclipseExtensionDirectory}" includes="**/*.jar" excludes="**/emma*.jar"/>
+ <dirset dir="${test.eclipseExtensionDirectory}/plugins" includes="*" />
+ </instrpath>
+ <!-- http://emma.sourceforge.net/reference/ch02s06s02.html#filtersyntax.ANT -->
+ <filter includes="${pluginbuilder.coverage.inclusionfilter}" excludes="${pluginbuilder.coverage.exclusionfilter}" />
+ </instr>
+ </emma>
+ </target>
+</project>
diff --git a/org.apache.easyant4e.releng/build-files/build.properties b/org.apache.easyant4e.releng/build-files/build.properties
new file mode 100644
index 0000000..17d940c
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/build.properties
@@ -0,0 +1,210 @@
+# The prefix that will be used inside the generated archive. This should be set to eclipse
+# so that the archive can be directly unzipped into the dropins directory of the
+# Eclipse installation.
+# @category packaging
+archivePrefix=eclipse
+
+# The location under which all of the build output will be collected.
+# @category packaging
+collectingFolder=${archivePrefix}
+
+# Choose configurations if you want to build configuration specific plug-ins. However, if you
+# only want to create RCP distributables for different platforms do not change the default
+# *,*,*. If you select any other entry than *,*,* you also have to provide an assemble task in allElements.xml.
+# @category compiling
+# @type list separator=&;values=*,*,*&win32,win32,x86&linux,gtk,ppc&linux,gtk,x86 & linux,gtk,x86_64 & linux,motif,x86 & solaris,motif,sparc & solaris,gtk,sparc & aix,motif,ppc & hpux,motif,PA_RISC & macosx,carbon,ppc & macosx,carbon,x86
+#configs=*,*,*
+
+
+# By default PDE creates one archive (result) per entry listed in the configs property.
+# Setting this value to true will cause PDE to only create one output containing all
+# artifacts for all the platforms listed in the configs property.
+# @category packaging
+# @type Boolean
+#groupConfigurations=false
+
+#The format of the archive. By default a zip is created using antZip.
+#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
+# generateJnlp=false
+
+# Codebase should be a URL that will be used as the root of all relative URLs in the output.
+# @category jnlp
+#jnlp.codebase=<codebase url>
+
+# @category jnlp
+#jnlp.j2se=<j2se version>
+
+# @category jnlp
+#jnlp.locale=<a locale>
+
+# Generate <offlineAllowed/> attribute in the generated features
+# @category jnlp
+# @type Boolean
+#jnlp.generateOfflineAllowed=
+
+# 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=
+
+# Check if you want to sign jars
+# @type Boolean
+# @category jarsigning
+#signJars=false
+
+# The Alias used for signing jars
+# @category jarsigning
+#sign.alias=
+
+# A path to the keystore used for signing jars
+# @category jarsigning
+#sign.keystore=
+
+# The password for the keystore
+# @category jarsigning
+#sign.storepass=
+
+#Arguments to send to the zip executable
+# @category packaging
+zipargs=
+
+#Arguments to send to the tar executable
+# @category packaging
+tarargs=
+
+# Control the creation of a file containing the version included in each configuration - on by default
+# @type Boolean
+#generateVersionsLists=true
+
+# Indicates whether you want the set of plug-ins and features to be considered during the build to be limited to the ones reachable from the features / plugins being built
+# @type Boolean
+filteredDependencyCheck=false
+
+# Indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons)
+# @type Boolean
+resolution.devMode=false
+
+#pluginPath is a list of locations in which to find plugins and features. This list is separated by the platform file separator (; or :)
+#a location is one of:
+#- the location of the jar or folder that is the plugin or feature : /path/to/foo.jar or /path/to/foo
+#- a directory that contains a /plugins or /features subdirectory
+#- the location of a feature.xml, or for 2.1 style plugins, the plugin.xml or fragment.xml
+#pluginPath=
+
+
+# The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE
+# @category compiling
+# bootclasspath=${java.home}/lib/rt.jar
+
+# @category executionEnvironment
+#CDC-1.0/Foundation-1.0=
+# @category executionEnvironment
+#CDC-1.1/Foundation-1.1=
+# @category executionEnvironment
+#OSGi/Minimum-1.0=
+# @category executionEnvironment
+#OSGi/Minimum-1.1=
+# @category executionEnvironment
+#JRE-1.1=
+# @category executionEnvironment
+#J2SE-1.2=
+# @category executionEnvironment
+#J2SE-1.3=
+# @category executionEnvironment
+#J2SE-1.4=
+# @category executionEnvironment
+#J2SE-1.5=
+# @category executionEnvironment
+#JavaSE-1.6=
+# @category executionEnvironment
+#PersonalJava-1.1=
+# @category executionEnvironment
+#PersonalJava-1.2=
+# @category executionEnvironment
+#CDC-1.0/PersonalBasis-1.0=
+# @category executionEnvironment
+#CDC-1.0/PersonalJava-1.0=
+# @category executionEnvironment
+#CDC-1.1/PersonalBasis-1.1=
+# @category executionEnvironment
+#CDC-1.1/PersonalJava-1.1=
+
+# Specify the output format of the compiler log when eclipse jdt is used
+# @category compiling
+logExtension=.log
+
+# Whether or not to include debug info in the output jars
+# @category compiling
+# @type Boolean
+javacDebugInfo=false
+
+# Whether or not to fail the build if there are compiler errors
+# @category compiling
+# @type Boolean
+javacFailOnError=true
+
+# Enable or disable verbose mode of the compiler
+# @category compiling
+# @type Boolean
+javacVerbose=false
+
+# Extra arguments for the compiler. These are specific to the java compiler being used.
+# @category compiling
+#compilerArg=
+
+# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties
+# @type enum values=1.1,1.2,1.3,1.4,1.5,1.6
+# @category compiling
+#javacSource=1.3
+javacSource=1.5
+
+# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties.
+# @type enum values=1.1,1.2,1.3,1.4,1.5,1.6
+# @category compiling
+#javacTarget=1.1
+javacTarget=1.5
+
+# Set the description for the update site. The update manager shows the description in the Updates dialog.
+# @category updateSite
+updateSiteDescription=Update site generated by pluginbuilder.
+
+# There will be one category for the generated update site. Here you can set the name.
+# It is more like an id with which features refer to their category and does not appear in the GUI.
+# @category updateSite
+updateSiteCategoryName=Builds
+
+# Here you can set the Label of the category which will be displayed in the Updates dialog.
+# @category updateSite
+updateSiteCategoryLabel=Nightly Builds
+
+# Create a provisioning (p2) repository. Since Eclipse 3.4 it is recommended that you create
+# a p2 repository for your features.
+# However, the installation of old-style (pre p2) update sites is still possible.
+# @type Boolean
+# @category p2
+generate.p2.metadata=true
+
+# @category hidden
+p2.metadata.repo=file:${buildDirectory}/repo
+
+# @category hidden
+p2.artifact.repo=file:${buildDirectory}/repo
+
+# The name of the metadata repository. The Update Manager will display this name.
+# @category p2
+p2.metadata.repo.name=EasyAnt For Eclipse Update Site
+
+# The name of the artifacts repository
+# @category p2
+p2.artifact.repo.name=EasyAnt For Eclipse Update Site
+
+# @category hidden
+p2.flavor=tooling
+# @category hidden
+p2.publish.artifacts=true
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/build_rcp.properties b/org.apache.easyant4e.releng/build-files/build_rcp.properties
new file mode 100644
index 0000000..bb40497
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/build_rcp.properties
@@ -0,0 +1,37 @@
+# The name of the Product Configuration file (.product). You can either put a product file in the root
+# folder of this pluginbuilder project and specify its name here. Or you can use an existing product file
+# from one of your plug-ins by specifying a path like ${buildDirectory}/plugins/<your-plugin>/<your-product>.product.
+# This field is mandatory.
+# @category rcp
+product=
+
+# Select the platforms for which you want to create RCP deliverables.
+# @category rcp
+# @type list separator=&;values=win32,win32,x86&linux,gtk,ppc&linux,gtk,x86 & linux,gtk,x86_64 & linux,motif,x86 & solaris,motif,sparc & solaris,gtk,sparc & aix,motif,ppc & hpux,motif,PA_RISC & macosx,carbon,ppc & macosx,carbon,x86
+configs=win32,win32,x86
+
+# Prefix for the created archive file name. The archive name always contains the configuration. The prefix and configuration are divided by a minus character. If you want to include the version you can reference the property ${version.full}, a sample value for archiveNamePrefix is myRcpApp-${version.full}
+# @category rcp
+archiveNamePrefix=
+
+# You need to set this to true in order to get archives for your configurations.
+# @category rcp
+# @type Boolean
+# runPackager=false
+runPackager=true
+
+# A Pluginbuilder property which prevents running the postBuild target. Since the RCP
+# build is usually run after a regular build which includes the postBuild phase no.postBuild
+# should be activated for RCP builds
+# @category rcp_hidden
+# @type Boolean
+no.postBuild=true
+
+# Another Pluginbuilder property which should be activated for RCP builds
+# @category rcp_hidden
+# @type Boolean
+build.container.feature=true
+
+# Set the root path in the platform specific packages
+# @category packaging
+# archivePrefix=
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/build_shared.xml b/org.apache.easyant4e.releng/build-files/build_shared.xml
new file mode 100644
index 0000000..8d17365
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/build_shared.xml
@@ -0,0 +1,116 @@
+<project name="Shared build targets">
+ <!-- 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
+ optional:
+ <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
diff --git a/org.apache.easyant4e.releng/build-files/customTargets.xml b/org.apache.easyant4e.releng/build-files/customTargets.xml
new file mode 100644
index 0000000..1b8251c
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/customTargets.xml
@@ -0,0 +1,208 @@
+<project name="Build specific targets and properties" default="noDefault">
+ <condition property="isNightlyBuild">
+ <equals arg1="${buildType}" arg2="N" />
+ </condition>
+ <condition property="isNightlyOrIntegrationBuild">
+ <or>
+ <equals arg1="${buildType}" arg2="N" />
+ <equals arg1="${buildType}" arg2="I" />
+ </or>
+ </condition>
+
+ <property file="${buildHome}/pluginbuilder.config" />
+
+ <property file="${buildDirectory}/version.properties" />
+ <property name="buildLabel" value="${buildType}-${version.full}" />
+ <property name="buildId" value="${version.full}" />
+
+ <condition property="isCVSOrCopy" value="true">
+ <or>
+ <equals arg1="${pluginbuilder.is.cvs}" arg2="true"/>
+ <equals arg1="${pluginbuilder.is.copy}" arg2="true"/>
+ </or>
+ </condition>
+ <condition property="isSVN" value="true">
+ <equals arg1="${pluginbuilder.is.svn}" arg2="true"/>
+ </condition>
+ <condition property="isRunTests" value="true">
+ <equals arg1="${pluginbuilder.is.runtests}" arg2="true"/>
+ </condition>
+
+
+ <target name="allElements">
+ <condition property="isFetch" value="true">
+ <equals arg1="${target}" arg2="fetchElement"/>
+ </condition>
+ <condition property="is.svn.fetch" value="true">
+ <and>
+ <equals arg1="${target}" arg2="fetchElement"/>
+ <equals arg1="${pluginbuilder.is.svn}" arg2="true"/>
+ </and>
+ </condition>
+
+ <antcall target="allElementsExceptSvnFetch"/>
+ <antcall target="fetchSubversion"/>
+ </target>
+
+ <import file="allElements.xml"/>
+ <import file="subversionSupport.xml"/>
+
+
+ <!-- ===================================================================== -->
+ <!-- Check out map files from correct repository -->
+ <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
+ <!-- ===================================================================== -->
+ <target name="getMapFiles" if="isCVSOrCopy">
+ <echo message="Copying map files."/>
+ <copy todir="${buildDirectory}/maps">
+ <fileset dir="${buildHome}/maps" includes="*.map"></fileset>
+ </copy>
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before setup -->
+ <!-- ===================================================================== -->
+ <target name="preSetup">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do after setup but before starting the build proper -->
+ <!-- ===================================================================== -->
+ <target name="postSetup">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do before fetching the build elements -->
+ <!-- ===================================================================== -->
+ <target name="preFetch">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do after fetching the build elements -->
+ <!-- ===================================================================== -->
+ <target name="postFetch">
+ <condition property="is.fetch" value="true">
+ <available file="${buildDirectory}/plugins"/>
+ </condition>
+ <fail unless="is.fetch" message="There was no plug-in fetched. Was the configuration generated? Is the repository correct?"/>
+ <antcall target="replaceVersions"/>
+ </target>
+
+ <target name="replaceVersions">
+ <fail unless="version.full" message="Property version.full must be set" />
+ <fail unless="version.qualifier" message="Property version.qualifier must be set" />
+
+ <echo message="Updating versions in feature and plugin manifests. Full version: ${version.full}, qualifier: ${version.qualifier}"/>
+ <replaceregexp
+ match="(<feature[^>]*version=)"0.0.0""
+ replace="\1"${version.full}""
+ byline="false"
+ flags="s">
+ <fileset dir="${buildDirectory}/features" includes="**/feature.xml"/>
+ </replaceregexp>
+ <replaceregexp
+ match="(<feature[^>]*version=".*)qualifier""
+ replace="\1${version.qualifier}""
+ byline="false"
+ flags="s">
+ <fileset dir="${buildDirectory}/features" includes="**/feature.xml"/>
+ </replaceregexp>
+ <!-- in a manual build started with export from the feature.xml, there is no
+ need to replace the versions in the plugin.xml files if they are set to 0.0.0,
+ but here it needs to be -->
+ <replace dir="${buildDirectory}/plugins">
+ <include name="**/plugin.xml"/>
+ <replacefilter token="0.0.0" value="${version.full}" />
+ </replace>
+ <replace dir="${buildDirectory}/plugins">
+ <include name="**/META-INF/MANIFEST.MF"/>
+ <replacefilter token="Bundle-Version: 0.0.0" value="Bundle-Version: ${version.full}" />
+ <replacefilter token="qualifier" value="${version.qualifier}" />
+ </replace>
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do before generating the build scripts. -->
+ <!-- ===================================================================== -->
+ <target name="preGenerate">
+ <!-- fail unless="featureVersion" message="Property featureVersion must be set.
+ Either directly or in case of a nightly build with nightlyBuildFeatureVersionPrefix." />
+ -->
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do after generating the build scripts. -->
+ <!-- ===================================================================== -->
+ <target name="postGenerate">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do before running the build.xmls for the elements being built. -->
+ <!-- ===================================================================== -->
+ <target name="preProcess">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do after running the build.xmls for the elements being built. -->
+ <!-- ===================================================================== -->
+ <target name="postProcess">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do before running assemble. -->
+ <!-- ===================================================================== -->
+ <target name="preAssemble">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do after running assemble. -->
+ <!-- ===================================================================== -->
+ <target name="postAssemble">
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Steps to do before/after packaging RCP. -->
+ <!-- ===================================================================== -->
+ <target name="prePackage">
+ </target>
+
+ <target name="postPackage">
+ <!-- copy build results for rcp build -->
+ <copy todir="${buildResultsDirectory}" flatten="true">
+ <fileset dir="${buildDirectory}" includes="${buildType}-**/*.zip" />
+ </copy>
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the build is done. -->
+ <!-- ===================================================================== -->
+ <property name="buildResultsDirectory" value="${buildDirectory}/results" />
+ <target name="postBuild" depends="-prepareBuildResultsDirectory" unless="no.postBuild">
+ <antcall target="runTests"/>
+ <copy todir="${buildResultsDirectory}" flatten="true">
+ <fileset dir="${buildDirectory}" includes="${buildType}-**/*.zip" />
+ </copy>
+ <condition property="is.External.Postbuild">
+ <available file="${buildHome}/build-files/postBuild.xml"/>
+ </condition>
+ <antcall target="callExternalPostBuild"/>
+ </target>
+ <!-- ===================================================================== -->
+ <!-- Run tests. -->
+ <!-- ===================================================================== -->
+ <target name="runTests" if="isRunTests">
+ <property name="automatedTestsHome" location="${buildHome}/build-files/automatedTests"/>
+
+ <ant antfile="${automatedTestsHome}/run-tests.xml" target="run" dir="${automatedTestsHome}">
+ <property name="test.result.dir" value="${buildResultsDirectory}/testresults"/>
+ </ant>
+ </target>
+ <!--======================================================-->
+ <!-- Gather build results -->
+ <!-- ==================================================== -->
+ <target name="-prepareBuildResultsDirectory">
+ <echo message="Creating ${buildResultsDirectory}" />
+ <mkdir dir="${buildResultsDirectory}" />
+ </target>
+
+ <!--======================================================-->
+ <!-- Call External post build file if available -->
+ <!-- ==================================================== -->
+ <target name="callExternalPostBuild" if="is.External.Postbuild">
+ <ant antfile="${buildHome}/build-files/postBuild.xml"/>
+ </target>
+
+ <target name="noDefault">
+ <echo message="You must specify a target when invoking this file" />
+ </target>
+</project>
diff --git a/org.apache.easyant4e.releng/build-files/fetchSvnAll.xml b/org.apache.easyant4e.releng/build-files/fetchSvnAll.xml
new file mode 100644
index 0000000..4437706
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/fetchSvnAll.xml
@@ -0,0 +1,5 @@
+<project name="Generated">
+ <target name="fetch.svn.all">
+ <!-- use pluginbuilder editor to change content -->
+ </target>
+</project>
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/pluginbuilder-anttasks.jar b/org.apache.easyant4e.releng/build-files/pluginbuilder-anttasks.jar
new file mode 100644
index 0000000..98d2c3e
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/pluginbuilder-anttasks.jar
Binary files differ
diff --git a/org.apache.easyant4e.releng/build-files/postBuild.xml b/org.apache.easyant4e.releng/build-files/postBuild.xml
new file mode 100644
index 0000000..983a954
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/postBuild.xml
@@ -0,0 +1,109 @@
+<project name="Run as part of postBuild" default="main">
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildHome}/build-files/ant-contrib.jar" />
+ <taskdef resource="org/pluginbuilder/anttasks/pluginbuildertasks.properties" classpath="${buildHome}/build-files/pluginbuilder-anttasks.jar" />
+
+
+ <target name="main">
+ <property name="UpdateSiteStagingLocation" value="${buildDirectory}/tmpUpdateSite/updateSite"/>
+ <property name="UpdateSiteFinalLocation" value="${buildResultsDirectory}/../updateSite"/>
+ <property name="siteXmlFile" value="${UpdateSiteStagingLocation}/site.xml"/>
+
+ <antcall target="-generateUpdateSite"/>
+ <antcall target="-createNightlyBuildSiteXml"/>
+ <zip destfile="${buildResultsDirectory}/updateSite-${version.full}.zip" basedir="${UpdateSiteStagingLocation}"/>
+ <antcall target="deleteSiteXml"/>
+ <copy todir="${UpdateSiteFinalLocation}">
+ <fileset dir="${UpdateSiteStagingLocation}" includes="**"/>
+ </copy>
+ <delete dir="${UpdateSiteStagingLocation}/../.." includes="tmpUpdateSite/**" includeemptydirs="true"/>
+ <antcall target="-p2"/>
+ </target>
+
+ <target name="deleteSiteXml" unless="isNightlyBuild">
+ <!-- in release builds the site.xml should not be overwritten, so older version can survive -->
+ <delete file="${siteXmlFile}"/>
+ </target>
+
+ <!--======================================================-->
+ <!-- UpdateSite Export target, to be called from allElements -->
+ <!-- ==================================================== -->
+ <target name="updateSiteExport">
+ <ant antfile="build.xml" dir="${buildDirectory}/features/${id}/" target="build.update.jar">
+ <property name="feature.destination" value="${UpdateSiteStagingLocation}/features"/>
+ <property name="plugin.destination" value="${UpdateSiteStagingLocation}/plugins"/>
+ </ant>
+ </target>
+
+ <target name="-generateUpdateSite">
+ <!-- Create the directory structure -->
+ <mkdir dir="${UpdateSiteStagingLocation}"/>
+ <mkdir dir="${UpdateSiteStagingLocation}/features"/>
+ <mkdir dir="${UpdateSiteStagingLocation}/plugins"/>
+ <condition property="jarProcessor.sign" value="true">
+ <istrue value="${signJars}"/>
+ </condition>
+ <!-- Build the jar files -->
+ <ant antfile="${builder}/customTargets.xml" target="allElements">
+ <property name="genericTargets" value="${builder}/postBuild.xml"/>
+ <property name="target" value="updateSiteExport"/>
+ </ant>
+ <!-- site.xml files for integration and release builds are handled elsewhere -->
+ <antcall target="-createNightlyBuildSiteXml"/>
+ <delete dir="${buildDirectory}/temp.updatesite"/>
+ </target>
+
+ <target name="-createNightlyBuildSiteXml">
+ <echo>${siteXmlFile}</echo>
+ <echo file="${siteXmlFile}"><?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>${updateSiteDescription}</description>
+</echo>
+ <foreach list="${pluginbuilder.features}" delimiter="," target="-appendFeatureElement" param="featureId" inheritall="true"/>
+ <echo file="${siteXmlFile}" append="true"> <category-def name="${updateSiteCategoryName}"
+ label="${updateSiteCategoryLabel}">
+ </category-def>
+</site></echo>
+ </target>
+
+ <target name="-appendFeatureElement">
+ <!-- we can not rely on ${version.full} at this point since people could use
+ a fix feature id like 0.5.0.qualifier. ${version.full} would only work if
+ the feature were set to 0.0.0 -->
+ <loadfile property="featurexml" srcfile="${buildDirectory}/features/${featureId}/feature.xml"/>
+ <SetRegex input="${featurexml}" match="^.*<feature.+?version="(.+?)".*$" property="realFeatureVersion" value="\1" />
+ <echo file="${siteXmlFile}" append="true"> <feature
+ url="features/${featureId}_${realFeatureVersion}.jar"
+ id="${featureId}"
+ version="${realFeatureVersion}">
+ <category name="${updateSiteCategoryName}"/>
+ </feature>
+</echo>
+ </target>
+
+ <target name="-p2">
+ <condition property="is.p2" value="true">
+ <equals arg1="${generate.p2.metadata}" arg2="true"/>
+ </condition>
+ <property name="p2archive" value="${buildResultsDirectory}/p2-repository-${version.full}.zip"/>
+ <antcall target="-createP2Archive"/>
+ <antcall target="-createP2UpdateSite"/>
+ </target>
+
+ <target name="-createP2Archive" if="is.p2">
+ <pathconvert property="repodir">
+ <resources>
+ <url url="${p2.metadata.repo}"/>
+ </resources>
+ <map from="file:" to=""/>
+ </pathconvert>
+ <zip destfile="${p2archive}" basedir="${repodir}"/>
+ </target>
+
+ <target name="-createP2UpdateSite" if="is.p2">
+ <property name="p2updatesite" value="${buildResultsDirectory}/../p2-updateSite"/>
+ <delete dir="${p2updatesite}"/>
+ <mkdir dir="${p2updatesite}"/>
+ <unzip src="${p2archive}" dest="${p2updatesite}"/>
+ </target>
+
+</project>
diff --git a/org.apache.easyant4e.releng/build-files/subversionSupport.xml b/org.apache.easyant4e.releng/build-files/subversionSupport.xml
new file mode 100644
index 0000000..55929b4
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/subversionSupport.xml
@@ -0,0 +1,26 @@
+<project name="to be included into customTargets.xml">
+
+ <import file="fetchSvnAll.xml"/>
+
+ <path id="project.classpath">
+ <pathelement location="${buildHome}/build-files/svn/svnant.jar"/>
+ <pathelement location="${buildHome}/build-files/svn/svnClientAdapter.jar"/>
+ </path>
+
+ <target name="fetchSubversion" if="is.svn.fetch">
+ <taskdef resource="svntask.properties" classpathref="project.classpath"/>
+ <property name="fetchTag" value="HEAD"/>
+ <antcall target="fetch.svn.all"/>
+ </target>
+
+ <target name="svn.co">
+ <property name="target.dir" value="${element.id}"/>
+ <condition property="svn.url" value="${pluginbuilder.svn.url}" else="${url}">
+ <isset property="pluginbuilder.svn.url"/>
+ </condition>
+ <svn javahl="false" username="${pluginbuilder.svn.user}" password="${pluginbuilder.svn.password}">
+ <checkout revision="${fetchTag}" url="${svn.url}/${project.name}" destPath="${buildDirectory}/${target}/${target.dir}" />
+ </svn>
+ </target>
+
+</project>
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/svn/SVNCLIENTADAPTER-LICENSE b/org.apache.easyant4e.releng/build-files/svn/SVNCLIENTADAPTER-LICENSE
new file mode 100644
index 0000000..4e11cce
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/svn/SVNCLIENTADAPTER-LICENSE
@@ -0,0 +1,185 @@
+SVNClientAdapter Library License
+
+This license applies to all portions of SVNClientAdapter library, which
+are not externally-maintained libraries (e.g. JavaHL or JavaSVN).
+
+Such libraries have their own licenses; we recommend you read them, as
+their terms may differ from the terms below.
+
+=============================================================================
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build-files/svn/svnClientAdapter.jar b/org.apache.easyant4e.releng/build-files/svn/svnClientAdapter.jar
new file mode 100644
index 0000000..a6ce6df
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/svn/svnClientAdapter.jar
Binary files differ
diff --git a/org.apache.easyant4e.releng/build-files/svn/svnant.jar b/org.apache.easyant4e.releng/build-files/svn/svnant.jar
new file mode 100644
index 0000000..ef9563a
--- /dev/null
+++ b/org.apache.easyant4e.releng/build-files/svn/svnant.jar
Binary files differ
diff --git a/org.apache.easyant4e.releng/build.properties b/org.apache.easyant4e.releng/build.properties
new file mode 100644
index 0000000..9f845e7
--- /dev/null
+++ b/org.apache.easyant4e.releng/build.properties
@@ -0,0 +1,210 @@
+# The prefix that will be used inside the generated archive. This should be set to eclipse
+# so that the archive can be directly unzipped into the dropins directory of the
+# Eclipse installation.
+# @category packaging
+archivePrefix=eclipse
+
+# The location under which all of the build output will be collected.
+# @category packaging
+collectingFolder=${archivePrefix}
+
+# Choose configurations if you want to build configuration specific plug-ins. However, if you
+# only want to create RCP distributables for different platforms do not change the default
+# *,*,*. If you select any other entry than *,*,* you also have to provide an assemble task in allElements.xml.
+# @category compiling
+# @type list separator=&;values=*,*,*&win32,win32,x86&linux,gtk,ppc&linux,gtk,x86 & linux,gtk,x86_64 & linux,motif,x86 & solaris,motif,sparc & solaris,gtk,sparc & aix,motif,ppc & hpux,motif,PA_RISC & macosx,carbon,ppc & macosx,carbon,x86
+#configs=*,*,*
+
+
+# By default PDE creates one archive (result) per entry listed in the configs property.
+# Setting this value to true will cause PDE to only create one output containing all
+# artifacts for all the platforms listed in the configs property.
+# @category packaging
+# @type Boolean
+#groupConfigurations=false
+
+#The format of the archive. By default a zip is created using antZip.
+#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
+# generateJnlp=false
+
+# Codebase should be a URL that will be used as the root of all relative URLs in the output.
+# @category jnlp
+#jnlp.codebase=<codebase url>
+
+# @category jnlp
+#jnlp.j2se=<j2se version>
+
+# @category jnlp
+#jnlp.locale=<a locale>
+
+# Generate <offlineAllowed/> attribute in the generated features
+# @category jnlp
+# @type Boolean
+#jnlp.generateOfflineAllowed=
+
+# 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=
+
+# Check if you want to sign jars
+# @type Boolean
+# @category jarsigning
+#signJars=false
+
+# The Alias used for signing jars
+# @category jarsigning
+#sign.alias=
+
+# A path to the keystore used for signing jars
+# @category jarsigning
+#sign.keystore=
+
+# The password for the keystore
+# @category jarsigning
+#sign.storepass=
+
+#Arguments to send to the zip executable
+# @category packaging
+zipargs=
+
+#Arguments to send to the tar executable
+# @category packaging
+tarargs=
+
+# Control the creation of a file containing the version included in each configuration - on by default
+# @type Boolean
+#generateVersionsLists=true
+
+# Indicates whether you want the set of plug-ins and features to be considered during the build to be limited to the ones reachable from the features / plugins being built
+# @type Boolean
+filteredDependencyCheck=false
+
+# Indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons)
+# @type Boolean
+resolution.devMode=false
+
+#pluginPath is a list of locations in which to find plugins and features. This list is separated by the platform file separator (; or :)
+#a location is one of:
+#- the location of the jar or folder that is the plugin or feature : /path/to/foo.jar or /path/to/foo
+#- a directory that contains a /plugins or /features subdirectory
+#- the location of a feature.xml, or for 2.1 style plugins, the plugin.xml or fragment.xml
+#pluginPath=
+
+
+# The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE
+# @category compiling
+# bootclasspath=${java.home}/lib/rt.jar
+
+# @category executionEnvironment
+#CDC-1.0/Foundation-1.0=
+# @category executionEnvironment
+#CDC-1.1/Foundation-1.1=
+# @category executionEnvironment
+#OSGi/Minimum-1.0=
+# @category executionEnvironment
+#OSGi/Minimum-1.1=
+# @category executionEnvironment
+#JRE-1.1=
+# @category executionEnvironment
+#J2SE-1.2=
+# @category executionEnvironment
+#J2SE-1.3=
+# @category executionEnvironment
+#J2SE-1.4=
+# @category executionEnvironment
+#J2SE-1.5=
+# @category executionEnvironment
+#JavaSE-1.6=
+# @category executionEnvironment
+#PersonalJava-1.1=
+# @category executionEnvironment
+#PersonalJava-1.2=
+# @category executionEnvironment
+#CDC-1.0/PersonalBasis-1.0=
+# @category executionEnvironment
+#CDC-1.0/PersonalJava-1.0=
+# @category executionEnvironment
+#CDC-1.1/PersonalBasis-1.1=
+# @category executionEnvironment
+#CDC-1.1/PersonalJava-1.1=
+
+# Specify the output format of the compiler log when eclipse jdt is used
+# @category compiling
+logExtension=.log
+
+# Whether or not to include debug info in the output jars
+# @category compiling
+# @type Boolean
+javacDebugInfo=false
+
+# Whether or not to fail the build if there are compiler errors
+# @category compiling
+# @type Boolean
+javacFailOnError=true
+
+# Enable or disable verbose mode of the compiler
+# @category compiling
+# @type Boolean
+javacVerbose=false
+
+# Extra arguments for the compiler. These are specific to the java compiler being used.
+# @category compiling
+#compilerArg=
+
+# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties
+# @type enum values=1.1,1.2,1.3,1.4,1.5,1.6
+# @category compiling
+#javacSource=1.3
+javacSource=1.5
+
+# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties.
+# @type enum values=1.1,1.2,1.3,1.4,1.5,1.6
+# @category compiling
+#javacTarget=1.1
+javacTarget=1.5
+
+# Set the description for the update site. The update manager shows the description in the Updates dialog.
+# @category updateSite
+updateSiteDescription=Update site generated by pluginbuilder.
+
+# There will be one category for the generated update site. Here you can set the name.
+# It is more like an id with which features refer to their category and does not appear in the GUI.
+# @category updateSite
+updateSiteCategoryName=Builds
+
+# Here you can set the Label of the category which will be displayed in the Updates dialog.
+# @category updateSite
+updateSiteCategoryLabel=Nightly Builds
+
+# Create a provisioning (p2) repository. Since Eclipse 3.4 it is recommended that you create
+# a p2 repository for your features.
+# However, the installation of old-style (pre p2) update sites is still possible.
+# @type Boolean
+# @category p2
+generate.p2.metadata=true
+
+# @category hidden
+p2.metadata.repo=file:${buildDirectory}/repo
+
+# @category hidden
+p2.artifact.repo=file:${buildDirectory}/repo
+
+# The name of the metadata repository. The Update Manager will display this name.
+# @category p2
+p2.metadata.repo.name=EasyAnt For Eclipse Update Site
+
+# The name of the artifacts repository
+# @category p2
+p2.artifact.repo.name=Artifact Repo Name
+
+# @category hidden
+p2.flavor=tooling
+# @category hidden
+p2.publish.artifacts=true
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build.xml b/org.apache.easyant4e.releng/build.xml
new file mode 100644
index 0000000..54d8485
--- /dev/null
+++ b/org.apache.easyant4e.releng/build.xml
@@ -0,0 +1,243 @@
+<!-- This script will not be uploaded to the server.
+ PLEASE DO NOT MODIFY
+ 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}
+version.full: ${version.full}
+version.qualifier: ${version.qualifier}</echo>
+ </target>
+
+</project>
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build_local.properties b/org.apache.easyant4e.releng/build_local.properties
new file mode 100644
index 0000000..c165ebd
--- /dev/null
+++ b/org.apache.easyant4e.releng/build_local.properties
@@ -0,0 +1,26 @@
+# The location of this pluginbuilder project. It provides the base directory for the build scripts.
+# @category localsettings
+# @type Directory
+buildHome=/home/jerome/tools/easyant/easyant4e.git/org.apache.easyant4e.releng
+
+# The directory where the build takes place. This directory WILL BE DELETED before every build.
+# @category localsettings
+# @type Directory
+buildDirectory=/home/jerome/pluginbuilder/org.apache.easyant4e.releng
+
+# The eclipse build host. Must be an Eclipse SDK installation with JDT and PDE. And in the case of RCP builds the RCP Delta Pack must be included, too.
+# @category localsettings
+# @type Directory
+eclipseDir=/home/jerome/tools/easyant/eclipse
+
+# Environment for both the Eclipse build and test host. Determines baseos.
+# @category localsettings
+os=linux
+
+# Environment for both the Eclipse build and test host. Determines basews.
+# @category localsettings
+ws=gtk
+
+# Environment for both the Eclipse build and test host. Determines basearch.
+# @category localsettings
+arch=x86
\ No newline at end of file
diff --git a/org.apache.easyant4e.releng/build_shared.xml b/org.apache.easyant4e.releng/build_shared.xml
new file mode 100644
index 0000000..8d17365
--- /dev/null
+++ b/org.apache.easyant4e.releng/build_shared.xml
@@ -0,0 +1,116 @@
+<project name="Shared build targets">
+ <!-- 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
+ optional:
+ <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
diff --git a/org.apache.easyant4e.releng/maps/all.map b/org.apache.easyant4e.releng/maps/all.map
new file mode 100644
index 0000000..cbbebef
--- /dev/null
+++ b/org.apache.easyant4e.releng/maps/all.map
@@ -0,0 +1,6 @@
+feature@org.apache.easyant4e.feature=COPY,/home/jerome/tools/easyant/easyant4e.git,org.apache.easyant4e.feature
+plugin@org.apache.easyant=COPY,/home/jerome/tools/easyant/easyant4e.git,org.apache.easyant
+plugin@org.apache.easyant4e=COPY,/home/jerome/tools/easyant/easyant4e.git,org.apache.easyant4e
+feature@org.apache.ivyde.feature=COPY,/home/jerome/tools/easyant/ivyde.git,org.apache.ivyde.feature
+plugin@org.apache.ivyde.eclipse=COPY,/home/jerome/tools/easyant/ivyde.git,org.apache.ivyde.eclipse
+plugin@org.apache.ivy=COPY,/home/jerome/tools/easyant,ivy.git
diff --git a/org.apache.easyant4e.releng/pluginbuilder.config b/org.apache.easyant4e.releng/pluginbuilder.config
new file mode 100644
index 0000000..6803fd6
--- /dev/null
+++ b/org.apache.easyant4e.releng/pluginbuilder.config
@@ -0,0 +1,10 @@
+#Mon Oct 19 21:52:24 GMT+01:00 2009
+autotestsuite.class.exclusions=.*All(Tests|PDE_Tests|_Tests|PDETests).*
+pluginbuilder.features=org.apache.easyant4e.feature
+pluginbuilder.is.svn=false
+autotestsuite.class.inclusions=.*
+pluginbuilder.is.runtests=false
+autotestsuite.plugin.inclusions=.*(test|tests)$
+pluginbuilder.is.cvs=false
+pluginbuilder.is.copy=true
+pluginbuilder.is.rcpbuild=false
diff --git a/org.apache.easyant4e.releng/releases/HEAD.properties b/org.apache.easyant4e.releng/releases/HEAD.properties
new file mode 100644
index 0000000..d21a3f3
--- /dev/null
+++ b/org.apache.easyant4e.releng/releases/HEAD.properties
@@ -0,0 +1,6 @@
+#Written from Plug-in Builder Editor
+#Sat Oct 17 22:41:09 GMT+01:00 2009
+buildType=N
+version=1.0.0
+fetchTag=HEAD
+buildTypePresentation=
diff --git a/org.apache.easyant4e.tests/.classpath b/org.apache.easyant4e.tests/.classpath
new file mode 100644
index 0000000..285106c
--- /dev/null
+++ b/org.apache.easyant4e.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="datas"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.apache.easyant4e.tests/.project b/org.apache.easyant4e.tests/.project
new file mode 100644
index 0000000..8b40ad6
--- /dev/null
+++ b/org.apache.easyant4e.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.easyant4e.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.apache.easyant4e.tests/.settings/org.eclipse.jdt.core.prefs b/org.apache.easyant4e.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..3210fba
--- /dev/null
+++ b/org.apache.easyant4e.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Wed Jun 17 21:58:50 GMT+01:00 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.apache.easyant4e.tests/META-INF/MANIFEST.MF b/org.apache.easyant4e.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..96add3d
--- /dev/null
+++ b/org.apache.easyant4e.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tests Plug-in
+Bundle-SymbolicName: org.apache.easyant4e.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.apache.easyant4e.tests.TestPlugin
+Require-Bundle: org.apache.easyant4e,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit4,
+ org.eclipse.core.resources,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.ui.forms,
+ org.eclipse.jdt.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.pde.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.apache.easyant.core.report
diff --git a/org.apache.easyant4e.tests/build.properties b/org.apache.easyant4e.tests/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/org.apache.easyant4e.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.apache.easyant4e.tests/datas/simplejavaproject/.classpath b/org.apache.easyant4e.tests/datas/simplejavaproject/.classpath
new file mode 100644
index 0000000..c6adc53
--- /dev/null
+++ b/org.apache.easyant4e.tests/datas/simplejavaproject/.classpath
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry excluding="/simplejavaproject/target" kind="src" output="target" path="src/main/java"/>
+ <classpathentry excluding="/simplejavaproject/target" kind="src" output="target" path="src/main/resources"/>
+ <classpathentry excluding="/simplejavaproject/target" kind="src" output="target" path="src/test/java"/>
+ <classpathentry excluding="/simplejavaproject/target" kind="src" output="target" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/module.ivy/*"/>
+ <classpathentry kind="output" path="target"/>
+</classpath>
diff --git a/org.apache.easyant4e.tests/datas/simplejavaproject/.project b/org.apache.easyant4e.tests/datas/simplejavaproject/.project
new file mode 100644
index 0000000..8df07c7
--- /dev/null
+++ b/org.apache.easyant4e.tests/datas/simplejavaproject/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>simplejavaproject</name>
+ <comment>simplejavaproject description</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.apache.easyant4e.EasyAntBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.apache.easyant4e.EasyAntNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.apache.easyant4e.tests/datas/simplejavaproject/module.ivy b/org.apache.easyant4e.tests/datas/simplejavaproject/module.ivy
new file mode 100644
index 0000000..aeb4b6b
--- /dev/null
+++ b/org.apache.easyant4e.tests/datas/simplejavaproject/module.ivy
@@ -0,0 +1,26 @@
+<!--
+ Copyright 2008 the EasyAnt project
+
+ See the NOTICE file distributed with this work for additional information
+ regarding copyright ownership.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ 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>
+</ivy-module>
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/AbstractEasyAntTest.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/AbstractEasyAntTest.java
new file mode 100644
index 0000000..35babc9
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/AbstractEasyAntTest.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.EasyAntPlugin;
+import org.apache.easyant4e.services.EasyantCoreService;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.ui.IPackagesViewPart;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.junit.After;
+import org.junit.Before;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+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;
+ }
+ }
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyAntAllTests.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyAntAllTests.java
new file mode 100644
index 0000000..58d8274
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyAntAllTests.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+@RunWith(Suite.class)
+@SuiteClasses(value = {
+ ImportProjectTest.class,
+ StartupTest.class,
+ EasyantCoreServiceTest.class,
+ EasyantProjectServiceTest.class
+
+})
+public class EasyAntAllTests {
+
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantCoreServiceTest.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantCoreServiceTest.java
new file mode 100644
index 0000000..97a5a01
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantCoreServiceTest.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.services.EasyantCoreService;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyantCoreServiceTest extends AbstractEasyAntTest {
+
+/*
+ @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);
+ }
+
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantProjectServiceTest.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantProjectServiceTest.java
new file mode 100644
index 0000000..d0028b9
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EasyantProjectServiceTest.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.apache.easyant.core.report.PhaseReport;
+import org.apache.easyant.core.report.TargetReport;
+import org.apache.easyant4e.EasyAntConstants;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.junit.Test;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyantProjectServiceTest extends AbstractEasyAntTest {
+
+/*
+ @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());
+ }
+ }
+
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EclipseProjectBuilder.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EclipseProjectBuilder.java
new file mode 100644
index 0000000..c1e3a76
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/EclipseProjectBuilder.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.JavaRuntime;
+
+/**
+ * This is a modified version of the TestProject class written by Erich Gamma
+ * and Kent Beck and described in their book
+ * "Contributing to Eclipse: Principles, Patterns, and Plug-Ins" It's largely
+ * inspired by Spring IDE TestSuite
+ */
+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);
+ // }
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ExtensionRegistryTest.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ExtensionRegistryTest.java
new file mode 100644
index 0000000..d2c44ae
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ExtensionRegistryTest.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.eclipse.core.internal.registry.ExtensionRegistry;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IContributor;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.core.runtime.spi.IDynamicExtensionRegistry;
+import org.junit.Test;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+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"));
+
+ 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 Object getUserToken() {
+// IExtensionRegistry registry = RegistryFactory.getRegistry();
+// // return null; // require -Declipse.registry.nulltoken=true
+// return ((ExtensionRegistry) registry).getTemporaryUserToken();
+// }
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ImportProjectTest.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ImportProjectTest.java
new file mode 100644
index 0000000..3c78a2d
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/ImportProjectTest.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.EasyAntPlugin;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.core.plugin.PluginRegistry;
+import org.eclipse.pde.internal.core.util.CoreUtility;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.inject.Inject;
+
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+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;
+ }
+
+ @After
+ public void tearDown() throws CoreException {
+ if(simpleJavaProject!=null){
+ EclipseProjectBuilder.deleteProject(simpleJavaProject,false);
+ }
+ }
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/StartupTest.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/StartupTest.java
new file mode 100644
index 0000000..e9e84bb
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/StartupTest.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.EasyAntPlugin;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.navigator.ResourceNavigator;
+import org.junit.Test;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class StartupTest extends AbstractEasyAntTest{
+
+ @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;
+ }
+
+}
diff --git a/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/TestPlugin.java b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/TestPlugin.java
new file mode 100644
index 0000000..762452f
--- /dev/null
+++ b/org.apache.easyant4e.tests/src/org/apache/easyant4e/tests/TestPlugin.java
@@ -0,0 +1,50 @@
+package org.apache.easyant4e.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class TestPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.apache.easyant4e.tests";
+
+ // The shared instance
+ private static TestPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public TestPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static TestPlugin getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/org.apache.easyant4e/.checkstyle b/org.apache.easyant4e/.checkstyle
new file mode 100644
index 0000000..2984dfe
--- /dev/null
+++ b/org.apache.easyant4e/.checkstyle
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <local-check-config name="EasyAnt4E" location="/quality/checkstyle/checkstyle-config" type="project" description="">
+ <property name="checkstyle.src.dir" value="${basedir}/../quality/checkstyle"/>
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="tous" enabled="true" check-config-name="EasyAnt4E" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/org.apache.easyant4e/.classpath b/org.apache.easyant4e/.classpath
new file mode 100644
index 0000000..edcdd29
--- /dev/null
+++ b/org.apache.easyant4e/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib" path="lib/guice/guice-2.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/guice/aopalliance.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.apache.easyant4e/.fbprefs b/org.apache.easyant4e/.fbprefs
new file mode 100644
index 0000000..621c424
--- /dev/null
+++ b/org.apache.easyant4e/.fbprefs
@@ -0,0 +1,124 @@
+#FindBugs User Preferences
+#Sun Apr 19 13:12:13 GMT+01:00 2009
+detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
+detectorBadAppletConstructor=BadAppletConstructor|false
+detectorBadResultSetAccess=BadResultSetAccess|true
+detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true
+detectorBadUseOfReturnValue=BadUseOfReturnValue|true
+detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
+detectorBooleanReturnNull=BooleanReturnNull|true
+detectorCallToUnsupportedMethod=CallToUnsupportedMethod|true
+detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
+detectorCheckTypeQualifiers=CheckTypeQualifiers|true
+detectorCloneIdiom=CloneIdiom|true
+detectorComparatorIdiom=ComparatorIdiom|true
+detectorConfusedInheritance=ConfusedInheritance|true
+detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
+detectorCrossSiteScripting=CrossSiteScripting|true
+detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true
+detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true
+detectorDontUseEnum=DontUseEnum|true
+detectorDroppedException=DroppedException|true
+detectorDumbMethodInvocations=DumbMethodInvocations|true
+detectorDumbMethods=DumbMethods|true
+detectorDuplicateBranches=DuplicateBranches|true
+detectorEmptyZipFileEntry=EmptyZipFileEntry|true
+detectorEqualsOperandShouldHaveClassCompatibleWithThis=EqualsOperandShouldHaveClassCompatibleWithThis|true
+detectorFinalizerNullsFields=FinalizerNullsFields|true
+detectorFindBadCast2=FindBadCast2|true
+detectorFindBadForLoop=FindBadForLoop|true
+detectorFindCircularDependencies=FindCircularDependencies|false
+detectorFindDeadLocalStores=FindDeadLocalStores|true
+detectorFindDoubleCheck=FindDoubleCheck|true
+detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true
+detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true
+detectorFindFinalizeInvocations=FindFinalizeInvocations|true
+detectorFindFloatEquality=FindFloatEquality|true
+detectorFindHEmismatch=FindHEmismatch|true
+detectorFindInconsistentSync2=FindInconsistentSync2|true
+detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true
+detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true
+detectorFindMaskedFields=FindMaskedFields|true
+detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true
+detectorFindNakedNotify=FindNakedNotify|true
+detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true
+detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true
+detectorFindNonShortCircuit=FindNonShortCircuit|true
+detectorFindNullDeref=FindNullDeref|true
+detectorFindNullDerefsInvolvingNonShortCircuitEvaluation=FindNullDerefsInvolvingNonShortCircuitEvaluation|true
+detectorFindOpenStream=FindOpenStream|true
+detectorFindPuzzlers=FindPuzzlers|true
+detectorFindRefComparison=FindRefComparison|true
+detectorFindReturnRef=FindReturnRef|true
+detectorFindRunInvocations=FindRunInvocations|true
+detectorFindSelfComparison=FindSelfComparison|true
+detectorFindSelfComparison2=FindSelfComparison2|true
+detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true
+detectorFindSpinLoop=FindSpinLoop|true
+detectorFindSqlInjection=FindSqlInjection|true
+detectorFindTwoLockWait=FindTwoLockWait|true
+detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true
+detectorFindUnconditionalWait=FindUnconditionalWait|true
+detectorFindUninitializedGet=FindUninitializedGet|true
+detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true
+detectorFindUnreleasedLock=FindUnreleasedLock|true
+detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|true
+detectorFindUnsyncGet=FindUnsyncGet|true
+detectorFindUselessControlFlow=FindUselessControlFlow|true
+detectorFormatStringChecker=FormatStringChecker|true
+detectorHugeSharedStringConstants=HugeSharedStringConstants|true
+detectorIDivResultCastToDouble=IDivResultCastToDouble|true
+detectorIncompatMask=IncompatMask|true
+detectorInconsistentAnnotations=InconsistentAnnotations|true
+detectorInefficientMemberAccess=InefficientMemberAccess|false
+detectorInefficientToArray=InefficientToArray|true
+detectorInfiniteLoop=InfiniteLoop|true
+detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
+detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|false
+detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
+detectorInitializationChain=InitializationChain|true
+detectorInstantiateStaticClass=InstantiateStaticClass|true
+detectorInvalidJUnitTest=InvalidJUnitTest|true
+detectorIteratorIdioms=IteratorIdioms|true
+detectorLazyInit=LazyInit|true
+detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true
+detectorMethodReturnCheck=MethodReturnCheck|true
+detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true
+detectorMutableLock=MutableLock|true
+detectorMutableStaticFields=MutableStaticFields|true
+detectorNaming=Naming|true
+detectorNumberConstructor=NumberConstructor|true
+detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
+detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
+detectorPublicSemaphores=PublicSemaphores|false
+detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
+detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true
+detectorRedundantInterfaces=RedundantInterfaces|true
+detectorRepeatedConditionals=RepeatedConditionals|true
+detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true
+detectorSerializableIdiom=SerializableIdiom|true
+detectorStartInConstructor=StartInConstructor|true
+detectorStaticCalendarDetector=StaticCalendarDetector|true
+detectorStringConcatenation=StringConcatenation|true
+detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true
+detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true
+detectorSwitchFallthrough=SwitchFallthrough|true
+detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true
+detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true
+detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true
+detectorURLProblems=URLProblems|true
+detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true
+detectorUnnecessaryMath=UnnecessaryMath|true
+detectorUnreadFields=UnreadFields|true
+detectorUseObjectEquals=UseObjectEquals|false
+detectorUselessSubclassMethod=UselessSubclassMethod|false
+detectorVarArgsProblems=VarArgsProblems|true
+detectorVolatileUsage=VolatileUsage|true
+detectorWaitInLoop=WaitInLoop|true
+detectorWrongMapIterator=WrongMapIterator|true
+detectorXMLFactoryBypass=XMLFactoryBypass|true
+detector_threshold=2
+effort=default
+filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,MT_CORRECTNESS,PERFORMANCE,STYLE|false
+filter_settings_neg=I18N,NOISE,MALICIOUS_CODE,SECURITY,EXPERIMENTAL|
+run_at_full_build=true
diff --git a/org.apache.easyant4e/.pmd b/org.apache.easyant4e/.pmd
new file mode 100644
index 0000000..726c68f
--- /dev/null
+++ b/org.apache.easyant4e/.pmd
@@ -0,0 +1,941 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pmd>
+ <useProjectRuleSet>false</useProjectRuleSet>
+ <ruleSetFile>.ruleset</ruleSetFile>
+ <rules>
+ <rule>
+ <name>AvoidDecimalLiteralsInBigDecimalConstructor</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidMultipleUnaryOperators</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidThreadGroup</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidUsingHardCodedIP</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidUsingOctalValues</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>BigIntegerInstantiation</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>BooleanInstantiation</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>BrokenNullCheck</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CheckResultSet</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ClassCastExceptionWithToArray</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CollapsibleIfStatements</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DoubleCheckedLocking</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyCatchBlock</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyFinallyBlock</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyIfStmt</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyInitializer</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyStatementNotInLoop</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyStaticInitializer</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptySwitchStatements</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptySynchronizedBlock</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyTryBlock</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyWhileStmt</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ForLoopShouldBeWhileLoop</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JumbledIncrementer</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MisplacedNullCheck</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>OverrideBothEqualsAndHashcode</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ReturnFromFinallyBlock</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnconditionalIfStatement</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryConversionTemporary</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryFinalModifier</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryReturn</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnusedNullCheckInEquals</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UselessOperationOnImmutable</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UselessOverridingMethod</name>
+ <ruleset>Basic Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ForLoopsMustUseBraces</name>
+ <ruleset>Braces Rules</ruleset>
+ </rule>
+ <rule>
+ <name>IfElseStmtsMustUseBraces</name>
+ <ruleset>Braces Rules</ruleset>
+ </rule>
+ <rule>
+ <name>IfStmtsMustUseBraces</name>
+ <ruleset>Braces Rules</ruleset>
+ </rule>
+ <rule>
+ <name>WhileLoopsMustUseBraces</name>
+ <ruleset>Braces Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CloneThrowsCloneNotSupportedException</name>
+ <ruleset>Clone Implementation Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ProperCloneImplementation</name>
+ <ruleset>Clone Implementation Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CyclomaticComplexity</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ExcessiveClassLength</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ExcessiveMethodLength</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ExcessiveParameterList</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ExcessivePublicCount</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NcssConstructorCount</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NcssMethodCount</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NcssTypeCount</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NPathComplexity</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>TooManyFields</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>TooManyMethods</name>
+ <ruleset>Code Size Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AssignmentInOperand</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AtLeastOneConstructor</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidAccessibilityAlteration</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidFinalLocalVariable</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidUsingNativeCode</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidUsingShortType</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidUsingVolatile</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>BooleanInversion</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CallSuperInConstructor</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DataflowAnomalyAnalysis</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DefaultPackage</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DoNotCallGarbageCollectionExplicitly</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DontImportSun</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NullAssignment</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>OnlyOneReturn</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SuspiciousOctalEscape</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryConstructor</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryParentheses</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnusedModifier</name>
+ <ruleset>Controversial Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CouplingBetweenObjects</name>
+ <ruleset>Coupling Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ExcessiveImports</name>
+ <ruleset>Coupling Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AbstractClassWithoutAbstractMethod</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AbstractClassWithoutAnyMethod</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AccessorClassGeneration</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AssignmentToNonFinalStatic</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidConstantsInterface</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidDeeplyNestedIfStmts</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidInstanceofChecksInCatchClause</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidProtectedFieldInFinalClass</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidReassigningParameters</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidSynchronizedAtMethodLevel</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>BadComparison</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ClassWithOnlyPrivateConstructorsShouldBeFinal</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CloseResource</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CompareObjectsWithEquals</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ConfusingTernary</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ConstructorCallsOverridableMethod</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DefaultLabelNotLastInSwitchStmt</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyMethodInAbstractClassShouldBeAbstract</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EqualsNull</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>FinalFieldCouldBeStatic</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>IdempotentOperations</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ImmutableField</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>InstantiationToGetClass</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MissingBreakInSwitch</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MissingStaticMethodInNonInstantiatableClass</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NonCaseLabelInSwitchStatement</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NonStaticInitializer</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NonThreadSafeSingleton</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>OptimizableToArrayCall</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>PositionLiteralsFirstInComparisons</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>PreserveStackTrace</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ReturnEmptyArrayRatherThanNull</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SimpleDateFormatNeedsLocale</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SimplifyBooleanExpressions</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SimplifyBooleanReturns</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SimplifyConditional</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SingularField</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SwitchDensity</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SwitchStmtsShouldHaveDefault</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>TooFewBranchesForASwitchStatement</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UncommentedEmptyConstructor</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UncommentedEmptyMethod</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryLocalBeforeReturn</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnsynchronizedStaticDateFormatter</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseCollectionIsEmpty</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseLocaleWithCaseConversions</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseNotifyAllInsteadOfNotify</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseSingleton</name>
+ <ruleset>Design Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidCallingFinalize</name>
+ <ruleset>Finalizer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>EmptyFinalizer</name>
+ <ruleset>Finalizer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>FinalizeDoesNotCallSuperFinalize</name>
+ <ruleset>Finalizer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>FinalizeOnlyCallsSuperFinalize</name>
+ <ruleset>Finalizer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>FinalizeOverloaded</name>
+ <ruleset>Finalizer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>FinalizeShouldBeProtected</name>
+ <ruleset>Finalizer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DontImportJavaLang</name>
+ <ruleset>Import Statement Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DuplicateImports</name>
+ <ruleset>Import Statement Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ImportFromSamePackage</name>
+ <ruleset>Import Statement Rules</ruleset>
+ </rule>
+ <rule>
+ <name>TooManyStaticImports</name>
+ <ruleset>Import Statement Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DoNotCallSystemExit</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DoNotUseThreads</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>LocalHomeNamingConvention</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>LocalInterfaceSessionNamingConvention</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MDBAndSessionBeanNamingConvention</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>RemoteInterfaceNamingConvention</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>RemoteSessionInterfaceNamingConvention</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>StaticEJBFieldShouldBeFinal</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseProperClassLoader</name>
+ <ruleset>J2EE Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ProperLogger</name>
+ <ruleset>Jakarta Commons Logging Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseCorrectExceptionLogging</name>
+ <ruleset>Jakarta Commons Logging Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidPrintStackTrace</name>
+ <ruleset>Java Logging Rules</ruleset>
+ </rule>
+ <rule>
+ <name>LoggerIsNotStaticFinal</name>
+ <ruleset>Java Logging Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MoreThanOneLogger</name>
+ <ruleset>Java Logging Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SystemPrintln</name>
+ <ruleset>Java Logging Rules</ruleset>
+ </rule>
+ <rule>
+ <name>BeanMembersShouldSerialize</name>
+ <ruleset>JavaBean Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MissingSerialVersionUID</name>
+ <ruleset>JavaBean Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnitAssertionsShouldIncludeMessage</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnitSpelling</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnitStaticSuite</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnitTestsShouldIncludeAssert</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SimplifyBooleanAssertion</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>TestClassWithoutTestCases</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryBooleanAssertion</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseAssertEqualsInsteadOfAssertTrue</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseAssertNullInsteadOfAssertTrue</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseAssertSameInsteadOfAssertTrue</name>
+ <ruleset>JUnit Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidAssertAsIdentifier</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidEnumAsIdentifier</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ByteInstantiation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>IntegerInstantiation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnit4SuitesShouldUseSuiteAnnotation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnit4TestShouldUseAfterAnnotation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnit4TestShouldUseBeforeAnnotation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnit4TestShouldUseTestAnnotation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>JUnitUseExpected</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>LongInstantiation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ReplaceEnumerationWithIterator</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ReplaceHashtableWithMap</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ReplaceVectorWithList</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ShortInstantiation</name>
+ <ruleset>Migration Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AbstractNaming</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidDollarSigns</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidFieldNameMatchingMethodName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidFieldNameMatchingTypeName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>BooleanGetMethodName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ClassNamingConventions</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>LongVariable</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MethodNamingConventions</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MethodWithSameNameAsEnclosingClass</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MisleadingVariableName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>NoPackage</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>PackageCase</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ShortMethodName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ShortVariable</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SuspiciousConstantFieldName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SuspiciousEqualsMethodName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SuspiciousHashcodeMethodName</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>VariableNamingConventions</name>
+ <ruleset>Naming Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AddEmptyString</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidArrayLoops</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidInstantiatingObjectsInLoops</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>LocalVariableCouldBeFinal</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>MethodArgumentCouldBeFinal</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SimplifyStartsWith</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryWrapperObjectCreation</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseArrayListInsteadOfVector</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseArraysAsList</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseStringBufferForStringAppends</name>
+ <ruleset>Optimization Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ArrayIsStoredDirectly</name>
+ <ruleset>Security Code Guidelines</ruleset>
+ </rule>
+ <rule>
+ <name>MethodReturnsInternalArray</name>
+ <ruleset>Security Code Guidelines</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidCatchingNPE</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidCatchingThrowable</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidRethrowingException</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidThrowingNewInstanceOfSameException</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidThrowingNullPointerException</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidThrowingRawExceptionTypes</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DoNotExtendJavaLangError</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>DoNotThrowExceptionInFinally</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ExceptionAsFlowControl</name>
+ <ruleset>Strict Exception Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AppendCharacterWithChar</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidDuplicateLiterals</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>AvoidStringBufferField</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>ConsecutiveLiteralAppends</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>InefficientEmptyStringCheck</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>InefficientStringBuffering</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>InsufficientStringBufferDeclaration</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>StringBufferInstantiationWithChar</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>StringInstantiation</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>StringToString</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnnecessaryCaseChange</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseEqualsToCompareStrings</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseIndexOfChar</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UselessStringValueOf</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UseStringBufferLength</name>
+ <ruleset>String and StringBuffer Rules</ruleset>
+ </rule>
+ <rule>
+ <name>CloneMethodMustImplementCloneable</name>
+ <ruleset>Type Resolution Rules</ruleset>
+ </rule>
+ <rule>
+ <name>LooseCoupling</name>
+ <ruleset>Type Resolution Rules</ruleset>
+ </rule>
+ <rule>
+ <name>SignatureDeclareThrowsException</name>
+ <ruleset>Type Resolution Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnusedImports</name>
+ <ruleset>Type Resolution Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnusedFormalParameter</name>
+ <ruleset>Unused Code Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnusedLocalVariable</name>
+ <ruleset>Unused Code Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnusedPrivateField</name>
+ <ruleset>Unused Code Rules</ruleset>
+ </rule>
+ <rule>
+ <name>UnusedPrivateMethod</name>
+ <ruleset>Unused Code Rules</ruleset>
+ </rule>
+ </rules>
+ <includeDerivedFiles>false</includeDerivedFiles>
+ <violationsAsErrors>true</violationsAsErrors>
+</pmd>
diff --git a/org.apache.easyant4e/.project b/org.apache.easyant4e/.project
new file mode 100644
index 0000000..2cc8f8f
--- /dev/null
+++ b/org.apache.easyant4e/.project
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.easyant4e</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
+ <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.apache.easyant4e/.settings/org.eclipse.jdt.core.prefs b/org.apache.easyant4e/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..85e2ac9
--- /dev/null
+++ b/org.apache.easyant4e/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Apr 10 17:04:56 GMT+01:00 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.apache.easyant4e/META-INF/MANIFEST.MF b/org.apache.easyant4e/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..dd53b36
--- /dev/null
+++ b/org.apache.easyant4e/META-INF/MANIFEST.MF
@@ -0,0 +1,40 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.apache.easyant4e;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .,
+ lib/guice/aopalliance.jar,
+ lib/guice/guice-2.0.jar
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle:
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.jdt.core,
+ org.eclipse.ui,
+ org.eclipse.jdt.ui,
+ org.eclipse.ui.forms,
+ org.eclipse.ui.console,
+ org.eclipse.ui.ide,
+ org.eclipse.jface.text,
+ org.eclipse.jdt.launching,
+ org.apache.easyant,
+ org.apache.ivyde.eclipse
+Bundle-Activator: org.apache.easyant4e.Activator
+Bundle-ActivationPolicy: lazy
+Export-Package: com.google.inject,
+ org.apache.easyant4e,
+ org.apache.easyant4e.ant.editor,
+ org.apache.easyant4e.builders,
+ org.apache.easyant4e.configurers,
+ org.apache.easyant4e.console,
+ org.apache.easyant4e.ivyde.extension,
+ org.apache.easyant4e.ivyde.extension.model,
+ org.apache.easyant4e.ivyde.extension.page,
+ org.apache.easyant4e.modules,
+ org.apache.easyant4e.natures,
+ org.apache.easyant4e.providers,
+ org.apache.easyant4e.services,
+ org.apache.easyant4e.wizards
diff --git a/org.apache.easyant4e/TODO.txt b/org.apache.easyant4e/TODO.txt
new file mode 100644
index 0000000..0d75e07
--- /dev/null
+++ b/org.apache.easyant4e/TODO.txt
@@ -0,0 +1,14 @@
+* support different kind of project (java, scala)
+* update ivyDE setting when project.ivysettings.file change, when a user edit the module.ivy file
+* use checksum or version number to reinstall the local repository
+ou juste checker par rapport au qualifier
+* add internal package
+* Add Preference to manager EasyAnt core preferences (i.e: ivysettings configuration)
+* Add cool icons everywhere
+* create a new project from EasyAnt skeleton
+* Add I18N
+* Add launch config to run EaysAnt build
+===============================================================
+* bug en mode buildé : affichage en vert dans la console du message "BUILD FAILED"
+* lorsque l'on crée les source folder, tester l'existance des répertoires : ouvrir une popup pour demander à l'utilisateur ... checker cela notamment pour le multimodule
+
diff --git a/org.apache.easyant4e/build.properties b/org.apache.easyant4e/build.properties
new file mode 100644
index 0000000..7151f70
--- /dev/null
+++ b/org.apache.easyant4e/build.properties
@@ -0,0 +1,16 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ icons/,\
+ lib/guice/aopalliance.jar,\
+ lib/guice/guice-2.0.jar
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/org.apache.easyant4e/icons/EasyAnt-logo.gif b/org.apache.easyant4e/icons/EasyAnt-logo.gif
new file mode 100644
index 0000000..ea18794
--- /dev/null
+++ b/org.apache.easyant4e/icons/EasyAnt-logo.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/EasyAntNature.gif b/org.apache.easyant4e/icons/EasyAntNature.gif
new file mode 100755
index 0000000..6df3469
--- /dev/null
+++ b/org.apache.easyant4e/icons/EasyAntNature.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/build.gif b/org.apache.easyant4e/icons/build.gif
new file mode 100644
index 0000000..762fff4
--- /dev/null
+++ b/org.apache.easyant4e/icons/build.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/console.gif b/org.apache.easyant4e/icons/console.gif
new file mode 100644
index 0000000..a598f60
--- /dev/null
+++ b/org.apache.easyant4e/icons/console.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/console.png b/org.apache.easyant4e/icons/console.png
new file mode 100644
index 0000000..e767bc6
--- /dev/null
+++ b/org.apache.easyant4e/icons/console.png
Binary files differ
diff --git a/org.apache.easyant4e/icons/debug_loglevel.gif b/org.apache.easyant4e/icons/debug_loglevel.gif
new file mode 100644
index 0000000..ac5431f
--- /dev/null
+++ b/org.apache.easyant4e/icons/debug_loglevel.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/default_incremental.gif b/org.apache.easyant4e/icons/default_incremental.gif
new file mode 100644
index 0000000..fbcf2f8
--- /dev/null
+++ b/org.apache.easyant4e/icons/default_incremental.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/form_banner.gif b/org.apache.easyant4e/icons/form_banner.gif
new file mode 100644
index 0000000..aebc0b2
--- /dev/null
+++ b/org.apache.easyant4e/icons/form_banner.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/full/obj16/ant_buildfile.gif b/org.apache.easyant4e/icons/full/obj16/ant_buildfile.gif
new file mode 100755
index 0000000..6df3469
--- /dev/null
+++ b/org.apache.easyant4e/icons/full/obj16/ant_buildfile.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/phase.gif b/org.apache.easyant4e/icons/phase.gif
new file mode 100644
index 0000000..84f4af5
--- /dev/null
+++ b/org.apache.easyant4e/icons/phase.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/sa_onesample48.gif b/org.apache.easyant4e/icons/sa_onesample48.gif
new file mode 100644
index 0000000..e65c123
--- /dev/null
+++ b/org.apache.easyant4e/icons/sa_onesample48.gif
Binary files differ
diff --git a/org.apache.easyant4e/icons/target.gif b/org.apache.easyant4e/icons/target.gif
new file mode 100644
index 0000000..146a903
--- /dev/null
+++ b/org.apache.easyant4e/icons/target.gif
Binary files differ
diff --git a/org.apache.easyant4e/lib/guice/aopalliance.jar b/org.apache.easyant4e/lib/guice/aopalliance.jar
new file mode 100644
index 0000000..578b1a0
--- /dev/null
+++ b/org.apache.easyant4e/lib/guice/aopalliance.jar
Binary files differ
diff --git a/org.apache.easyant4e/lib/guice/guice-2.0.jar b/org.apache.easyant4e/lib/guice/guice-2.0.jar
new file mode 100644
index 0000000..204c4c2
--- /dev/null
+++ b/org.apache.easyant4e/lib/guice/guice-2.0.jar
Binary files differ
diff --git a/org.apache.easyant4e/plugin.properties b/org.apache.easyant4e/plugin.properties
new file mode 100644
index 0000000..71bcc6a
--- /dev/null
+++ b/org.apache.easyant4e/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+pluginName = Easyant for Eclipse
+providerName = www.easyant.org
diff --git a/org.apache.easyant4e/plugin.xml b/org.apache.easyant4e/plugin.xml
new file mode 100644
index 0000000..3325c66
--- /dev/null
+++ b/org.apache.easyant4e/plugin.xml
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ <copyright>
+ </copyright>
+
+ $Id$
+-->
+
+<plugin>
+ <extension
+ point="org.eclipse.core.resources.natures" id="EasyAntNature" name="EasyAntNature">
+ <runtime>
+ <run class="org.apache.easyant4e.natures.EasyAntNature" />
+ </runtime>
+ </extension>
+
+ <extension point="org.eclipse.core.resources.builders" id="EasyAntBuilder" name="EasyAntBuilder">
+ <builder>
+ <run class="org.apache.easyant4e.builders.EasyAntBuilder" />
+ </builder>
+ </extension>
+
+ <extension point="org.eclipse.ui.ide.projectNatureImages">
+ <image
+ id="org.apache.easyant4e.natures.EasyAntNatureImage"
+ natureId="org.apache.easyant4e.EasyAntNature"
+ icon="icons/EasyAntNature.gif">
+ </image>
+ </extension>
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="true"
+ objectClass="org.eclipse.core.resources.IProject"
+ nameFilter="*"
+ id="org.apache.easyant4e.ui.popupMenus.contribution.IProject">
+ <menu id="org.apache.easyant4e.ui.menu" label="EasyAnt" path="additionsEasyAnt">
+ <groupMarker name="nature"/>
+ </menu>
+ <action
+ class="org.apache.easyant4e.natures.AddEasyAntNatureAction"
+ enablesFor="1"
+ id="org.apache.easyant4e.natures.AddEasyAntNatureAction"
+ icon = "icons/EasyAntNature.gif"
+ label="Convert Project to EasyAnt Project..."
+ menubarPath="org.apache.easyant4e.ui.menu/nature">
+ </action>
+ <action
+ class="org.apache.easyant4e.natures.RemoveEasyAntNatureAction"
+ enablesFor="1"
+ id="org.apache.easyant4e.natures.RemoveEasyAntNatureAction"
+ icon = "icons/EasyAntNature.gif"
+ label="Remove EasyAnt Nature..."
+ menubarPath="org.apache.easyant4e.ui.menu/nature">
+ </action>
+ </objectContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.importWizards">
+ <wizard
+ class="org.apache.easyant4e.wizards.EasyAntImportWizard"
+ id="org.apache.easyant4e.wizards.EasyAntImportWizard"
+ category="org.apache.easyant4e.wizards.category"
+ name="Existing EasyAnt Project"
+ icon="icons/EasyAntNature.gif">
+ <description>Import an existing EasyAnt Project</description>
+ </wizard>
+ <category
+ id="org.apache.easyant4e.wizards.category"
+ name="EasyAnt">
+ </category>
+ </extension>
+
+ <extension
+ point="org.apache.ivyde.eclipse.moduleDescriptorExtension">
+ <moduleDescriptor
+ modelContributorClass="org.apache.easyant4e.ivyde.extension.model.EasyAntModuleDescriptorExtension"></moduleDescriptor>
+ </extension>
+ <extension
+ point="org.apache.ivyde.eclipse.editorPage">
+ <editorPage
+ pageClass="org.apache.easyant4e.ivyde.extension.page.BuildPage">
+ </editorPage>
+ </extension>
+
+ <extension point="org.eclipse.ui.console.consoleFactories">
+ <consoleFactory
+ label="EasyAnt Console"
+ class="org.apache.easyant4e.console.EasyAntConsoleFactory"
+ icon="icons/full/obj16/ant_buildfile.gif">
+ </consoleFactory>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.apache.easyant4e.Startup"></startup>
+ </extension>
+ <!--
+ <extension
+ point="org.eclipse.ant.core.antTasks">
+ <antTask
+ class="org.apache.easyant.tasks.CoreRevisionCheckerTask"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.CoreRevisionCheckerTask">
+ </antTask>
+ <antTask
+ class="org.apache.easyant.tasks.Import"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.Import">
+ </antTask>
+ <antTask
+ class="org.apache.easyant.tasks.LoadModule"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.LoadModule">
+ </antTask>
+ <antTask
+ class="org.apache.easyant.tasks.ParameterTask"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.ParameterTask">
+ </antTask>
+ <antTask
+ class="org.apache.easyant.tasks.PathTask"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.PathTask">
+ </antTask>
+ <antTask
+ class="org.apache.easyant.tasks.PropertyTask"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.PropertyTask">
+ </antTask>
+ <antTask
+ class="org.apache.easyant.tasks.RepositoryReport"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.RepositoryReport">
+ </antTask>
+ <antTask
+ class="org.apache.easyant.tasks.SubModule"
+ library="lib/easyant-core.jar"
+ name="org.apache.easyant.tasks.SubModule">
+ </antTask>
+ </extension>
+ -->
+<!--
+ <extension
+ point="org.eclipse.ui.console.consolePageParticipants">
+ <consolePageParticipant
+ class="org.apache.easyant4e.console.EasyAntConsolePageParticipant"
+ id="org.apache.easyant4e.console.EasyAntConsolePageParticipant">
+ <enablement>
+ <instanceof
+ value="org.apache.easyant4e.console.EasyAntConsole">
+ </instanceof></enablement>
+ </consolePageParticipant>
+ </extension>
+-->
+
+ <!--
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.apache.easyant4e.ant.editor.AntEditor"
+ extensions="ant"
+ icon="icons/full/obj16/ant_buildfile.gif"
+ id="org.eclipse.ant.ui.internal.editor.AntEditor"
+ name="EasyAnt Editor">
+ <contentTypeBinding
+ contentTypeId="org.eclipse.ant.core.antBuildFile"/>
+ </editor>
+ </extension>
+ -->
+
+</plugin>
diff --git a/org.apache.easyant4e/src/ivysettings-remote.xml b/org.apache.easyant4e/src/ivysettings-remote.xml
new file mode 100644
index 0000000..6e0a1d1
--- /dev/null
+++ b/org.apache.easyant4e/src/ivysettings-remote.xml
@@ -0,0 +1,45 @@
+<!--
+ Copyright 2008-2009 the EasyAnt project
+
+ See the NOTICE file distributed with this work for additional information
+ regarding copyright ownership.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<ivysettings>
+ <settings defaultResolver="main"/>
+ <property name="easyant.repo.url" value="http://repository.easyant.org"/>
+ <!-- Directory use by ivy retreive in order to store modules (plugins and build types) -->
+ <property name="easyant.modules.dir" value="${user.home}/.easyant/modules"/>
+ <resolvers>
+ <filesystem name="local">
+ <ivy pattern="${easyant.modules.dir}/[organisation]/[module]/[revision]/[module].ivy" />
+ <artifact pattern="${easyant.modules.dir}/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]"/>
+ </filesystem>
+ <!-- EasyAnt modules -->
+ <url name="easyant-modules">
+ <ivy pattern="${easyant.repo.url}/modules/[organisation]/[module]/[revision]/[module].ivy" />
+ <artifact pattern="${easyant.repo.url}/modules/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]"/>
+ </url>
+ <!-- External required libraries -->
+ <url name="easyant-shared">
+ <ivy pattern="${easyant.repo.url}/shared/[organisation]/[module]/[revision]/[module].ivy" />
+ <artifact pattern="${easyant.repo.url}/shared/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]"/>
+ </url>
+ <chain name="main" returnFirst="true">
+ <resolver ref="local"/>
+ <resolver ref="easyant-modules" />
+ <resolver ref="easyant-shared" />
+ </chain>
+ </resolvers>
+</ivysettings>
diff --git a/org.apache.easyant4e/src/ivysettings.xml b/org.apache.easyant4e/src/ivysettings.xml
new file mode 100644
index 0000000..72c53fe
--- /dev/null
+++ b/org.apache.easyant4e/src/ivysettings.xml
@@ -0,0 +1,40 @@
+<!--
+ Copyright 2008-2009 the EasyAnt project
+
+ See the NOTICE file distributed with this work for additional information
+ regarding copyright ownership.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<ivysettings>
+ <settings defaultResolver="main"/>
+ <caches useOrigin="true" defaultCacheDir="${user.home}/.easyant/easyant-cache" />
+ <!-- Directory use by ivy retreive in order to store modules (plugins and build types) -->
+ <property name="easyant.repo.dir" value="${user.home}/.easyant/easyant-repository"/>
+ <resolvers>
+ <!-- EasyAnt modules -->
+ <filesystem name="easyant-modules">
+ <ivy pattern="${easyant.repo.dir}/modules/[organisation]/[module]/[revision]/[module].ivy"/>
+ <artifact pattern="${easyant.repo.dir}/modules/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]"/>
+ </filesystem>
+ <!-- External required libraries -->
+ <filesystem name="easyant-shared">
+ <ivy pattern="${easyant.repo.dir}/shared/[organisation]/[module]/[revision]/[module].ivy"/>
+ <artifact pattern="${easyant.repo.dir}/shared/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]"/>
+ </filesystem>
+ <chain name="main" returnFirst="true">
+ <resolver ref="easyant-modules"/>
+ <resolver ref="easyant-shared"/>
+ </chain>
+ </resolvers>
+</ivysettings>
\ No newline at end of file
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/Activator.java b/org.apache.easyant4e/src/org/apache/easyant4e/Activator.java
new file mode 100644
index 0000000..0184807
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/Activator.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e;
+
+import org.apache.easyant4e.modules.EasyAnt4EclipseModule;
+import org.apache.easyant4e.modules.EasyAntCoreModule;
+import org.apache.easyant4e.services.EasyantCoreService;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+import com.google.inject.Inject;
+
+
+/**
+ * This class manage plugin life cycle
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class Activator extends AbstractUIPlugin {
+
+ private EasyAntPlugin easyAntPlugin;
+ private EasyAntCoreModule easyAntCoreModule;
+ private EasyAnt4EclipseModule easyAnt4EclipseModule;
+
+ private EasyantCoreService easyantCoreService;
+
+ @Inject
+ public void setEasyantCoreService(EasyantCoreService easyantCoreService) {
+ this.easyantCoreService = easyantCoreService;
+ }
+
+ public static final String PLUGIN_ID = "org.apache.easyant4e";
+
+ // The shared instance.
+ private static Activator plugin;
+
+
+ /**
+ * Create an activator and a EasyAntModule
+ *
+ */
+ public Activator() {
+ super();
+ if (plugin == null) {
+ plugin = this;
+ this.easyAntCoreModule = new EasyAntCoreModule();
+ this.easyAnt4EclipseModule = new EasyAnt4EclipseModule();
+ }
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ initializeEasyAntPlugin();
+ easyantCoreService.installPluginsRepository();
+ Activator.getDefault().getLog().log(
+ new Status(IStatus.INFO, Activator.PLUGIN_ID, 0, "EasyAnt For Eclipse started", null));
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ Activator.getDefault().getLog().log(
+ new Status(IStatus.INFO, Activator.PLUGIN_ID, 0, "EasyAnt For Eclipse shutdown", null));
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the plugin instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the EasyAnt Plugin instance.
+ *
+ * @return the EasyAnt plugin instance
+ */
+ public static EasyAntPlugin getEasyAntPlugin() {
+ return getDefault().getEasyAntPluginInstance();
+ }
+
+ /**
+ * Returns the EasyAntPlugin instance.
+ */
+ private EasyAntPlugin getEasyAntPluginInstance() {
+ if (easyAntPlugin == null) {
+ initializeEasyAntPlugin();
+ }
+ return easyAntPlugin;
+ }
+
+ private void initializeEasyAntPlugin() {
+ if (easyAntPlugin == null) {
+ easyAntPlugin = new EasyAntPlugin(easyAntCoreModule, easyAnt4EclipseModule);
+ easyAntPlugin.injectMembers(this);
+ }
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/EasyAntConstants.java b/org.apache.easyant4e/src/org/apache/easyant4e/EasyAntConstants.java
new file mode 100644
index 0000000..9fa9598
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/EasyAntConstants.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public interface EasyAntConstants {
+
+
+ public static final String IVY_MODULE_TAG = "ivy-module";
+ public static final String IVY_INFO_TAG = "info";
+ //public static final String IVY_DESCRIPTION_TAG = "description";
+
+ public static final String EASYANT_TAG = "ea:build";
+ public static final String EASYANT_TYPE_ATTR = "type";
+
+ public static final String EASYANT_PROPERTY_TAG = "ea:property";
+ public static final String EASYANT_PROPERTY_NAME_ATTR = "name";
+ public static final String EASYANT_PROPERTY_VALUE_ATTR = "value";
+ public static final String EASYANT_PROPERTY_FILE_ATTR = "file";
+
+ public static final String EASYANT_PLUGIN_TAG = "ea:plugin";
+ public static final String EASYANT_PLUGIN_MODULE_ATTR = "module";
+ public static final String EASYANT_PLUGIN_AS_ATTR = "as";
+ public static final String EASYANT_PLUGIN_MODE_ATTR = "mode";
+ public static final String EASYANT_PLUGIN_MODE_INCLUDE = "include";
+ public static final String EASYANT_PLUGIN_MODE_IMPORT = "import";
+ public static final String EASYANT_PLUGIN_MANDATORY_ATTR = "mandatory";
+
+ public static final String EASYANT_BUILD_TYPES_ORG = "org.apache.easyant.buildtypes";
+ public static final String EASYANT_BUILD_PLUGINS_ORG = "org.apache.easyant.plugins";
+
+ public static final String PLUGINS_SETTINGS = "ivysettings.xml";
+
+ //Ant log level
+ public static final int ANT_LOGLEVEL_ERR = 0;
+ public static final int ANT_LOGLEVEL_WARN = 1;
+ public static final int ANT_LOGLEVEL_INFO = 2;
+ public static final int ANT_LOGLEVEL_VERBOSE = 3;
+ public static final int ANT_LOGLEVEL_DEBUG = 4;
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/EasyAntPlugin.java b/org.apache.easyant4e/src/org/apache/easyant4e/EasyAntPlugin.java
new file mode 100644
index 0000000..6b230b7
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/EasyAntPlugin.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e;
+
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntPlugin {
+
+ private final Injector injector;
+
+ public EasyAntPlugin(Module... modules) {
+ injector = Guice.createInjector(modules);
+ injectMembers(this);
+ }
+
+ public void injectMembers(Object instance) {
+ injector.injectMembers(instance);
+ }
+
+ /**
+ * Return the {@link EasyantCoreService}.
+ */
+ /*public EasyantCoreService getEasyantCoreService() {
+ return getInstance(EasyantCoreService.class);
+ }*/
+
+ /**
+ * Return the {@link EasyantProjectService}.
+ */
+ /*
+ public EasyantProjectService getEasyantProjectService() {
+ return getInstance(EasyantProjectService.class);
+ }*/
+
+ public IProject getCurrentProject() {
+ try {
+ return getSelectedProject();
+ } catch (CoreException e) {
+ log(e);
+ }
+ return null;
+ }
+
+ // private IJavaProject getJavaProject() throws CoreException {
+ // IProject project = getSelectedProject();
+ // IJavaProject javaProject=null;
+ // if(project.hasNature(JavaCore.NATURE_ID)){
+ // javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
+ // }
+ // return javaProject;
+ //}
+
+ private IProject getSelectedProject() throws CoreException {
+ IProject project = null;
+ Object selectedResource = getSelectedResource();
+ if (selectedResource instanceof IResource) {
+ IResource resource = (IResource) selectedResource;
+ project = resource.getProject();
+ } else if (selectedResource instanceof ClassPathContainer) {
+ // FIXME maybe use Adaptable and WorkbenchAdapter to resolve project
+ // container
+ project = ((ClassPathContainer) selectedResource).getJavaProject().getProject();
+ }
+ return project;
+ }
+
+ private Object getSelectedResource() {
+ IStructuredSelection selection = getStructuredSelection();
+ if (selection != null) {
+ Object element = selection.getFirstElement();
+ return element;
+ }
+ return null;
+ }
+
+ private IStructuredSelection getStructuredSelection() {
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService()
+ .getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ return ss;
+ }
+ return null;
+ }
+
+ public void log(int severity, String message) {
+ log(severity, message, null);
+ }
+
+ public void log(int severity, String message, Throwable e) {
+ log(new Status(severity, Activator.PLUGIN_ID, 0, message, e));
+ }
+
+ public void log(CoreException e) {
+ log(e.getStatus().getSeverity(), "EasyAnt For Eclipse - Internal Error", e);
+ }
+
+ public void log(IStatus status) {
+ Activator.getDefault().getLog().log(status);
+ }
+
+ /**
+ * Return the workspace used by the workbench
+ *
+ * This method is internal to the workbench and must not be called by any
+ * plugins.
+ */
+ public IWorkspace getPluginWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Get instances from the injector.
+ *
+ * @param type
+ * the type to get an instance of
+ * @return the instance
+ */
+ public <T> T getInstance(Class<T> type) {
+ return injector.getInstance(type);
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/Startup.java b/org.apache.easyant4e/src/org/apache/easyant4e/Startup.java
new file mode 100644
index 0000000..a2d4332
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/Startup.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e;
+
+import org.eclipse.core.internal.registry.ExtensionRegistry;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.ui.IStartup;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+// http://wiki.eclipse.org/FAQ_How_do_I_make_my_plug-in_dynamic_aware%3F
+// http://wiki.eclipse.org/FAQ_How_do_I_make_my_plug-in_dynamic_enabled%3F
+public class Startup implements IStartup {
+
+ public void earlyStartup() {
+ //TODO add aspect to kill
+ //ExtensionRegistry -> private boolean checkReadWriteAccess(Object key, boolean persist) {
+
+// System.out.println("--- clean IvyDE extension");
+// IExtensionRegistry reg = RegistryFactory.getRegistry();
+// IExtension[] extensions = reg.getExtensions("org.apache.ivyde.eclipse");
+// for (IExtension extension : extensions) {
+// if ("org.eclipse.ui.popupMenus".equals(extension.getExtensionPointUniqueIdentifier())) {
+// System.out.println("--> remove "+extension);
+// try{
+// reg.removeExtension(extension, getUserToken());
+// }catch(Exception e){
+// e.printStackTrace();
+// }
+// System.out.println("--> extension removed!");
+// break;
+// }
+// }
+ }
+
+ /*
+ private Object getUserToken() {
+ IExtensionRegistry registry = RegistryFactory.getRegistry();
+ //return null; // require -Declipse.registry.nulltoken=true
+ return ((ExtensionRegistry) registry).getTemporaryUserToken();
+ }
+*/
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ant/editor/EasyAntEditor.java b/org.apache.easyant4e/src/org/apache/easyant4e/ant/editor/EasyAntEditor.java
new file mode 100644
index 0000000..4736741
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ant/editor/EasyAntEditor.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ant.editor;
+
+/**
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+//@SuppressWarnings("restriction")
+public class EasyAntEditor /*extends org.eclipse.ant.internal.ui.editor.AntEditor*/ {
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/builders/EasyAntBuilder.java b/org.apache.easyant4e/src/org/apache/easyant4e/builders/EasyAntBuilder.java
new file mode 100644
index 0000000..2939523
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/builders/EasyAntBuilder.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.builders;
+
+import java.util.Map;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.EasyAntConstants;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+
+import com.google.inject.Inject;
+
+//import com.google.inject.Inject;
+
+/**
+ * The EastAnt builder.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntBuilder extends IncrementalProjectBuilder {
+
+ private IProgressMonitor monitor;
+
+ private EasyantProjectService easyantProjectService;
+
+ public EasyAntBuilder(){
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected IProject[] build(final int kind, final Map args, final IProgressMonitor monitor) throws CoreException {
+ this.monitor = monitor;
+ if (!getProject().exists()) {
+ return new IProject[] {};
+ } else {
+ try {
+ if (FULL_BUILD == kind) {
+ doBuild();
+ } else { // FIXME maybe check INCREMENTAL_BUILD or AUTO_BUILD
+ IResourceDelta delta = getDelta(getProject());
+ if (delta == null) {
+ doBuild();
+ } else {
+ doBuild(delta);
+ }
+ }
+ } catch (OperationCanceledException e) {
+ Activator.getEasyAntPlugin().log(IStatus.CANCEL, "EasyAnt build canceled", e);
+ }
+ return null;
+ }
+ }
+
+ protected void doBuild() throws CoreException {
+ IWorkspaceRunnable buildOperation = createBuildOperation();
+ buildOperation.run(monitor);
+ }
+
+ protected void doBuild(IResourceDelta delta) throws CoreException {
+ doBuild();
+ }
+
+ private IWorkspaceRunnable createBuildOperation(){
+ // TODO maybe use WorkspaceModifyOperation
+ return new IWorkspaceRunnable(){
+ public void run(IProgressMonitor monitor) throws CoreException {
+ // TODO call good target
+ easyantProjectService.runBuild(getProject(), "compile", EasyAntConstants.ANT_LOGLEVEL_WARN, monitor);
+ }
+ };
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/configurers/Configurer.java b/org.apache.easyant4e/src/org/apache/easyant4e/configurers/Configurer.java
new file mode 100644
index 0000000..4de5dfd
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/configurers/Configurer.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.configurers;
+
+/**
+ * This interface must be implement to configure use in order to configure a basic eclipse project.
+ *
+ * In example : you muste add JavaNature, ScalaNature, GroovyNature or others
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public interface Configurer {
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsole.java b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsole.java
new file mode 100644
index 0000000..6be8be4
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsole.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.console;
+
+import org.eclipse.ui.console.IConsole;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public interface EasyAntConsole extends IConsole{
+
+ void show();
+ void close();
+ boolean isOpen();
+
+ void info(String msg);
+ void error(String msg);
+
+ /**
+ * Show the console.
+ *
+ * @param showNoMatterWhat
+ * ignore preferences if <code>true</code>
+ */
+ void show(boolean showNoMatterWhat);
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsoleFactory.java b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsoleFactory.java
new file mode 100644
index 0000000..fac34b9
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsoleFactory.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.console;
+
+import org.apache.easyant4e.Activator;
+import org.eclipse.ui.console.IConsoleFactory;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntConsoleFactory implements IConsoleFactory {
+
+ private EasyAntConsole console;
+
+ public EasyAntConsoleFactory(){
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ @Inject
+ public void setConsole(EasyAntConsole console) {
+ this.console = console;
+ }
+
+ public void openConsole() {
+ if (console != null) {
+ console.show();
+ }
+ }
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsoleImpl.java b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsoleImpl.java
new file mode 100644
index 0000000..cf74ed7
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsoleImpl.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.console;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.EasyAntPlugin;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.apache.ivyde.eclipse.ui.console.IvyConsole;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleManager;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntConsoleImpl extends IvyConsole implements EasyAntConsole {
+
+ private boolean isOpen=false;
+
+ public boolean isOpen() {
+ //TODO get the stat
+ return isOpen;
+ }
+
+ public void setOpen(boolean isOpen) {
+ this.isOpen = isOpen;
+ }
+
+ @Inject
+ public EasyAntConsoleImpl(ImageProvider imageProvider) {
+ super("EasyAnt", imageProvider.getConsoleImageDescriptor());
+ }
+
+ public void show() {
+ IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
+ IConsole[] existing = manager.getConsoles();
+ boolean exists = false;
+ for (int i = 0; i < existing.length; i++) {
+ if (this == existing[i]) {
+ exists = true;
+ }
+ }
+ if (!exists) {
+ manager.addConsoles(new IConsole[] { this });
+ }
+ manager.showConsoleView(this);
+ setOpen(true);
+
+ //show the Error log view
+ showErrorLogView();
+
+ }
+
+ private void showErrorLogView(){
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.pde.runtime.LogView", null, IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot show the Error Log view.", e);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void error(String msg) {
+ showErrorLogView();
+ super.error(msg);
+ }
+
+ public void close() {
+ IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
+ manager.removeConsoles(new IConsole[] { this });
+ //ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(new MyLifecycle());
+ setOpen(false);
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsolePageParticipant.java b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsolePageParticipant.java
new file mode 100644
index 0000000..d799870
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/console/EasyAntConsolePageParticipant.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.console;
+
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsolePageParticipant;
+import org.eclipse.ui.part.IPageBookViewPage;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntConsolePageParticipant implements IConsolePageParticipant {
+
+ //private CloseConsoleAction closeAction;
+
+ public void init(IPageBookViewPage page, IConsole console) {
+ // closeAction = new IvyConsoleRemoveAction(console);
+ // IToolBarManager manager =
+ // page.getSite().getActionBars().getToolBarManager();
+ // manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeAction);
+ }
+
+ public void dispose() {
+ // closeAction = null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public void activated() {
+ }
+
+ public void deactivated() {
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/RepositoryInstaller.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/RepositoryInstaller.java
new file mode 100644
index 0000000..2431834
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/RepositoryInstaller.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.apache.easyant4e.Activator;
+import org.eclipse.core.runtime.IStatus;
+
+/**
+ * This class unpack the default EasyAnt repository in local file system.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class RepositoryInstaller {
+ static final int BUFFER_SIZE = 102400;
+ static final String REPOSITORY_ARCHIVE_PATH = "repository.zip";
+ private URL interpreterZipUrl;
+
+ public void install(File installDir) {
+ this.interpreterZipUrl = Activator.getDefault().getBundle().getResource(REPOSITORY_ARCHIVE_PATH);
+ try {
+ unPackArchive(installDir);
+ } catch (IOException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot install EasyAnt repository", e);
+ }
+ }
+
+ private void unPackArchive(File installDir) throws IOException {
+ InputStream inputStream = this.interpreterZipUrl.openStream();
+ ZipInputStream zipFileStream = new ZipInputStream(inputStream);
+ ZipEntry zipEntry = zipFileStream.getNextEntry();
+ while (zipEntry != null) {
+ File destination = new File(installDir.getPath(), zipEntry.getName());
+ if (!zipEntry.isDirectory()) {
+ /*
+ * Copy files (and make sure parent directory exist)
+ */
+ File parentFile = destination.getParentFile();
+ boolean parentFileExist = isFileExists(parentFile);
+ if (!parentFileExist) {
+ parentFileExist = parentFile.mkdirs();
+ }
+ if (parentFileExist) {
+ OutputStream os = null;
+ try {
+ os = new FileOutputStream(destination);
+ byte[] buffer = new byte[BUFFER_SIZE];
+ while (true) {
+ int len = zipFileStream.read(buffer);
+ if (zipFileStream.available() == 0) {
+ break;
+ }
+ os.write(buffer, 0, len);
+ }
+ } finally {
+ if (null != os) {
+ os.close();
+ }
+ }
+ } else {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR,
+ "Installing EasyAnt repository, but " + parentFile + " already exists!");
+ }
+ } else {
+ boolean created = destination.mkdirs();
+ if (!created) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR,
+ "Installing EasyAnt repository. Cannot create directory: " + destination);
+ }
+ }
+ zipFileStream.closeEntry();
+ zipEntry = zipFileStream.getNextEntry();
+ }
+ inputStream.close();
+ zipFileStream.close();
+ }
+
+ private boolean isFileExists(File file) {
+ return (null != file && file.exists());
+ }
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/model/EasyAntModuleDescriptorExtension.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/model/EasyAntModuleDescriptorExtension.java
new file mode 100644
index 0000000..d102e08
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/model/EasyAntModuleDescriptorExtension.java
@@ -0,0 +1,330 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension.model;
+
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_BUILD_PLUGINS_ORG;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_BUILD_TYPES_ORG;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PLUGIN_AS_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PLUGIN_MANDATORY_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PLUGIN_MODE_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PLUGIN_MODE_IMPORT;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PLUGIN_MODE_INCLUDE;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PLUGIN_MODULE_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PLUGIN_TAG;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PROPERTY_FILE_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PROPERTY_NAME_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PROPERTY_TAG;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_PROPERTY_VALUE_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_TAG;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_TYPE_ATTR;
+import static org.apache.easyant4e.EasyAntConstants.IVY_INFO_TAG;
+import static org.apache.easyant4e.EasyAntConstants.IVY_MODULE_TAG;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.easyant.core.descriptor.PropertyDescriptor;
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.services.EasyantCoreService;
+import org.apache.ivyde.common.ivyfile.IvyModuleDescriptorModel;
+import org.apache.ivyde.common.model.IDocumentedValueProvider;
+import org.apache.ivyde.common.model.IvyFile;
+import org.apache.ivyde.common.model.IvyTag;
+import org.apache.ivyde.common.model.IvyTagAttribute;
+import org.apache.ivyde.eclipse.extension.ModuleDescriptorExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+
+import com.google.inject.Inject;
+
+/**
+ * This class provide extension in order to add EasyAnt semantic information in
+ * Ivy module descriptor model.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntModuleDescriptorExtension implements ModuleDescriptorExtension {
+
+ private IvyModuleDescriptorModel model;
+ private IvyTag rootTag;
+ private EasyantCoreService easyantCoreService;
+
+ @Inject
+ public void setEasyantCoreService(EasyantCoreService easyantCoreService) {
+ this.easyantCoreService=easyantCoreService;
+ }
+
+ public EasyAntModuleDescriptorExtension() {
+ super();
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ public IvyModuleDescriptorModel contributeModel(IvyModuleDescriptorModel model) {
+ this.model = model;
+ this.rootTag = model.getRootIvyTag();
+ contributeEasyAntTag();
+ return model;
+ }
+
+ private IvyTag contributeEasyAntTag() {
+ IvyTag easyAntTag = createEasyAndTag();
+ return easyAntTag;
+ }
+
+ private IvyTag createEasyAndTag() {
+ IvyTag easyAntTag = new IvyTag(EASYANT_TAG, "Describes how to build this module with EasyAnt.");
+ easyAntTag.addAttribute(new IvyTagAttribute(EASYANT_TYPE_ATTR, "The name of the build type used to build this module.", true,
+ createBuildTypesValueProvider()));
+ model.addTag(easyAntTag);
+ getDescriptionTag().addChildIvyTag(easyAntTag);
+ easyAntTag = createEasyAndTagChilds(easyAntTag);
+ return easyAntTag;
+ }
+
+ private IvyTag createEasyAndTagChilds(IvyTag easyAntTag) {
+ createPropertyTag(rootTag, easyAntTag);
+ createPluginTag(rootTag, easyAntTag);
+ return easyAntTag;
+ }
+
+ private IvyTag getDescriptionTag() {
+ return model.getIvyTag(IVY_INFO_TAG, IVY_MODULE_TAG);
+ }
+
+ private IDocumentedValueProvider createBuildTypesValueProvider() {
+ final List<String> buildTypes = getBuildTypes();
+ IDocumentedValueProvider buildTypesValueProvider = new IDocumentedValueProvider() {
+ public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
+ return buildTypes.toArray(new String[buildTypes.size()]);
+ }
+ public String getDocForValue(String value, IvyFile ivyFile) {
+ String description = easyantCoreService.getBuildTypeDescription(value);
+ return description;
+ }
+ };
+ return buildTypesValueProvider;
+ }
+
+ private List<String> getBuildTypes() {
+ // load default build types
+ final ArrayList<String> buildTypes = new ArrayList<String>();
+ Job job = new Job("Easyant - Getting list of Build Types (" + EASYANT_BUILD_TYPES_ORG + ") " + "from repository ...") {
+ protected IStatus run(IProgressMonitor monitor) {
+ for (String module : easyantCoreService.getAllCoreBuildTypes()) {
+ String shortName = module.substring(module.indexOf("#")+1);
+ buildTypes.add(shortName);
+ buildTypes.add(module);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setPriority(Job.LONG);
+ job.schedule();
+ return buildTypes;
+ }
+
+ private IvyTag createPropertyTag(IvyTag root, IvyTag parent) {
+ // Contribute <property name="" value=""> Tag
+ IvyTag propertyTag = new IvyTag(EASYANT_PROPERTY_TAG, "Define a property in order to configure the build type or plugins.");
+ propertyTag.addAttribute(new IvyTagAttribute(EASYANT_PROPERTY_NAME_ATTR, "The name of property. (associated with the 'value' tag)", false,
+ createPropertyNameValueProvider()));
+ propertyTag.addAttribute(new IvyTagAttribute(EASYANT_PROPERTY_VALUE_ATTR, "The value of property identified by the 'name' tag", false,
+ createPropertyValueProvider()));
+ propertyTag.addAttribute(new IvyTagAttribute(EASYANT_PROPERTY_FILE_ATTR, "Define a property file containing some properties 'name=value' pairs.", false));
+ model.addTag(propertyTag);
+ parent.addChildIvyTag(propertyTag);
+ return propertyTag;
+ }
+
+ private IvyTag createPluginTag(IvyTag root, IvyTag parent) {
+ // Contribute <plugin module="" as=""> Tag
+ IvyTag propertyTag = new IvyTag(EASYANT_PLUGIN_TAG, "Define a plugin used to contribute additionnal parts of the build process.");
+ propertyTag.addAttribute(new IvyTagAttribute(EASYANT_PLUGIN_MODULE_ATTR, "The name of the plugin.", true,
+ createPluginModuleValueProvider()));
+ propertyTag.addAttribute(new IvyTagAttribute(EASYANT_PLUGIN_AS_ATTR, "The name of the prefix used to call plugin's targets, i.e. for 'as=\"myplugin\"': myplugin:target1", true));
+ propertyTag.addAttribute(new IvyTagAttribute(EASYANT_PLUGIN_MODE_ATTR, "The kind of import.", true,
+ createPluginModeValueProvider()));
+ propertyTag.addAttribute(new IvyTagAttribute(EASYANT_PLUGIN_MANDATORY_ATTR, "The mandatory status", false,
+ createPluginMandatoryValueProvider()));
+ model.addTag(propertyTag);
+ parent.addChildIvyTag(propertyTag);
+ return propertyTag;
+ }
+
+ private IDocumentedValueProvider createPluginModuleValueProvider() {
+ final List<String> buildPlugins = getBuildPlugins();
+ IDocumentedValueProvider pluginModuleValueProvider = new IDocumentedValueProvider() {
+ public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
+ return buildPlugins.toArray(new String[buildPlugins.size()]);
+ }
+ public String getDocForValue(String value, IvyFile ivyFile) {
+ String description = easyantCoreService.getPluginDescription(value);
+ return description;
+ }
+ };
+ return pluginModuleValueProvider;
+ }
+
+ private List<String> getBuildPlugins() {
+ final ArrayList<String> buildPlugins = new ArrayList<String>();
+ // load default build plugins
+ Job job = new Job("Easyant - Getting list of Plugins (" + EASYANT_BUILD_PLUGINS_ORG + ") from repository ...") {
+ protected IStatus run(IProgressMonitor monitor) {
+ for (String module : easyantCoreService.getAllCorePlugins()) {
+ String shortName = module.substring(module.indexOf("#")+1);
+ buildPlugins.add(shortName);
+ buildPlugins.add(module);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setPriority(Job.LONG);
+ job.schedule();
+ return buildPlugins;
+ }
+
+ private IDocumentedValueProvider createPluginModeValueProvider() {
+ IDocumentedValueProvider pluginModeValueProvider = new IDocumentedValueProvider() {
+ public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
+ return new String[] { EASYANT_PLUGIN_MODE_IMPORT, EASYANT_PLUGIN_MODE_INCLUDE };
+ }
+ public String getDocForValue(String value, IvyFile ivyFile) {
+ //TODO get documentation for import and include
+ return null;
+ }
+ };
+ return pluginModeValueProvider;
+ }
+
+ private IDocumentedValueProvider createPluginMandatoryValueProvider() {
+ IDocumentedValueProvider pluginMandatoryValueProvider = new IDocumentedValueProvider() {
+ public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
+ return new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() };
+ }
+ public String getDocForValue(String value, IvyFile ivyFile) {
+ return null;
+ }
+ };
+ return pluginMandatoryValueProvider;
+ }
+
+ private IDocumentedValueProvider createPropertyValueProvider() {
+ IDocumentedValueProvider propertyValueValueProvider = new IDocumentedValueProvider() {
+
+ public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
+ PropertyDescriptor propertyDescriptor = getPropertyDescriptor(att, ivyFile);
+ if (propertyDescriptor != null) {
+ String value = propertyDescriptor.getDefaultValue();
+ if(value==null){
+ value = propertyDescriptor.getValue();
+ }
+ if(value!=null){
+ return new String[] { value };
+ }
+ return new String[] {};
+ }
+ return new String[] {};
+ }
+ public String getDocForValue(String value, IvyFile ivyFile) {
+ return null;
+ }
+ };
+ return propertyValueValueProvider;
+ }
+
+ private IDocumentedValueProvider createPropertyNameValueProvider() {
+ IDocumentedValueProvider propertyNameValueProvider = new IDocumentedValueProvider() {
+ public String[] getValuesfor(IvyTagAttribute att, IvyFile ivyFile) {
+ String buildType = getBuildType(ivyFile);
+ if (buildType != null) {
+ List<PropertyDescriptor> propertyDescriptors = easyantCoreService.getPropertiesForBuildType(buildType);
+ String[] names = new String[propertyDescriptors.size()];
+ int i = 0;
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ names[i] = propertyDescriptor.getName();
+ i++;
+ }
+ return names;
+ }
+ return new String[] {};
+ }
+ public String getDocForValue(String value, IvyFile ivyFile) {
+ String buildType = getBuildType(ivyFile);
+ if(buildType!=null){
+ PropertyDescriptor propertyDescriptor = getPropertyDescriptor(buildType, value);
+ if(propertyDescriptor!=null){
+ return propertyDescriptor.getDescription();
+ }
+ }
+ return null;
+ }
+ };
+ return propertyNameValueProvider;
+ }
+
+ List<PropertyDescriptor> propertyDescriptorsCache;
+ private PropertyDescriptor getPropertyDescriptor(String buildType, String propertyName) {
+ if(propertyDescriptorsCache==null){
+ propertyDescriptorsCache= easyantCoreService.getPropertiesForBuildType(buildType);
+ }
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptorsCache) {
+ if (propertyName.equals(propertyDescriptor.getName())) {
+ return propertyDescriptor;
+ }
+ }
+ return null;
+ }
+
+ private PropertyDescriptor getPropertyDescriptor(IvyTagAttribute att, IvyFile ivyFile) {
+ String buildType = getBuildType(ivyFile);
+ if (ivyFile.getAllAttsValues().containsKey(EASYANT_PROPERTY_NAME_ATTR)) {
+ String propertyNameValue = ivyFile.getAllAttsValues().get(EASYANT_PROPERTY_NAME_ATTR).toString();
+ if (buildType != null && propertyNameValue != null) {
+ List<PropertyDescriptor> propertyDescriptors = easyantCoreService.getPropertiesForBuildType(buildType);
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ if (propertyNameValue.equals(propertyDescriptor.getName())) {
+ return propertyDescriptor;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ private String getBuildType(IvyFile ivyFile) {
+ if (EASYANT_TAG.equals(ivyFile.getParentTagName())) {
+ int[] indexes = ivyFile.getParentTagIndex();
+ if (indexes != null && indexes.length > 0) {
+ Map<String, String> allAttsValuesForEasyAntTag = ivyFile.getAllAttsValues(indexes[0] + 1);
+ String typeValue = allAttsValuesForEasyAntTag.get(EASYANT_TYPE_ATTR);
+ return typeValue;
+ }
+ }else if (IVY_INFO_TAG.equals(ivyFile.getParentTagName())) {
+ Map<String, String> allAttsValuesForEasyAntTag = ivyFile.getAllAttsValues(ivyFile.getOffset() + 1);
+ String typeValue = allAttsValuesForEasyAntTag.get(EASYANT_TYPE_ATTR);
+ return typeValue;
+ }
+ return null;
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifeCycleContentProvider.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifeCycleContentProvider.java
new file mode 100644
index 0000000..383436d
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifeCycleContentProvider.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension.page;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.easyant.core.report.PhaseReport;
+import org.apache.easyant.core.report.TargetReport;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.apache.ivyde.eclipse.ui.core.IvyFileEditorInput;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class BuildLifeCycleContentProvider implements ITreeContentProvider {
+
+ private EasyantProjectService easyantProjectService;
+
+ public BuildLifeCycleContentProvider() {
+ }
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof IvyFileEditorInput) {
+ IvyFileEditorInput ivyFileEditorInput = (IvyFileEditorInput) inputElement;
+ IFile ivyFile = ivyFileEditorInput.getFile();
+ List<PhaseReport> phaseReports = easyantProjectService.getPhases(ivyFile);
+ List<TargetReport> targetReports = easyantProjectService.getTargets(ivyFile);
+ ArrayList<Object> o = new ArrayList<Object>();
+ o.addAll(phaseReports);
+ o.addAll(targetReports);
+ Object[] input = o.toArray(new Object[o.size()]);
+ return input;
+ }
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof PhaseReport) {
+ PhaseReport phaseReport = (PhaseReport) parentElement;
+ //if (phaseReport.getName().equals("compile")) {
+ // System.out.println("coucou");
+ //}
+ List<TargetReport> targetReports = phaseReport.getTargetReports();
+ return targetReports.toArray(new TargetReport[targetReports.size()]);
+ }
+ return null;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof PhaseReport) {
+ PhaseReport phaseReport = (PhaseReport) element;
+ List<TargetReport> targetReports = phaseReport.getTargetReports();
+ return (targetReports != null && targetReports.size() > 0);
+ }
+ return false;
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifecycleBlock.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifecycleBlock.java
new file mode 100644
index 0000000..5e57512
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifecycleBlock.java
@@ -0,0 +1,301 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension.page;
+
+import org.apache.easyant.core.report.PhaseReport;
+import org.apache.easyant.core.report.TargetReport;
+import org.apache.easyant4e.EasyAntConstants;
+import org.apache.easyant4e.console.EasyAntConsole;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.internal.ui.callhierarchy.HistoryListAction;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.forms.DetailsPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.MasterDetailsBlock;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+import com.google.inject.Inject;
+
+//import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class BuildLifecycleBlock extends MasterDetailsBlock {
+ private FormPage page;
+
+ private BuildLifeCycleContentProvider buildLifeCycleContentProvider;
+ private BuildLifecycleLabelProvider buildLifecycleLabelProvider;
+ private EasyantProjectService easyantProjectService;
+ private PhaseDetailsPage phaseDetailsPage;
+ private TargetDetailsPage targetDetailsPage;
+ private EasyAntConsole console;
+ private ImageProvider imageProvider;
+ private boolean enableInfoLogLevel = false;
+ private boolean enableVerboseLogLevel = false;
+ private boolean enableDebugLogLevel = false;
+
+
+ public BuildLifecycleBlock() {}
+
+ @Inject
+ public void setImageProvider(ImageProvider imageProvider) {
+ this.imageProvider = imageProvider;
+ }
+
+ @Inject
+ public void setConsole(EasyAntConsole console) {
+ this.console = console;
+ }
+
+ @Inject
+ public void setPhaseDetailsPage(PhaseDetailsPage phaseDetailsPage) {
+ this.phaseDetailsPage = phaseDetailsPage;
+ }
+
+ @Inject
+ public void setTargetDetailsPage(TargetDetailsPage targetDetailsPage) {
+ this.targetDetailsPage = targetDetailsPage;
+ }
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ @Inject
+ public void setBuildLifecycleLabelProvider(BuildLifecycleLabelProvider buildLifecycleLabelProvider) {
+ this.buildLifecycleLabelProvider = buildLifecycleLabelProvider;
+ }
+
+ @Inject
+ public void setBuildLifeCycleContentProvider(BuildLifeCycleContentProvider buildLifeCycleContentProvider) {
+ this.buildLifeCycleContentProvider = buildLifeCycleContentProvider;
+ }
+
+ public void setPage(FormPage page) {
+ this.page = page;
+ }
+
+ @Override
+ protected void createMasterPart(final IManagedForm managedForm, final Composite parent) {
+ createBuildLifecyclePart(managedForm, parent);
+ }
+
+ protected void createBuildLifecyclePart(final IManagedForm managedForm, final Composite parent) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ section.setText("Build Lifecycle");
+ section.setDescription("The build lifecycle has the following build phases:");
+ section.marginWidth = 10;
+ section.marginHeight = 5;
+ Composite client = toolkit.createComposite(section, SWT.WRAP);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 2;
+ layout.marginHeight = 2;
+ client.setLayout(layout);
+ toolkit.paintBordersFor(client);
+
+ section.setClient(client);
+ final SectionPart spart = new SectionPart(section);
+ managedForm.addPart(spart);
+ TreeViewer viewer = new TreeViewer(client);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 20;
+ gd.widthHint = 100;
+ viewer.getTree().setLayoutData(gd);
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ managedForm.fireSelectionChanged(spart, event.getSelection());
+ }
+ });
+ viewer.addDoubleClickListener(new IDoubleClickListener(){
+ public void doubleClick(DoubleClickEvent event) {
+ ISelection selection = event.getSelection();
+ if(selection instanceof StructuredSelection){
+ StructuredSelection structuredSelection = (StructuredSelection)selection;
+ if(!structuredSelection.isEmpty()){
+ Object o = structuredSelection.getFirstElement();
+ if(o instanceof PhaseReport){
+ runPhase((PhaseReport)o);
+ }else if(o instanceof TargetReport){
+ runTarget((TargetReport)o);
+ }
+ }
+ }
+ }
+ });
+ viewer.setContentProvider(buildLifeCycleContentProvider);
+ viewer.setLabelProvider(buildLifecycleLabelProvider);
+ viewer.setInput(page.getEditor().getEditorInput());
+ // viewer.expandAll();
+ }
+
+ private void runPhase(final PhaseReport phase){
+ Job job = new WorkspaceJob("Easyant running phase " + phase.getName() + "...") {
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ easyantProjectService.runBuild(getProject(), phase.getName(), getLogLevel(), monitor);
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+
+ private void runTarget(final TargetReport target){
+ Job job = new WorkspaceJob("Easyant running target " + target.getName() + "...") {
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ easyantProjectService.runBuild(getProject(), target.getName(), getLogLevel(), monitor);
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+
+ private int getLogLevel(){
+ int logLevel = EasyAntConstants.ANT_LOGLEVEL_WARN;
+ if(enableInfoLogLevel){
+ logLevel = EasyAntConstants.ANT_LOGLEVEL_INFO;
+ }
+ if(enableVerboseLogLevel){
+ logLevel = EasyAntConstants.ANT_LOGLEVEL_VERBOSE;
+ }
+ if(enableDebugLogLevel){
+ logLevel = EasyAntConstants.ANT_LOGLEVEL_DEBUG;
+ }
+ return logLevel;
+ }
+
+ protected void registerPages(DetailsPart detailsPart) {
+ phaseDetailsPage.setProject(getProject());
+ detailsPart.registerPage(PhaseReport.class, phaseDetailsPage);
+ targetDetailsPage.setProject(getProject());
+ detailsPart.registerPage(TargetReport.class, targetDetailsPage);
+ }
+
+ @Override
+ protected void createToolBarActions(IManagedForm managedForm) {
+ final ScrolledForm form = managedForm.getForm();
+ Action setLogLevelAction = new LogLevelDropDownAction();
+ form.getToolBarManager().add(setLogLevelAction);
+ }
+
+ private IProject getProject() {
+ if (page.getEditor().getEditorInput() instanceof IFileEditorInput) {
+ IFileEditorInput fileEditorInput = (IFileEditorInput) page.getEditor().getEditorInput();
+ IFile ivyFile = fileEditorInput.getFile();
+ return ivyFile.getProject();
+ }
+ return null;
+ }
+
+ private class LogLevelDropDownAction extends Action implements IMenuCreator {
+ private Menu menu;
+
+ public LogLevelDropDownAction(){
+ super("setDebugLogLevel", Action.AS_DROP_DOWN_MENU);
+ setMenuCreator(this);
+ setToolTipText("Set the log level in console view.");
+ setImageDescriptor(imageProvider.getDebugLogLevelImage());
+ }
+
+ public Menu getMenu(Menu parent) { return null; }
+ public Menu getMenu(Control parent) {
+ if (menu == null){
+ menu = new Menu(parent);
+ MenuItem info = new MenuItem(menu, SWT.CHECK);
+ info.setText("INFO");
+ info.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ enableInfoLogLevel=!enableInfoLogLevel;
+ phaseDetailsPage.setLogLevel(getLogLevel());
+ targetDetailsPage.setLogLevel(getLogLevel());
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+ MenuItem verbose = new MenuItem(menu, SWT.CHECK);
+ verbose.setText("VERBOSE");
+ verbose.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ enableVerboseLogLevel=!enableVerboseLogLevel;
+ phaseDetailsPage.setLogLevel(getLogLevel());
+ targetDetailsPage.setLogLevel(getLogLevel());
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+ MenuItem debug = new MenuItem(menu, SWT.CHECK);
+ debug.setText("DEBUG");
+ debug.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ enableDebugLogLevel=!enableDebugLogLevel;
+ phaseDetailsPage.setLogLevel(getLogLevel());
+ targetDetailsPage.setLogLevel(getLogLevel());
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+ }
+ return menu;
+ }
+
+ public void dispose() {
+ if (menu != null){
+ menu.dispose();
+ menu=null;
+ }
+ }
+
+ public void run() {}
+ }
+
+}
\ No newline at end of file
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifecycleLabelProvider.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifecycleLabelProvider.java
new file mode 100644
index 0000000..8657343
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildLifecycleLabelProvider.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension.page;
+
+import org.apache.easyant.core.report.PhaseReport;
+import org.apache.easyant.core.report.TargetReport;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.eclipse.jface.viewers.BaseLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+import com.google.inject.Inject;
+
+//import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class BuildLifecycleLabelProvider extends BaseLabelProvider implements ILabelProvider {
+
+ @Inject
+ private ImageProvider imageProvider;
+
+ public BuildLifecycleLabelProvider(){
+
+ }
+
+ public Image getImage(Object element) {
+ if (element instanceof PhaseReport) {
+ return imageProvider.getPhaseImage();
+ }
+ if (element instanceof TargetReport) {
+ return imageProvider.getTargetImage();
+ }
+ return null;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof PhaseReport) {
+ PhaseReport phaseReport = (PhaseReport) element;
+ return phaseReport.getName();
+ }
+ if (element instanceof TargetReport) {
+ TargetReport targetReport = (TargetReport) element;
+ return targetReport.getName();
+ }
+ return element.toString();
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildPage.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildPage.java
new file mode 100644
index 0000000..c0b9e3a
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/BuildPage.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension.page;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.console.EasyAntConsole;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.apache.ivyde.eclipse.extension.IvyEditorPage;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class BuildPage extends FormPage implements IvyEditorPage {
+
+ private static final String ID = "build";
+ private static final String NAME = "Build";
+ private BuildLifecycleBlock buildLifecycleBlock;
+ private ImageProvider imageProvider;
+ private EasyAntConsole console;
+
+ @Inject
+ public void setEasyAntConsole(EasyAntConsole console){
+ this.console = console;
+ }
+
+ @Inject
+ public void setBuildLifecycleBlock(BuildLifecycleBlock buildLifecycleBlock) {
+ this.buildLifecycleBlock = buildLifecycleBlock;
+ }
+
+ @Inject
+ public void setImageProvider(ImageProvider imageProvider) {
+ this.imageProvider = imageProvider;
+ }
+
+ public BuildPage() {
+ super(ID, NAME);
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ super.createFormContent(managedForm);
+ buildLifecycleBlock.setPage(this);
+
+ final ScrolledForm form = managedForm.getForm();
+ form.setText("EasyAnt Build");
+ form.setBackgroundImage(imageProvider.getFormBackgroundImage());
+ buildLifecycleBlock.createContent(managedForm);
+
+ console.show();
+ }
+
+ public String getPageName() {
+ return NAME;
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/PhaseDetailsPage.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/PhaseDetailsPage.java
new file mode 100644
index 0000000..73224ca
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/PhaseDetailsPage.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension.page;
+
+import org.apache.easyant.core.report.PhaseReport;
+import org.apache.easyant4e.EasyAntConstants;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IDetailsPage;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import com.google.inject.Inject;
+
+//import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class PhaseDetailsPage implements IDetailsPage {
+ private IManagedForm mform;
+ private PhaseReport phase;
+ private IProject project;
+
+ private Text description;
+ private Text depends;
+
+ private EasyantProjectService easyantProjectService;
+
+ private ImageProvider imageProvider;
+
+ private int logLevel=EasyAntConstants.ANT_LOGLEVEL_WARN;
+
+ public void setLogLevel(int logLevel){
+ this.logLevel=logLevel;
+ }
+
+ public PhaseDetailsPage() {
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ @Inject
+ public void setImageProvider(ImageProvider imageProvider) {
+ this.imageProvider = imageProvider;
+ }
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ public void initialize(IManagedForm mform) {
+ this.mform = mform;
+ }
+
+ public void createContents(Composite parent) {
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.topMargin = 5;
+ layout.leftMargin = 5;
+ layout.rightMargin = 2;
+ layout.bottomMargin = 2;
+ parent.setLayout(layout);
+
+ FormToolkit toolkit = mform.getToolkit();
+ Section section1 = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ section1.marginWidth = 10;
+ section1.setText("Phase Details");
+ section1
+ .setDescription("Phases define an ordered set of build phases. Build phases are responsible for the build choreography at macro level.");
+ TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
+ td.grabHorizontal = true;
+ section1.setLayoutData(td);
+ Composite client = toolkit.createComposite(section1);
+ GridLayout glayout = new GridLayout();
+ glayout.marginWidth = glayout.marginHeight = 0;
+ client.setLayout(glayout);
+
+ createSpacer(toolkit, client, 2);
+
+ toolkit.createLabel(client, "Description:");
+ description = toolkit.createText(client, "", SWT.MULTI | SWT.WRAP);
+ GridData gdDescription = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
+ gdDescription.widthHint = 10;
+ description.setLayoutData(gdDescription);
+
+ createSpacer(toolkit, client, 2);
+
+ toolkit.createLabel(client, "Depends:");
+ depends = toolkit.createText(client, "", SWT.MULTI | SWT.WRAP);
+ GridData gdDepends = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
+ gdDepends.widthHint = 10;
+ depends.setLayoutData(gdDepends);
+
+ createSpacer(toolkit, client, 2);
+
+ ImageHyperlink buildLink = toolkit.createImageHyperlink(client, SWT.NULL);
+ buildLink.setText("Run this phase...");
+ buildLink.setForeground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_BLUE));
+ buildLink.setImage(imageProvider.getBuildImage());
+ buildLink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ Job job = new WorkspaceJob("Easyant running phase " + phase.getName() + "...") {
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ easyantProjectService.runBuild(project, phase.getName(), logLevel, monitor);
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+ });
+
+ section1.setClient(client);
+ }
+
+ private void createSpacer(FormToolkit toolkit, Composite parent, int span) {
+ Label spacer = toolkit.createLabel(parent, ""); //$NON-NLS-1$
+ GridData gd = new GridData();
+ gd.horizontalSpan = span;
+ spacer.setLayoutData(gd);
+ }
+
+ private void update() {
+ if (phase.getDescription() != null) {
+ description.setText(phase.getDescription());
+ }
+ if (phase.getDepends() != null) {
+ depends.setText(phase.getDepends());
+ }
+ }
+
+ public void selectionChanged(IFormPart part, ISelection selection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if (ssel.size() == 1) {
+ phase = (PhaseReport) ssel.getFirstElement();
+ } else {
+ phase = null;
+ }
+ update();
+ }
+
+ public void commit(boolean onSave) {
+ }
+
+ public void setFocus() {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isDirty() {
+ return false;
+ }
+
+ public boolean isStale() {
+ return false;
+ }
+
+ public void refresh() {
+ update();
+ }
+
+ public boolean setFormInput(Object input) {
+ return false;
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/TargetDetailsPage.java b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/TargetDetailsPage.java
new file mode 100644
index 0000000..45065f1
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/TargetDetailsPage.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.ivyde.extension.page;
+
+import org.apache.easyant.core.report.TargetReport;
+import org.apache.easyant4e.EasyAntConstants;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IDetailsPage;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class TargetDetailsPage implements IDetailsPage {
+ private IManagedForm mform;
+ private TargetReport target;
+
+ private IProject project;
+
+ private Text description;
+ private Text depends;
+
+ private EasyantProjectService easyantProjectService;
+
+ private ImageProvider imageProvider;
+
+ private int logLevel=EasyAntConstants.ANT_LOGLEVEL_WARN;
+
+ public void setLogLevel(int logLevel){
+ this.logLevel=logLevel;
+ }
+
+ public TargetDetailsPage() {}
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ @Inject
+ public void setImageProvider(ImageProvider imageProvider) {
+ this.imageProvider = imageProvider;
+ }
+
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ public void createContents(Composite parent) {
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.topMargin = 5;
+ layout.leftMargin = 5;
+ layout.rightMargin = 2;
+ layout.bottomMargin = 2;
+ parent.setLayout(layout);
+
+ FormToolkit toolkit = mform.getToolkit();
+ Section section1 = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ section1.marginWidth = 10;
+ section1.setText("Target Details");
+ section1.setDescription("Targets define a build unit.");
+ TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
+ td.grabHorizontal = true;
+ section1.setLayoutData(td);
+ Composite client = toolkit.createComposite(section1);
+ GridLayout glayout = new GridLayout();
+ glayout.marginWidth = glayout.marginHeight = 0;
+ client.setLayout(glayout);
+
+ createSpacer(toolkit, client, 2);
+
+ toolkit.createLabel(client, "Description:");
+ description = toolkit.createText(client, "", SWT.MULTI | SWT.WRAP);
+ GridData gdDescription = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
+ gdDescription.widthHint = 10;
+ description.setLayoutData(gdDescription);
+
+ createSpacer(toolkit, client, 2);
+
+ toolkit.createLabel(client, "Depends:");
+ depends = toolkit.createText(client, "", SWT.MULTI | SWT.WRAP);
+ GridData gdDepends = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
+ gdDepends.widthHint = 10;
+ depends.setLayoutData(gdDepends);
+
+ createSpacer(toolkit, client, 2);
+
+ ImageHyperlink buildLink = toolkit.createImageHyperlink(client, SWT.NULL);
+ buildLink.setText("Run this target...");
+ buildLink.setForeground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_BLUE));
+ buildLink.setImage(imageProvider.getBuildImage());
+ buildLink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ Job job = new WorkspaceJob("Easyant running target " + target.getName() + "...") {
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ easyantProjectService.runBuild(project, target.getName(), logLevel, monitor);
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+ });
+ section1.setClient(client);
+ }
+
+ private void createSpacer(FormToolkit toolkit, Composite parent, int span) {
+ Label spacer = toolkit.createLabel(parent, ""); //$NON-NLS-1$
+ GridData gd = new GridData();
+ gd.horizontalSpan = span;
+ spacer.setLayoutData(gd);
+ }
+
+ public void initialize(IManagedForm form) {
+ this.mform = form;
+ }
+
+ public void selectionChanged(IFormPart part, ISelection selection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if (ssel.size() == 1) {
+ target = (TargetReport) ssel.getFirstElement();
+ } else {
+ target = null;
+ }
+ update();
+ }
+
+ private void update() {
+ if(target.getDescription()!=null){
+ description.setText(target.getDescription());
+ }
+ if(target.getDepends()!=null){
+ depends.setText(target.getDepends());
+ }
+ }
+
+
+ public void commit(boolean onSave) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isDirty() {
+ return false;
+ }
+
+ public boolean isStale() {
+ return false;
+ }
+
+ public void refresh() {
+ }
+
+ public void setFocus() {
+ }
+
+ public boolean setFormInput(Object input) {
+ return false;
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/modules/EasyAnt4EclipseModule.java b/org.apache.easyant4e/src/org/apache/easyant4e/modules/EasyAnt4EclipseModule.java
new file mode 100644
index 0000000..086fe5a
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/modules/EasyAnt4EclipseModule.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.modules;
+
+import org.apache.easyant4e.console.EasyAntConsole;
+import org.apache.easyant4e.console.EasyAntConsoleImpl;
+import org.apache.easyant4e.ivyde.extension.page.BuildLifeCycleContentProvider;
+import org.apache.easyant4e.ivyde.extension.page.BuildLifecycleBlock;
+import org.apache.easyant4e.ivyde.extension.page.BuildLifecycleLabelProvider;
+import org.apache.easyant4e.ivyde.extension.page.PhaseDetailsPage;
+import org.apache.easyant4e.ivyde.extension.page.TargetDetailsPage;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.apache.easyant4e.providers.ImageProviderImpl;
+import org.apache.easyant4e.services.EasyantCoreService;
+import org.apache.easyant4e.services.EasyantCoreServiceImpl;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.apache.easyant4e.services.EasyantProjectServiceImpl;
+import org.apache.easyant4e.wizards.EasyAntImportWizardPage;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Singleton;
+
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAnt4EclipseModule extends AbstractModule{
+
+
+ @Override
+ protected void configure() {
+ bind(EasyAntConsole.class).to(EasyAntConsoleImpl.class).in(Singleton.class);
+ bind(ImageProvider.class).to(ImageProviderImpl.class).in(Singleton.class);
+ bind(EasyantCoreService.class).to(EasyantCoreServiceImpl.class).in(Singleton.class);
+ bind(EasyantProjectService.class).to(EasyantProjectServiceImpl.class).in(Singleton.class);
+
+ bind(BuildLifecycleBlock.class).in(Singleton.class);
+ bind(BuildLifeCycleContentProvider.class).in(Singleton.class);
+ bind(BuildLifecycleLabelProvider.class).in(Singleton.class);
+ bind(PhaseDetailsPage.class).in(Singleton.class);
+ bind(TargetDetailsPage.class).in(Singleton.class);
+
+ bind(EasyAntImportWizardPage.class);//.in(Singleton.class);
+
+ // Bind to instance
+ //binder.bind(Appendable.class).toInstance(System.out);
+
+ }
+
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/modules/EasyAntCoreModule.java b/org.apache.easyant4e/src/org/apache/easyant4e/modules/EasyAntCoreModule.java
new file mode 100644
index 0000000..f9b79d2
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/modules/EasyAntCoreModule.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.modules;
+
+import static org.apache.easyant4e.EasyAntConstants.PLUGINS_SETTINGS;
+
+import java.net.URL;
+
+import org.apache.easyant.core.EasyAntConfiguration;
+import org.apache.easyant.core.EasyAntEngine;
+import org.apache.easyant.core.factory.EasyantConfigurationFactory;
+import org.apache.easyant4e.Activator;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntCoreModule extends AbstractModule{
+
+ @Override
+ protected void configure() {
+ bind(EasyAntEngine.class).toProvider(new Provider<EasyAntEngine>() {
+ public EasyAntEngine get() {
+ URL url = Activator.getDefault().getBundle().getResource(PLUGINS_SETTINGS);
+ EasyAntConfiguration configuration= EasyantConfigurationFactory.getInstance().createDefaultConfiguration();
+ configuration.setEasyantIvySettingsUrl(url);
+ return new EasyAntEngine(configuration);
+ }
+
+ }).in(Singleton.class);
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/natures/AddEasyAntNatureAction.java b/org.apache.easyant4e/src/org/apache/easyant4e/natures/AddEasyAntNatureAction.java
new file mode 100644
index 0000000..c9c812a
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/natures/AddEasyAntNatureAction.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.natures;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import com.google.inject.Inject;
+
+//import com.google.inject.Inject;
+
+/**
+ * Add the EasyAnt nature to the project.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class AddEasyAntNatureAction implements IObjectActionDelegate {
+
+ // The selected project
+ private IProject selectedProject;
+ private EasyantProjectService easyantProjectService;
+
+ public AddEasyAntNatureAction(){
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void run(IAction action) {
+ if (selectedProject != null) {
+ // Add the nature on the selected project
+ easyantProjectService.addNature(selectedProject);
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection structuredSelection = (StructuredSelection) selection;
+ if (!structuredSelection.isEmpty() && structuredSelection.getFirstElement() instanceof IProject) {
+ IProject project = (IProject) structuredSelection.getFirstElement();
+ if (project.isAccessible()) {
+ this.selectedProject = project;
+ if (action != null) {
+ action.setEnabled(!easyantProjectService.hasEasyAntNature(project));
+ }
+ }
+
+ }
+ }
+ }
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/natures/AddEasyAntNatureOperation.java b/org.apache.easyant4e/src/org/apache/easyant4e/natures/AddEasyAntNatureOperation.java
new file mode 100644
index 0000000..66a7af1
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/natures/AddEasyAntNatureOperation.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.natures;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.easyant4e.Activator;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+
+/**
+ * Add the EasyAnt nature to the project.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class AddEasyAntNatureOperation implements IRunnableWithProgress {
+
+ private IProject project;
+
+ public AddEasyAntNatureOperation(IProject project) {
+ this.project = project;
+ }
+
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ if (project != null) {
+ try {
+ if (!project.hasNature(EasyAntNature.NATURE_ID)) {
+ monitor.subTask("Add the EasyAnt nature to the project " + project.getName());
+ IProjectDescription description = project.getDescription();
+ String[] oldNatures = description.getNatureIds();
+ String[] newNatures = new String[oldNatures.length + 1];
+ System.arraycopy(oldNatures, 0, newNatures, 1, oldNatures.length);
+ newNatures[0] = EasyAntNature.NATURE_ID;
+ description.setNatureIds(newNatures);
+ project.setDescription(description, new SubProgressMonitor(monitor, 1));
+ }
+ } catch (CoreException e) {
+ Activator.getEasyAntPlugin().log(e);
+ }
+ monitor.done();
+ }
+
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/natures/EasyAntNature.java b/org.apache.easyant4e/src/org/apache/easyant4e/natures/EasyAntNature.java
new file mode 100644
index 0000000..60e07c1
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/natures/EasyAntNature.java
@@ -0,0 +1,323 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.natures;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.easyant.core.descriptor.PropertyDescriptor;
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.JavaRuntime;
+
+import com.google.inject.Inject;
+
+/**
+ * The EastAnt nature.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntNature implements IProjectNature {
+
+ public static final String NATURE_ID = "org.apache.easyant4e.EasyAntNature";
+
+ public static final String BUILDER_ID = "org.apache.easyant4e.EasyAntBuilder";
+
+ public EasyAntNature(){
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ /**
+ * The project to which this project nature applies.
+ */
+ private IProject project = null;
+
+ private EasyantProjectService easyantProjectService;
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService){
+ this.easyantProjectService = easyantProjectService;
+ }
+
+
+ public void configure() throws CoreException {
+ //TODO maybe add an extension point to delegate this step for java, scala, ...
+ //Configurer.configure(IProject, EasyAntModuleDescriptor);
+ //Add Java Nature
+ //TODO add checkbox or list of configurer (reuse by skeleton) in import and new project wizard to add JavaNature, ScalaNature, GroovyNature ...
+ //or use a dedicated eclipse plugin ?
+ if (!project.hasNature(JavaCore.NATURE_ID)) {
+ IProjectDescription desc = project.getDescription();
+ List<String> natures = new ArrayList<String>();
+ natures.addAll(Arrays.asList(desc.getNatureIds()));
+ natures.add(JavaCore.NATURE_ID);
+ desc.setNatureIds(natures.toArray(new String[natures.size()]));
+ project.setDescription(desc, null);
+ }
+
+ if (project.hasNature(JavaCore.NATURE_ID)) {
+ IJavaProject javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
+ //flush classpath
+ javaProject.setRawClasspath(new IClasspathEntry[0], null);
+ addSourceFolders(javaProject);
+ addDefaultJREContainer(javaProject);
+ addIvyClasspathContainer();
+ addBuilder(BUILDER_ID);
+ }
+ }
+
+ private void addIvyClasspathContainer() {
+ /*
+ IPath projectRelativePath = new Path("module.ivy");
+ IJavaProject javaProject = JavaCore.create(project);
+ IClasspathEntry newEntry = JavaCore.newContainerEntry(new Path(
+ IvyClasspathContainer.CONTAINER_ID).append(projectRelativePath).append(confs));
+ */
+ IJavaProject javaProject = JavaCore.create(project);
+ //Configure project preferences
+ StringBuffer projectConf = new StringBuffer();
+ //TODO search *.ivy file
+ projectConf.append("?ivyXmlPath=module.ivy");
+ try {
+ appendConfProp(projectConf, "confs", "*");
+ appendConfProp(projectConf, "resolveInWorkspace", Boolean.TRUE.toString());
+ String projectIvySettings = easyantProjectService.getProperty(javaProject.getProject(), "project.ivy.settings.url").getValue();
+ if(projectIvySettings==null){
+ projectIvySettings = easyantProjectService.getProperty(javaProject.getProject(), "project.ivy.settings.file").getValue();
+ if(projectIvySettings!=null){
+ projectIvySettings = "file://"+resolveRelativePath(projectIvySettings);
+ }
+ }
+ if(projectIvySettings!=null){
+ appendConfProp(projectConf, "ivySettingsPath", projectIvySettings);
+ }
+ } catch (UnsupportedEncodingException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+
+ // add the classpath entry
+ IPath path = new Path(IvyClasspathContainer.CONTAINER_ID).append(projectConf.toString());
+ IClasspathEntry newEntry = JavaCore.newContainerEntry(path);
+ addClassPathEntry(javaProject, newEntry);
+ }
+
+ private String resolveRelativePath(String path){
+ if(path!=null && path.startsWith(".")){
+ String projectPath = project.getLocation().toPortableString();
+ path= new File(projectPath+"/"+path).getAbsolutePath();
+ }
+ return path;
+ }
+
+ private void appendConfProp(StringBuffer path, String name, String value) throws UnsupportedEncodingException {
+ path.append('&');
+ path.append(name);
+ path.append('=');
+ path.append(URLEncoder.encode(value, "UTF-8"));
+ }
+
+ //FIXME with scala project or others
+ private void addSourceFolders(IJavaProject javaProject)throws CoreException {
+ PropertyDescriptor srcMainJavaProp = easyantProjectService.getProperty(project, "src.main.java");
+ String srcMainJava = removeBaseDirVar(srcMainJavaProp.getValue());
+ PropertyDescriptor srcMainResourcesProp = easyantProjectService.getProperty(project, "src.main.resources");
+ String srcMainResources = removeBaseDirVar(srcMainResourcesProp.getValue());
+ PropertyDescriptor srcTestJavaProp = easyantProjectService.getProperty(project, "src.test.java");
+ String srcTestJava = removeBaseDirVar(srcTestJavaProp.getValue());
+ PropertyDescriptor srcTestResourcesProp = easyantProjectService.getProperty(project, "src.test.resources");
+ String srcTestResources = removeBaseDirVar(srcTestResourcesProp.getValue());
+ addSourceFolders(javaProject, srcMainJava,srcMainResources, srcTestJava, srcTestResources);
+ }
+
+ private String removeBaseDirVar(String s){
+ String baseDirVar = "${basedir}";
+ if(s!=null && s.contains(baseDirVar)){
+ return s.substring(s.indexOf(baseDirVar)+baseDirVar.length()+1);
+ }else{
+ return s;
+ }
+ }
+
+ public void deconfigure() throws CoreException {
+ if (project.hasNature(JavaCore.NATURE_ID)) {
+ removeBuilder(BUILDER_ID);
+ removeIvyClasspathContainer();
+ }
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+
+ }
+
+ private void addDefaultJREContainer(IJavaProject javaProject) throws JavaModelException{
+ List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
+ entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
+ entries.add(JavaRuntime.getDefaultJREContainerEntry());
+ javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]), null);
+
+ }
+
+ private void addSourceFolders(IJavaProject javaProject, String...path) throws JavaModelException{
+ List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
+ entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
+ IResource outputLocation = javaProject.getProject().findMember("target");
+ if(outputLocation==null){
+ outputLocation = createSourceFolder(javaProject.getProject(), "target");
+ }
+ javaProject.setOutputLocation(outputLocation.getFullPath(), null);
+ for(String p : path){
+ IResource sourceFolder = javaProject.getProject().findMember(p);
+ if(sourceFolder==null){
+ sourceFolder = createSourceFolder(javaProject.getProject(), p);
+ }
+ if(sourceFolder!=null){
+ IPath[] exclusionPatterns = new IPath[] { outputLocation.getFullPath() };
+ IClasspathEntry srcEntry = JavaCore.newSourceEntry(sourceFolder.getFullPath(),exclusionPatterns, outputLocation.getFullPath());
+ entries.add(srcEntry);
+ }
+ }
+ javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]), null);
+ }
+
+ private IResource createSourceFolder( IProject project, String sourcefolder ){
+ IPath path = new Path(sourcefolder);
+ IContainer container = project;
+ try {
+ for (int i = 1; i <= path.segmentCount(); i++) {
+ IFolder newSourceFolder = project.getFolder( path.uptoSegment( i ) );
+ if (!newSourceFolder.exists()) {
+ newSourceFolder.create( true, true, null );
+ }
+ container = newSourceFolder;
+ }
+ return container;
+ } catch (CoreException e) {
+ Activator.getEasyAntPlugin().log(e);
+ return null;
+ }
+ }
+
+ private void addClassPathEntry(IJavaProject javaProject, IClasspathEntry newEntry){
+ try {
+ IClasspathEntry[] entries = javaProject.getRawClasspath();
+ List newEntries = new ArrayList(Arrays.asList(entries));
+ newEntries.add(newEntry);
+ entries = (IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]);
+
+ javaProject.setRawClasspath(entries, javaProject.getOutputLocation(), null);
+ } catch (CoreException e) {
+ // unless there are issues with the JDT, this should never happen
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot add ClassPath entry", e);
+ }
+ }
+
+ private void removeIvyClasspathContainer() {
+ IJavaProject javaProject = JavaCore.create(project);
+ ArrayList<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>();
+ //FIXME call IvyDE command
+ try {
+ IClasspathEntry[] entries = javaProject.getRawClasspath();
+ for (int i = 0; i < entries.length; i++) {
+ IClasspathEntry entry = entries[i];
+ if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
+ IPath path = entry.getPath();
+ if (IvyClasspathUtil.isIvyClasspathContainer(path)) {
+ continue;
+ }
+ }
+ newEntries.add(entry);
+ }
+ // TODO add progress monitor
+ IClasspathEntry[] newClasspathEntries = newEntries.toArray(new IClasspathEntry[newEntries.size()]);
+ javaProject.setRawClasspath(newClasspathEntries, null);
+ } catch (JavaModelException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot remove Ivy ClassPath container", e);
+ }
+ }
+
+ private void addBuilder(String builderID) throws CoreException {
+ if (!isBuilderApplied(builderID)) {
+ IProjectDescription description = getProject().getDescription();
+ ICommand[] commands = description.getBuildSpec();
+ ICommand command = description.newCommand();
+ command.setBuilderName(builderID);
+ ICommand[] newCommands = new ICommand[commands.length + 1];
+ System.arraycopy(commands, 0, newCommands, 0, commands.length);
+ newCommands[commands.length] = command;
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ }
+ }
+
+ private void removeBuilder(String builderID) throws CoreException {
+ if (isBuilderApplied(builderID)) {
+ IProjectDescription description = getProject().getDescription();
+ ICommand[] commands = description.getBuildSpec();
+ ICommand[] newCommands = new ICommand[commands.length - 1];
+ int i = 0;
+ for (ICommand command : commands) {
+ if (command.getBuilderName().equals(builderID)) {
+ // Remove the given builder
+ } else {
+ newCommands[i] = command;
+ i++;
+ }
+ }
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ }
+ }
+
+ private boolean isBuilderApplied(String builderID) throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ for (ICommand cmd : description.getBuildSpec()) {
+ if (cmd.getBuilderName().equals(builderID)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/natures/RemoveEasyAntNatureAction.java b/org.apache.easyant4e/src/org/apache/easyant4e/natures/RemoveEasyAntNatureAction.java
new file mode 100644
index 0000000..3eda15b
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/natures/RemoveEasyAntNatureAction.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.natures;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import com.google.inject.Inject;
+
+//import com.google.inject.Inject;
+
+/**
+ * Remove the EasyAnt nature to the project.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class RemoveEasyAntNatureAction implements IObjectActionDelegate {
+
+ // The selected project
+ private IProject selectedProject;
+ private EasyantProjectService easyantProjectService;
+
+ public RemoveEasyAntNatureAction(){
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void run(IAction action) {
+ if (selectedProject != null) {
+ // Remove the nature on the selected project
+ easyantProjectService.removeNature(selectedProject);
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof StructuredSelection) {
+ StructuredSelection structuredSelection = (StructuredSelection) selection;
+ if (!structuredSelection.isEmpty() && structuredSelection.getFirstElement() instanceof IProject) {
+ IProject project = (IProject) structuredSelection.getFirstElement();
+ if (project.isAccessible()) {
+ this.selectedProject = project;
+ if (action != null) {
+ action.setEnabled(easyantProjectService.hasEasyAntNature(project));
+ }
+ }
+
+ }
+ }
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/natures/RemoveEasyAntNatureOperation.java b/org.apache.easyant4e/src/org/apache/easyant4e/natures/RemoveEasyAntNatureOperation.java
new file mode 100644
index 0000000..751dece
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/natures/RemoveEasyAntNatureOperation.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.natures;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+
+import org.apache.easyant4e.Activator;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+
+/**
+ * Remove the EasyAnt nature to the project.
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class RemoveEasyAntNatureOperation implements IRunnableWithProgress {
+
+ private IProject project;
+
+ public RemoveEasyAntNatureOperation(IProject project) {
+ this.project = project;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ if (project != null) {
+ try {
+ if (project.getNature(EasyAntNature.NATURE_ID) != null) {
+ monitor.subTask("Remove the EasyAnt nature to the project " + project.getName());
+ IProjectDescription description = project.getDescription();
+ String[] oldNatures = description.getNatureIds();
+ ArrayList newNatures = new ArrayList();
+ for (int i = 0; i < oldNatures.length; i++) {
+ if (!oldNatures[i].equals(EasyAntNature.NATURE_ID)) {
+ newNatures.add(oldNatures[i]);
+ }
+ }
+ description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()]));
+ project.setDescription(description, new SubProgressMonitor(monitor, 1));
+ }
+ } catch (CoreException e) {
+ Activator.getEasyAntPlugin().log(e);
+ }
+ monitor.done();
+ }
+
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/providers/ImageProvider.java b/org.apache.easyant4e/src/org/apache/easyant4e/providers/ImageProvider.java
new file mode 100644
index 0000000..b0f9aa6
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/providers/ImageProvider.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.providers;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public interface ImageProvider {
+
+ ImageDescriptor getConsoleImageDescriptor();
+
+ ImageDescriptor getLogoImageDescriptor();
+
+ Image getPhaseImage();
+
+ Image getTargetImage();
+
+ Image getFormBackgroundImage();
+
+ Image getBuildImage();
+
+ ImageDescriptor getInfoLogLevelImage();
+
+ ImageDescriptor getDebugLogLevelImage();
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/providers/ImageProviderImpl.java b/org.apache.easyant4e/src/org/apache/easyant4e/providers/ImageProviderImpl.java
new file mode 100644
index 0000000..4430164
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/providers/ImageProviderImpl.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.providers;
+
+import java.net.URL;
+
+import org.apache.easyant4e.Activator;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class ImageProviderImpl implements ImageProvider {
+
+ public static final String IMG_HORIZONTAL = "horizontal";
+
+ public static final String IMG_FORM_BG = "formBg";
+
+ public static final String IMG_PHASE = "phase";
+
+ public static final String IMG_TARGET = "target";
+
+ public static final String IMG_CONSOLE = "console";
+
+ public static final String IMG_BUILD = "build";
+
+ public static final String IMG_EASYANT_LOGO = "easyant-logo";
+
+ public static final String IMG_INFO_LOG_LEVEL = "info-log-level";
+
+ public static final String IMG_DEBUG_LOG_LEVEL = "debug-log-level";
+
+ public ImageProviderImpl() {
+ initializeImageRegistry(getImageRegistry());
+ }
+
+ public ImageDescriptor getConsoleImageDescriptor() {
+ return getImageDescriptor(IMG_CONSOLE);
+ }
+ public ImageDescriptor getLogoImageDescriptor() {
+ return getImageDescriptor(IMG_EASYANT_LOGO);
+ }
+
+ public Image getPhaseImage(){
+ return getImage(IMG_PHASE);
+ }
+
+ public Image getTargetImage(){
+ return getImage(IMG_TARGET);
+ }
+
+ public Image getFormBackgroundImage(){
+ return getImage(IMG_FORM_BG);
+ }
+
+ public Image getBuildImage(){
+ return getImage(IMG_BUILD);
+ }
+
+ public ImageDescriptor getInfoLogLevelImage(){
+ return getImageDescriptor(IMG_INFO_LOG_LEVEL);
+ }
+
+ public ImageDescriptor getDebugLogLevelImage(){
+ return getImageDescriptor(IMG_DEBUG_LOG_LEVEL);
+ }
+
+ private void initializeImageRegistry(ImageRegistry registry) {
+ registerImage(registry, IMG_FORM_BG, "form_banner.gif");
+ registerImage(registry, IMG_PHASE, "phase.gif");
+ registerImage(registry, IMG_TARGET, "target.gif");
+ registerImage(registry, IMG_CONSOLE, "console.png");
+ registerImage(registry, IMG_BUILD, "build.gif");
+ registerImage(registry, IMG_EASYANT_LOGO, "EasyAnt-logo.gif");
+ registerImage(registry, IMG_INFO_LOG_LEVEL, "info_loglevel.gif");
+ registerImage(registry, IMG_DEBUG_LOG_LEVEL, "debug_loglevel.gif");
+ }
+
+ private void registerImage(ImageRegistry registry, String key, String fileName) {
+ try {
+ Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
+ IPath path = new Path("icons/" + fileName);
+ URL url = FileLocator.find(bundle, path, null);
+ if (url != null) {
+ ImageDescriptor desc = ImageDescriptor.createFromURL(url);
+ registry.put(key, desc);
+ }
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ }
+
+ private Image getImage(String key) {
+ return getImageRegistry().get(key);
+ }
+
+ private ImageDescriptor getImageDescriptor(String key) {
+ return getImageRegistry().getDescriptor(key);
+ }
+
+ private ImageRegistry getImageRegistry() {
+ return Activator.getDefault().getImageRegistry();
+ }
+
+
+
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantCoreService.java b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantCoreService.java
new file mode 100644
index 0000000..10f8676
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantCoreService.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.services;
+
+import java.util.List;
+
+import org.apache.easyant.core.descriptor.PropertyDescriptor;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public interface EasyantCoreService {
+
+ String getPluginsRepositoryPath();
+
+ /**
+ * Install the local plugins repository
+ */
+ void installPluginsRepository();
+
+ String[] getAllCoreBuildTypes();
+
+ String[] getAllCorePlugins();
+
+ List<PropertyDescriptor> getPropertiesForBuildType(String buildTypeName);
+
+ String getBuildTypeDescription(String buildTypeName);
+
+ String getPluginDescription(String pluginName);
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantCoreServiceImpl.java b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantCoreServiceImpl.java
new file mode 100644
index 0000000..227badc
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantCoreServiceImpl.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.services;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.easyant.core.EasyAntConfiguration;
+import org.apache.easyant.core.EasyAntEngine;
+import org.apache.easyant.core.descriptor.PropertyDescriptor;
+import org.apache.easyant.core.factory.EasyantConfigurationFactory;
+import org.apache.easyant.core.report.EasyAntReport;
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.ivyde.extension.RepositoryInstaller;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_BUILD_TYPES_ORG;
+import static org.apache.easyant4e.EasyAntConstants.EASYANT_BUILD_PLUGINS_ORG;
+import static org.apache.easyant4e.EasyAntConstants.PLUGINS_SETTINGS;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyantCoreServiceImpl implements EasyantCoreService {
+
+ //TODO a déplacer dans pluginService
+ //TODO et ne pas recharger les settings à chaque fois ... faire un push du contexte
+ //TODO read workspace preference and project preference to Get the good Ivy instance for the EasyAnt Core
+ //IvySettings ivySettings = createIvySettingsForEACore(project);
+ //Ivy ivy = Ivy.newInstance(ivySettings);
+ //ivySettings.addRepositoryCacheManager(getRepositoryCacheManager());
+ //ivySettings.setBaseDir(getBaseDir(project));
+
+/*
+ public Ivy getIvyInstance() {
+ URL url = Activator.getDefault().getBundle().getResource(PLUGINS_SETTINGS);
+ Ivy ivy = IvyContext.getContext().getIvy();
+ try{
+ ivy.configure(url);
+ } catch (ParseException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot parse EasyAnt Ivy settings file: " + url, e);
+ } catch (IOException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot read EasyAnt Ivy settings file: " + url, e);
+ }
+ IvySettings ivySettings = ivy.getSettings();
+ IvyContext ivyContext = IvyContext.pushNewContext();
+ ivyContext.setIvy(ivy);
+ return ivy;
+ }
+ */
+
+/*
+ private IvySettings createIvySettingsForEACore(IProject project) {
+ // Ivy ivy = IvyContext.pushNewCopyContext().getIvy();
+ // IvySettings ivySettings = ivy.getSettings();
+ IvySettings ivySettings = new IvySettings();
+
+ URL url = Activator.getDefault().getBundle().getResource(PLUGINS_SETTINGS);
+ try {
+ ivySettings.load(url);
+ } catch (ParseException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot parse EasyAnt Ivy settings file: " + url, e);
+ } catch (IOException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot read EasyAnt Ivy settings file: " + url, e);
+ }
+ //ivySettings.addRepositoryCacheManager(getRepositoryCacheManager());
+ ivySettings.setBaseDir(getBaseDir(project));
+
+ return ivySettings;
+ }
+*/
+
+ public static final String CACHE_FILE = "easyant4e-cache-manager";
+ public static final String CACHE_NAME = "__easyant4e-cache-manager";
+
+/*
+ // FIXME connect this on project instance
+ private static RepositoryCacheManager getRepositoryCacheManager() {
+ DefaultRepositoryCacheManager cacheManager = new DefaultRepositoryCacheManager();
+ BundleContext bundleContext = IvyPlugin.getDefault().getBundleContext();
+ cacheManager.setBasedir(bundleContext.getDataFile(CACHE_FILE));
+ cacheManager.setCheckmodified(true);
+ cacheManager.setUseOrigin(true);
+ cacheManager.setName(WorkspaceResolver.CACHE_NAME);
+ return cacheManager;
+ }
+*/
+ private EasyAntEngine easyAntEngine;
+
+ @Inject
+ public void setEasyAntEngine(EasyAntEngine easyAntEngine){
+ this.easyAntEngine = easyAntEngine;
+ }
+
+ //private static File getBaseDir(IProject project) {
+ // return project.getLocation().toFile();
+ //}
+
+ public String getPluginsRepositoryPath() {
+ return pluginsRepository.getPath();
+ }
+
+ private File pluginsRepository;
+
+ public void installPluginsRepository() {
+ String userHome = System.getProperty("user.home");
+ File easyAntHome = new File(userHome, ".easyant");
+ if (!easyAntHome.exists()) {
+ boolean created = easyAntHome.mkdir();
+ if (!created) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot create directory: " + easyAntHome);
+ }
+ }
+ this.pluginsRepository = new File(easyAntHome, "easyant-repository");
+ installLocalRepository();
+ }
+
+ private void installLocalRepository() {
+ if (!pluginsRepository.exists()) {
+ boolean created = pluginsRepository.mkdir();
+ if (!created) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot create directory: " + pluginsRepository);
+ } else {
+ // populate the repository from the plugin
+ // TODO read preference to override default ivysettings.xml use
+ // to
+ // resolve build plugins
+ RepositoryInstaller repositoryInstaller = new RepositoryInstaller();
+ repositoryInstaller.install(pluginsRepository);
+ }
+ }
+ // HashMap<String, String> variables = new HashMap<String, String>();
+ // variables.put("easyant.repo.dir", pluginsRepository.getPath());
+ // ivySettings.addAllVariables(variables);
+ }
+
+ public String[] getAllCoreBuildTypes() {
+ try {
+ //getIvyInstance(null);
+ return easyAntEngine.getPluginService().searchModule(EASYANT_BUILD_TYPES_ORG, "*");
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ return null;
+ }
+
+ public String[] getAllCorePlugins() {
+ try {
+ //getIvyInstance(null);
+ return easyAntEngine.getPluginService().searchModule(EASYANT_BUILD_PLUGINS_ORG, "*");
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ return null;
+ }
+
+ public List<PropertyDescriptor> getPropertiesForBuildType(String buildTypeName){
+ //getIvyInstance(null);
+ ArrayList<PropertyDescriptor> propertyDescriptors = new ArrayList<PropertyDescriptor>();
+ EasyAntReport eaReport = null;
+ try {
+ eaReport = easyAntEngine.getPluginService().getBuildTypeInfo(buildTypeName);
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ if (eaReport != null) {
+ Map<String, PropertyDescriptor> properties = eaReport.getAvailableProperties();
+ for (Entry<String, PropertyDescriptor> entry : properties.entrySet()) {
+ PropertyDescriptor prop = entry.getValue();
+ propertyDescriptors.add(prop);
+ }
+ }
+ return propertyDescriptors;
+ }
+
+ public String getBuildTypeDescription(String buildTypeName) {
+ return easyAntEngine.getPluginService().getBuildTypeDescription(buildTypeName);
+ }
+
+ public String getPluginDescription(String pluginName) {
+ return easyAntEngine.getPluginService().getPluginDescription(pluginName);
+ }
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantProjectService.java b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantProjectService.java
new file mode 100644
index 0000000..65333d7
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantProjectService.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.services;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.easyant.core.descriptor.EasyAntModuleDescriptor;
+import org.apache.easyant.core.descriptor.PropertyDescriptor;
+import org.apache.easyant.core.report.PhaseReport;
+import org.apache.easyant.core.report.TargetReport;
+import org.apache.easyant4e.EasyAntConstants;
+//import org.apache.ivy.Ivy;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public interface EasyantProjectService {
+
+ //Ivy getIvyInstance(IProject project);
+
+ IProject importProject(IProjectDescription projectDescription, Shell messageShell, IProgressMonitor monitor);
+
+ boolean hasEasyAntNature(IProject project);
+
+ boolean hasEasyAntBuilder(IProject project);
+
+ void addNature(IProject project);
+
+ void removeNature(IProject project);
+
+ /**
+ * @param project
+ * @param buildTaskName
+ * @param logLevel @see {@link EasyAntConstants#ANT_LOGLEVEL_DEBUG}, ...
+ * @param monitor
+ */
+ void runBuild(IProject project, String buildTaskName, int logLevel, IProgressMonitor monitor);
+
+ /**
+ * @return a list of available phases
+ */
+ List<PhaseReport> getPhases(IFile ivyFile);
+
+ /**
+ * @return a list of available targets
+ */
+ List<TargetReport> getTargets(IFile ivyFile);
+
+ EasyAntModuleDescriptor getEasyAntModuleDescriptor(File file);
+
+ Map<String, PropertyDescriptor> getProperties(IProject project);
+
+ PropertyDescriptor getProperty(IProject project, String name);
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantProjectServiceImpl.java b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantProjectServiceImpl.java
new file mode 100644
index 0000000..14d826c
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/services/EasyantProjectServiceImpl.java
@@ -0,0 +1,378 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.services;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Vector;
+
+import org.apache.easyant.core.EasyAntConfiguration;
+import org.apache.easyant.core.EasyAntEngine;
+import org.apache.easyant.core.EasyAntMagicNames;
+import org.apache.easyant.core.descriptor.EasyAntModuleDescriptor;
+import org.apache.easyant.core.descriptor.PropertyDescriptor;
+import org.apache.easyant.core.factory.EasyantConfigurationFactory;
+import org.apache.easyant.core.report.EasyAntReport;
+import org.apache.easyant.core.report.PhaseReport;
+import org.apache.easyant.core.report.TargetReport;
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.EasyAntConstants;
+import org.apache.easyant4e.EasyAntPlugin;
+import org.apache.easyant4e.console.EasyAntConsole;
+import org.apache.easyant4e.natures.AddEasyAntNatureOperation;
+import org.apache.easyant4e.natures.EasyAntNature;
+import org.apache.easyant4e.natures.RemoveEasyAntNatureOperation;
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
+import org.eclipse.ui.wizards.datatransfer.ImportOperation;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyantProjectServiceImpl implements EasyantProjectService{
+
+ private EasyAntConsole console;
+
+ private EasyantCoreService easyantCoreService;
+
+ private EasyAntEngine easyAntEngine;
+
+ @Inject
+ public void setEasyAntEngine(EasyAntEngine easyAntEngine){
+ this.easyAntEngine = easyAntEngine;
+ }
+
+ @Inject
+ public void setEasyantCoreService(EasyantCoreService easyantCoreService) {
+ this.easyantCoreService = easyantCoreService;
+ }
+
+ @Inject
+ public void setEasyAntConsole(EasyAntConsole console) {
+ this.console = console;
+ }
+
+/*
+ public Ivy getIvyInstance(IProject project) {
+ //TODO read workspace and project preference to load good Ivy instance must be used by the given project
+ return easyantCoreService.getIvyInstance(project);// by default return the ivy instance used by Easyant core
+ }
+*/
+ public void runBuild(IProject project, String buildTaskName, int logLevel, IProgressMonitor monitor) {
+ console.show();
+ console.info("\n");
+ console.info(project.getName() + "$ easyant " + buildTaskName+"\n");
+
+ IFile ivyFile = project.getFile("module.ivy");
+ String ivyFilePath = ivyFile.getLocation().toOSString();
+ File buildModule = new File(ivyFilePath);
+
+ URL easyantIvySettingsUrl = Activator.getDefault().getBundle().getResource(EasyAntConstants.PLUGINS_SETTINGS);
+
+ Properties properties = new Properties();
+ properties.put("basedir",project.getLocation().toOSString());
+ properties.put("build.compiler", "org.eclipse.jdt.core.JDTCompilerAdapter");
+ properties.put("easyant.modules.dir", easyantCoreService.getPluginsRepositoryPath());
+
+ //junit plugin under eclipse
+ //if property is true : Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
+ properties.put("test.run.fork", "false");
+
+ EasyAntConfiguration configuration = EasyantConfigurationFactory.getInstance().createDefaultConfiguration();
+ configuration.setShowMemoryDetails(true);
+ //configuration.setBuildFile(buildFile); //TODO manage module.ant file
+ configuration.setBuildModule(buildModule);
+ configuration.setDefinedProps(properties);
+ configuration.setMsgOutputLevel(logLevel);
+ Vector<String> targets = new Vector<String>();
+ targets.add(buildTaskName);
+ configuration.setTargets(targets);
+ configuration.setEasyantIvySettingsUrl(easyantIvySettingsUrl.toString());
+
+ PrintStream outStream = getConsoleOutStream();
+ configuration.setOut(outStream);
+
+ PrintStream errStream = getConsoleErrStream();
+ configuration.setErr(errStream);
+
+ //TODO lancer cela dans une WorkspaceModifyOperation
+ try{
+ EasyAntEngine.runBuild(configuration);
+ }catch (Exception be) {
+ Activator.getEasyAntPlugin().log(IStatus.WARNING, be.getMessage());
+ }
+
+ outStream.close();
+ errStream.close();
+
+ }
+
+ private PrintStream getConsoleOutStream(){
+ console.show(true);
+ return new PrintStream(new OutputStream(){
+ private StringBuffer sb = new StringBuffer();
+ @Override
+ public void write(int b) throws IOException {
+ if(b!=10){
+ sb.append((char)b);
+ }else{
+ String message = sb.toString();
+ console.info(message);
+ sb = new StringBuffer();
+ }
+ }
+
+ });
+ }
+
+ private PrintStream getConsoleErrStream(){
+ console.show(true);
+ return new PrintStream(new OutputStream(){
+ private StringBuffer sb = new StringBuffer();
+ @Override
+ public void write(int b) throws IOException {
+ if(b!=10){
+ sb.append((char)b);
+ }else{
+ String message = sb.toString();
+ console.error(message);
+ sb = new StringBuffer();
+ }
+ }
+
+ });
+ }
+
+ public boolean hasEasyAntNature(IProject project){
+ try {
+ return project.hasNature(EasyAntNature.NATURE_ID);
+ } catch (CoreException e) {
+ Activator.getEasyAntPlugin().log(e);
+ }
+ return false;
+ }
+
+ public boolean hasEasyAntBuilder(IProject project){
+ ICommand[] commands=null;
+ try {
+ commands = project.getProject().getDescription().getBuildSpec();
+ } catch (CoreException e) {
+ Activator.getEasyAntPlugin().log(e);
+ }
+ boolean found = false;
+ if(commands!=null){
+ for (int i = 0; i < commands.length; ++i) {
+ if (commands[i].getBuilderName().equals(EasyAntNature.BUILDER_ID)){
+ found = true;
+ }
+ }
+ }
+ return found;
+ }
+
+
+ public void addNature(IProject project) {
+ addNature(project, null, null);
+ }
+
+ private void addNature(IProject project, Shell shell, IProgressMonitor monitor) {
+
+ AddEasyAntNatureOperation addNature = new AddEasyAntNatureOperation(project);
+ try {
+ if(shell==null && monitor==null){
+ PlatformUI.getWorkbench().getProgressService().run(false, false, addNature);
+ }else{
+ addNature.run(monitor);
+ }
+ } catch (InvocationTargetException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot add EasyAnt nature.", e);
+ } catch (InterruptedException e) {
+ Activator.getEasyAntPlugin().log(IStatus.CANCEL, "Add EasyAnt nature operation aborted!", e);
+ }
+ // TODO launch resolve (ask to user)
+ // TODO initialize IvyDE classpath container
+ // TODO maybe launch the first build ??
+ }
+
+ public void removeNature(IProject project) {
+ // Remove the nature on the given project
+ RemoveEasyAntNatureOperation removeNature = new RemoveEasyAntNatureOperation(project);
+ try {
+ PlatformUI.getWorkbench().getProgressService().run(false, false, removeNature);
+ } catch (InvocationTargetException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot remove EasyAnt nature.", e);
+ } catch (InterruptedException e) {
+ Activator.getEasyAntPlugin().log(IStatus.CANCEL, "Remove EasyAnt nature operation aborted!", e);
+ }
+ // TODO remove IvyDE classpath container
+
+ }
+
+ public IProject importProject(IProjectDescription projectDescription, Shell messageShell, IProgressMonitor monitor) {
+ //String projectName = importProjectDescriptor.getProjectName();
+ //IProjectDescription projectDescription = importProjectDescriptor.getDescription();
+ String projectName = projectDescription.getName();
+ final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IProject project = workspace.getRoot().getProject(projectName);
+// if (projectDescription == null) {
+// // error case
+// projectDescription = workspace.newProjectDescription(projectName);
+// IPath locationPath = new Path(importProjectDescriptor.getProjectSystemFile().getAbsolutePath());
+//
+// // If it is under the root use the default location
+// if (Platform.getLocation().isPrefixOf(locationPath)) {
+// projectDescription.setLocation(null);
+// } else {
+// projectDescription.setLocation(locationPath);
+// }
+// } else {
+// projectDescription.setName(projectName);
+// }
+
+// if (importProjectDescriptor.isFromIvyDescription()) {
+ // import form Ivy description
+ File importSource = new File(projectDescription.getLocationURI());
+ IWorkspaceRoot rootWorkspace = workspace.getRoot();
+ ImportOperation importOperation = new ImportOperation(rootWorkspace.getFullPath(),importSource,FileSystemStructureProvider.INSTANCE, new IOverwriteQuery(){
+ public String queryOverwrite(String pathString) { return ALL; }
+ });
+ importOperation.setContext(messageShell);
+ try {
+ //PlatformUI.getWorkbench().getProgressService().run(false, false, importOperation);
+ importOperation.run(monitor);
+ } catch (InvocationTargetException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot import project.", e);
+ } catch (InterruptedException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot import project.", e);
+ }
+// }
+
+ try {
+ monitor.beginTask("Creating project ...", 100);
+ project.create(projectDescription, new SubProgressMonitor(monitor, 30));
+ project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 70));
+ // configure project, apply EasyAnt nature
+// if (importProjectDescriptor.isFromIvyDescription()) {
+ addNature(project, messageShell, monitor);
+// }
+ } catch (CoreException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, "Cannot configure imported project.", e);
+ return null;
+ } finally {
+ monitor.done();
+ }
+ return project;
+
+ }
+
+ public List<PhaseReport> getPhases(IFile ivyFile) {
+ EasyAntReport easyAntReport = null;
+ try {
+ //loadEasyAntIvySettings(ivyFile.getProject());
+ File f = new File(ivyFile.getLocation().toPortableString());
+ easyAntReport = easyAntEngine.getPluginService().generateEasyAntReport(f);
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ if (easyAntReport != null) {
+ return easyAntReport.getAvailablePhases();
+ }
+ return Collections.emptyList();
+ }
+
+ //private File getBaseDir(IProject project) {
+ // return project.getLocation().toFile();
+ //}
+
+ public List<TargetReport> getTargets(IFile ivyFile) {
+ EasyAntReport easyAntReport = null;
+ try {
+ File f = new File(ivyFile.getLocation().toPortableString());
+ easyAntReport = easyAntEngine.getPluginService().generateEasyAntReport(f);
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ if (easyAntReport != null) {
+ return easyAntReport.getUnboundTargets();
+ }
+ return Collections.emptyList();
+ }
+
+ public EasyAntModuleDescriptor getEasyAntModuleDescriptor(File file) {
+ EasyAntModuleDescriptor moduleDescriptor=null;
+ try {
+ moduleDescriptor = easyAntEngine.getPluginService().getEasyAntModuleDescriptor(file);
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ return moduleDescriptor;
+ }
+
+ public Map<String, PropertyDescriptor> getProperties(IProject project){
+ IFile ivyFile = project.getFile("module.ivy");
+ String ivyFilePath = ivyFile.getLocation().toOSString();
+ File moduleDescriptor = new File(ivyFilePath);
+ EasyAntReport easyAntReport=null;
+ try {
+ easyAntReport = easyAntEngine.getPluginService().generateEasyAntReport(moduleDescriptor);
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ if(easyAntReport!=null){
+ return easyAntReport.getAvailableProperties();
+ }
+ return Collections.emptyMap();
+ }
+
+ public PropertyDescriptor getProperty(IProject project, String name){
+ Map<String, PropertyDescriptor> properties = getProperties(project);
+ if(properties.containsKey(name)){
+ PropertyDescriptor propertyDescriptor = properties.get(name);
+ return propertyDescriptor;
+ }else{
+ return null;
+ }
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/wizards/EasyAntImportWizard.java b/org.apache.easyant4e/src/org/apache/easyant4e/wizards/EasyAntImportWizard.java
new file mode 100644
index 0000000..2e676a5
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/wizards/EasyAntImportWizard.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.wizards;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.providers.ImageProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+
+import com.google.inject.Inject;
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntImportWizard extends Wizard implements IImportWizard {
+
+ private EasyAntImportWizardPage importPage;
+
+ private ImageProvider imageProvider;
+
+ public EasyAntImportWizard(){
+ Activator.getEasyAntPlugin().injectMembers(this);
+ }
+
+ @Inject
+ public void setImageProvider(ImageProvider imageProvider) {
+ this.imageProvider = imageProvider;
+ }
+
+ @Inject
+ void setEasyAntImportWizardPage(EasyAntImportWizardPage importPage){
+ this.importPage=importPage;
+ }
+
+ public void addPages() {
+ //importPage = new EasyAntImportWizardPage();
+ super.addPage(importPage);
+ }
+
+ @Override
+ public boolean performFinish() {
+ return importPage.createProjects();
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ setNeedsProgressMonitor(true);
+ setWindowTitle("Import EasyAnt Projects");
+ setDefaultPageImageDescriptor(imageProvider.getLogoImageDescriptor());
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/wizards/EasyAntImportWizardPage.java b/org.apache.easyant4e/src/org/apache/easyant4e/wizards/EasyAntImportWizardPage.java
new file mode 100644
index 0000000..240c7b3
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/wizards/EasyAntImportWizardPage.java
@@ -0,0 +1,649 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.wizards;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.natures.AddEasyAntNatureOperation;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
+import org.eclipse.ui.wizards.datatransfer.ImportOperation;
+
+import com.google.inject.Inject;
+
+//import com.google.inject.Inject;
+
+/**
+ * This wizard is used to import existing EasyAnt Projects
+ *
+ * Inspired from WizardProjectsImportPage
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class EasyAntImportWizardPage extends WizardPage {
+
+ private EasyantProjectService easyantProjectService;
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService) {
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ public EasyAntImportWizardPage() {
+ super("Import EasyAnt projects");
+ setPageComplete(false);
+ setTitle("Import EasyAnt projects");
+ setDescription("Select a directory to search for existing EasyAnt projects.");
+ }
+
+ /**
+ * The name of the folder containing metadata information for the workspace.
+ */
+ public static final String METADATA_FOLDER = ".metadata"; //$NON-NLS-1$
+ //FIXME hard coded the folder name ?
+ public static final String TARGET_FOLDER = "target"; //$NON-NLS-1$
+
+
+ private Text directoryPathField;
+
+ private CheckboxTreeViewer projectsList;
+
+ private ProjectRecord[] selectedProjects = new ProjectRecord[0];
+
+ // Keep track of the directory that we browsed to last time
+ // the wizard was invoked.
+ private static String previouslyBrowsedDirectory = ""; //$NON-NLS-1$
+
+ private Button browseDirectoriesButton;
+
+ private IProject[] wsProjects;
+
+ // The last selected path to minimize searches
+ private String lastPath;
+ // The last time that the file or folder at the selected path was modified
+ // to mimize searches
+ private long lastModified;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+
+ initializeDialogUnits(parent);
+
+ Composite workArea = new Composite(parent, SWT.NONE);
+ setControl(workArea);
+
+ workArea.setLayout(new GridLayout());
+ workArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
+
+ createProjectsRoot(workArea);
+ createProjectsList(workArea);
+ createOptionsArea(workArea);
+ Dialog.applyDialogFont(workArea);
+
+ }
+
+ /**
+ * Create the area with the extra options.
+ *
+ * @param workArea
+ */
+ private void createOptionsArea(Composite workArea) {
+ Composite optionsGroup = new Composite(workArea, SWT.NONE);
+ optionsGroup.setLayout(new GridLayout());
+ optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+
+ /**
+ * Create the checkbox list for the found projects.
+ *
+ * @param workArea
+ */
+ private void createProjectsList(Composite workArea) {
+
+ Label title = new Label(workArea, SWT.NONE);
+ title.setText("EasyAnt Projects:");
+
+ Composite listComposite = new Composite(workArea, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 0;
+ layout.makeColumnsEqualWidth = false;
+ listComposite.setLayout(layout);
+
+ listComposite
+ .setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH));
+
+ projectsList = new CheckboxTreeViewer(listComposite, SWT.BORDER);
+ GridData listData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
+ projectsList.getControl().setLayoutData(listData);
+
+ projectsList.setContentProvider(new ITreeContentProvider() {
+ public Object[] getChildren(Object parentElement) {
+ return null;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getValidProjects();
+ }
+
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ });
+
+ projectsList.setLabelProvider(new LabelProvider() {
+ public String getText(Object element) {
+ return ((ProjectRecord) element).getProjectLabel();
+ }
+ });
+
+ projectsList.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ setPageComplete(projectsList.getCheckedElements().length > 0);
+ }
+ });
+ projectsList.setInput(this);
+ projectsList.setComparator(new ViewerComparator());
+ createSelectionButtons(listComposite);
+ }
+
+ /**
+ * Create the selection buttons in the listComposite.
+ *
+ * @param listComposite
+ */
+ private void createSelectionButtons(Composite listComposite) {
+ Composite buttonsComposite = new Composite(listComposite, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ buttonsComposite.setLayout(layout);
+
+ buttonsComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+
+ Button selectAll = new Button(buttonsComposite, SWT.PUSH);
+ selectAll.setText("Select All");
+ selectAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ projectsList.setCheckedElements(selectedProjects);
+ setPageComplete(projectsList.getCheckedElements().length > 0);
+ }
+ });
+ Dialog.applyDialogFont(selectAll);
+ setButtonLayoutData(selectAll);
+
+ Button deselectAll = new Button(buttonsComposite, SWT.PUSH);
+ deselectAll.setText("Deselect All");
+ deselectAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+
+ projectsList.setCheckedElements(new Object[0]);
+ setPageComplete(false);
+ }
+ });
+ Dialog.applyDialogFont(deselectAll);
+ setButtonLayoutData(deselectAll);
+
+ Button refresh = new Button(buttonsComposite, SWT.PUSH);
+ refresh.setText("Refresh");
+ refresh.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateProjectsList(directoryPathField.getText().trim());
+ }
+ });
+ Dialog.applyDialogFont(refresh);
+ setButtonLayoutData(refresh);
+ }
+
+ /**
+ * Create the area where you select the root directory for the projects.
+ *
+ * @param workArea
+ * Composite
+ */
+ private void createProjectsRoot(Composite workArea) {
+ // project specification group
+ Composite projectGroup = new Composite(workArea, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ layout.makeColumnsEqualWidth = false;
+ layout.marginWidth = 0;
+ projectGroup.setLayout(layout);
+ projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // project location entry field
+ this.directoryPathField = new Text(projectGroup, SWT.BORDER);
+
+ this.directoryPathField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
+
+ // browse button
+ browseDirectoriesButton = new Button(projectGroup, SWT.PUSH);
+ browseDirectoriesButton.setText("Browse");
+ setButtonLayoutData(browseDirectoriesButton);
+
+ browseDirectoriesButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleLocationDirectoryButtonPressed();
+ }
+
+ });
+
+ directoryPathField.addTraverseListener(new TraverseListener() {
+ public void keyTraversed(TraverseEvent e) {
+ if (e.detail == SWT.TRAVERSE_RETURN) {
+ e.doit = false;
+ updateProjectsList(directoryPathField.getText().trim());
+ }
+ }
+
+ });
+
+ directoryPathField.addFocusListener(new FocusAdapter() {
+ public void focusLost(org.eclipse.swt.events.FocusEvent e) {
+ updateProjectsList(directoryPathField.getText().trim());
+ }
+
+ });
+ }
+
+ /*
+ * (non-Javadoc) Method declared on IDialogPage. Set the focus on path
+ * fields when page becomes visible.
+ */
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ this.directoryPathField.setFocus();
+ }
+ }
+
+ /**
+ * Update the list of projects based on path. Method declared public only
+ * for test suite.
+ *
+ * @param path
+ */
+ public void updateProjectsList(final String path) {
+ // on an empty path empty selectedProjects
+ if (path == null || path.length() == 0) {
+ setMessage("Import Projects Description");
+ selectedProjects = new ProjectRecord[0];
+ projectsList.refresh(true);
+ projectsList.setCheckedElements(selectedProjects);
+ setPageComplete(projectsList.getCheckedElements().length > 0);
+ lastPath = path;
+ return;
+ }
+
+ final File directory = new File(path);
+ long modified = directory.lastModified();
+ if (path.equals(lastPath) && lastModified == modified) {
+ // since the file/folder was not modified and the path did not
+ // change, no refreshing is required
+ return;
+ }
+
+ lastPath = path;
+ lastModified = modified;
+
+ // We can't access the radio button from the inner class so get the
+ // status beforehand
+ // final boolean dirSelected =
+ // this.projectFromDirectoryRadio.getSelection();
+ try {
+ getContainer().run(true, true, new IRunnableWithProgress() {
+
+ public void run(IProgressMonitor monitor) {
+ monitor.beginTask("Searching", 100);
+ selectedProjects = new ProjectRecord[0];
+ Collection files = new ArrayList();
+ monitor.worked(10);
+ if (directory.isDirectory()) {
+
+ if (!collectProjectFilesFromDirectory(files, directory, null, monitor)) {
+ return;
+ }
+ Iterator filesIterator = files.iterator();
+ selectedProjects = new ProjectRecord[files.size()];
+ int index = 0;
+ monitor.worked(50);
+ monitor.subTask("Processing");
+ while (filesIterator.hasNext()) {
+ File file = (File) filesIterator.next();
+ ProjectRecord projectRecord = new ProjectRecord(file, lastPath);
+ selectedProjects[index] = projectRecord;
+ index++;
+ }
+ } else {
+ monitor.worked(60);
+ }
+ monitor.done();
+ }
+
+ });
+ } catch (InvocationTargetException e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage());
+ } catch (InterruptedException e) {
+ // Nothing to do if the user interrupts.
+ }
+
+ projectsList.refresh(true);
+ projectsList.setCheckedElements(getValidProjects());
+ if (getValidProjects().length < selectedProjects.length) {
+ setMessage("Projects in workspace", WARNING);
+ } else {
+ setMessage("Import projects description");
+ }
+ setPageComplete(projectsList.getCheckedElements().length > 0);
+ }
+
+ /**
+ * Display an error dialog with the specified message.
+ *
+ * @param message
+ * the error message
+ */
+ protected void displayErrorDialog(String message) {
+ MessageDialog.openError(getContainer().getShell(), getErrorDialogTitle(), message);
+ }
+
+ /**
+ * Get the title for an error dialog. Subclasses should override.
+ */
+ protected String getErrorDialogTitle() {
+ // FIXME
+ return "internalErrorTitle";
+ }
+
+ /**
+ * Collect the list of .project files that are under directory into files.
+ *
+ * @param files
+ * @param directory
+ * @param directoriesVisited
+ * Set of canonical paths of directories, used as recursion guard
+ * @param monitor
+ * The monitor to report to
+ * @return boolean <code>true</code> if the operation was completed.
+ */
+ private boolean collectProjectFilesFromDirectory(Collection files, File directory, Set directoriesVisited,
+ IProgressMonitor monitor) {
+
+ if (monitor.isCanceled()) {
+ return false;
+ }
+ monitor.subTask("Collect project files from "+ directory.getPath());
+ File[] contents = directory.listFiles();
+ if (contents == null){
+ return false;
+ }
+
+ // Initialize recursion guard for recursive symbolic links
+ if (directoriesVisited == null) {
+ directoriesVisited = new HashSet();
+ try {
+ directoriesVisited.add(directory.getCanonicalPath());
+ } catch (IOException exception) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, exception.getMessage(), exception);
+ }
+ }
+ // first look for EasyAnt description files
+ for (int i = 0; i < contents.length; i++) {
+ File file = contents[i];
+ if (file.isFile() && file.getName().endsWith("ivy")) {
+ files.add(file);
+ }else if (contents[i].isDirectory()) {
+ if (!contents[i].getName().equals(METADATA_FOLDER) && !contents[i].getName().equals(TARGET_FOLDER)) {
+ try {
+ String canonicalPath = contents[i].getCanonicalPath();
+ if (!directoriesVisited.add(canonicalPath)) {
+ // already been here --> do not recurse
+ continue;
+ }
+ } catch (IOException exception) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, exception.getMessage(), exception);
+
+ }
+ collectProjectFilesFromDirectory(files, contents[i], directoriesVisited, monitor);
+ }
+ }
+ }
+ return true;
+ }
+ /**
+ * The browse button has been selected. Select the location.
+ */
+ protected void handleLocationDirectoryButtonPressed() {
+ DirectoryDialog dialog = new DirectoryDialog(directoryPathField.getShell());
+ dialog.setMessage("Select directory to scan");
+
+ String dirName = directoryPathField.getText().trim();
+ if (dirName.length() == 0) {
+ dirName = previouslyBrowsedDirectory;
+ }
+
+ if (dirName.length() == 0) {
+ dialog.setFilterPath(Activator.getEasyAntPlugin().getPluginWorkspace().getRoot().getLocation().toOSString());
+ } else {
+ File path = new File(dirName);
+ if (path.exists()) {
+ dialog.setFilterPath(new Path(dirName).toOSString());
+ }
+ }
+
+ String selectedDirectory = dialog.open();
+ if (selectedDirectory != null) {
+ previouslyBrowsedDirectory = selectedDirectory;
+ directoryPathField.setText(previouslyBrowsedDirectory);
+ updateProjectsList(selectedDirectory);
+ }
+
+ }
+
+
+ /**
+ * Create the selected projects
+ *
+ * @return boolean <code>true</code> if all project creations were
+ * successful.
+ */
+ public boolean createProjects() {
+ final Object[] selected = projectsList.getCheckedElements();
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ monitor.beginTask("", selected.length); //$NON-NLS-1$
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ for (int i = 0; i < selected.length; i++) {
+ createExistingProject((ProjectRecord) selected[i], new SubProgressMonitor(monitor, 1));
+ }
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ // run the new project creation operation
+ try {
+ getContainer().run(true, true, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ // one of the steps resulted in a core exception
+ Throwable t = e.getTargetException();
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, t.getMessage(), t);
+ String message = "Cannot import project";
+ IStatus status;
+ if (t instanceof CoreException) {
+ status = ((CoreException) t).getStatus();
+ } else {
+ status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 1, message, t);
+ }
+ ErrorDialog.openError(getShell(), message, null, status);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Create the project described in record. If it is successful return true.
+ *
+ * @param record
+ * @return boolean <code>true</code> if successful
+ * @throws InterruptedException
+ */
+ private IProject createExistingProject(final ProjectRecord record, IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ return easyantProjectService.importProject(record.getDescription(), getShell(), monitor);
+ }
+
+ /**
+ * Method used for test suite.
+ *
+ * @return CheckboxTreeViewer the viewer containing all the projects found
+ */
+ public CheckboxTreeViewer getProjectsList() {
+ return projectsList;
+ }
+
+ /**
+ * Retrieve all the projects in the current workspace.
+ *
+ * @return IProject[] array of IProject in the current workspace
+ */
+ private IProject[] getProjectsInWorkspace() {
+ if (wsProjects == null) {
+ wsProjects = Activator.getEasyAntPlugin().getPluginWorkspace().getRoot().getProjects();
+ }
+ return wsProjects;
+ }
+
+ /**
+ * Get the array of valid project records that can be imported from the
+ * source workspace or archive, selected by the user. If a project with the
+ * same name exists in both the source workspace and the current workspace,
+ * it will not appear in the list of projects to import and thus cannot be
+ * selected for import.
+ *
+ * Method declared public for test suite.
+ *
+ * @return ProjectRecord[] array of projects that can be imported into the
+ * workspace
+ */
+ public ProjectRecord[] getValidProjects() {
+ List validProjects = new ArrayList();
+ for (int i = 0; i < selectedProjects.length; i++) {
+ if (!isProjectInWorkspace(selectedProjects[i].getProjectName())) {
+ validProjects.add(selectedProjects[i]);
+ }
+ }
+ return (ProjectRecord[]) validProjects.toArray(new ProjectRecord[validProjects.size()]);
+ }
+
+ /**
+ * Determine if the project with the given name is in the current workspace.
+ *
+ * @param projectName
+ * String the project name to check
+ * @return boolean true if the project with the given name is in this
+ * workspace
+ */
+ private boolean isProjectInWorkspace(String projectName) {
+ if (projectName == null) {
+ return false;
+ }
+ IProject[] workspaceProjects = getProjectsInWorkspace();
+ for (int i = 0; i < workspaceProjects.length; i++) {
+ if (projectName.equals(workspaceProjects[i].getName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/org.apache.easyant4e/src/org/apache/easyant4e/wizards/ProjectRecord.java b/org.apache.easyant4e/src/org/apache/easyant4e/wizards/ProjectRecord.java
new file mode 100644
index 0000000..cb945be
--- /dev/null
+++ b/org.apache.easyant4e/src/org/apache/easyant4e/wizards/ProjectRecord.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.easyant4e.wizards;
+
+import java.io.File;
+
+import org.apache.easyant.core.descriptor.EasyAntModuleDescriptor;
+import org.apache.easyant4e.Activator;
+import org.apache.easyant4e.services.EasyantProjectService;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+
+import com.google.inject.Inject;
+
+
+/**
+ *
+ * @author <a href="mailto:jerome@benois.fr">Jerome Benois</a>
+ */
+public class ProjectRecord {
+
+ private EasyantProjectService easyantProjectService;
+
+ private String lastPath;
+
+ private File projectSystemFile;
+
+ public File getProjectSystemFile() {
+ return projectSystemFile;
+ }
+
+ private String projectName;
+
+ private boolean fromIvyDescription = false;
+
+ private IProjectDescription description;
+
+ public IProjectDescription getDescription() {
+ return description;
+ }
+
+ @Inject
+ public void setEasyantProjectService(EasyantProjectService easyantProjectService){
+ this.easyantProjectService = easyantProjectService;
+ }
+
+ /**
+ * Create a record for a project based on the info in the file.
+ *
+ * @param file
+ */
+ ProjectRecord(File file, String lastPath) {
+ Activator.getEasyAntPlugin().injectMembers(this);
+ this.projectSystemFile = file;
+ this.lastPath = lastPath;
+ setProjectName();
+ }
+
+ /**
+ * Set the name of the project based on the projectFile.
+ */
+ private void setProjectName() {
+ try {
+ // If we don't have the project name try again
+ IPath path = new Path(projectSystemFile.getPath());
+ if (projectName == null && !path.toOSString().endsWith("ivy")) {
+ // if the file is in the default location, use the directory
+ // name as the project name
+ if (isDefaultLocation(path)) {
+ projectName = path.segment(path.segmentCount() - 2);
+ description = Activator.getEasyAntPlugin().getPluginWorkspace().newProjectDescription(projectName);
+ } else {
+ description = Activator.getEasyAntPlugin().getPluginWorkspace().loadProjectDescription(path);
+ projectName = description.getName();
+ }
+
+ } else if (path.toOSString().endsWith("ivy")) {
+ fromIvyDescription = true;
+ // Load EasyantFile
+ File f = new File(path.toPortableString());
+ EasyAntModuleDescriptor moduleDescriptor = easyantProjectService.getEasyAntModuleDescriptor(f);
+ projectName = moduleDescriptor.getName();
+ description = Activator.getEasyAntPlugin().getPluginWorkspace().newProjectDescription(projectName);
+ if(lastPath.endsWith(projectName)){
+ description.setLocation(new Path(lastPath));
+ }else{
+ description.setLocation(new Path(lastPath+"/"+ projectName));
+ }
+ description.setComment(moduleDescriptor.getDescription());
+ String[] newNatures= {};
+ description.setNatureIds(newNatures);
+ }
+ } catch (Exception e) {
+ Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Returns whether the given project description file path is in the
+ * default location for a project
+ *
+ * @param path
+ * The path to examine
+ * @return Whether the given path is the default location for a project
+ */
+ private boolean isDefaultLocation(IPath path) {
+ // The project description file must at least be within the project,
+ // which is within the workspace location
+ if (path.segmentCount() < 2)
+ return false;
+ return path.removeLastSegments(2).toFile().equals(Platform.getLocation().toFile());
+ }
+
+ /**
+ * Get the name of the project
+ *
+ * @return String
+ */
+ public String getProjectName() {
+ return projectName;
+ }
+
+ /**
+ * Gets the label to be used when rendering this project record in the
+ * UI.
+ *
+ * @return String the label
+ */
+ public String getProjectLabel() {
+ return projectName;
+ }
+
+ public boolean isFromIvyDescription() {
+ return fromIvyDescription;
+ }
+}
\ No newline at end of file
diff --git a/org.apache.easyant4e/src/repository.zip b/org.apache.easyant4e/src/repository.zip
new file mode 100644
index 0000000..26ce2a3
--- /dev/null
+++ b/org.apache.easyant4e/src/repository.zip
Binary files differ
diff --git a/quality/.project b/quality/.project
new file mode 100644
index 0000000..24ddee1
--- /dev/null
+++ b/quality/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>quality</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/quality/EasyAnt4E-Formatter b/quality/EasyAnt4E-Formatter
new file mode 100644
index 0000000..d2ebf9e
--- /dev/null
+++ b/quality/EasyAnt4E-Formatter
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="EasyAnt4E" version="11">
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+</profile>
+</profiles>
diff --git a/quality/checkstyle/RequiredHeader.txt b/quality/checkstyle/RequiredHeader.txt
new file mode 100644
index 0000000..7076f7a
--- /dev/null
+++ b/quality/checkstyle/RequiredHeader.txt
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2008-2009 the EasyAnt project
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
diff --git a/quality/checkstyle/checkstyle-config b/quality/checkstyle/checkstyle-config
new file mode 100644
index 0000000..6c29aa5
--- /dev/null
+++ b/quality/checkstyle/checkstyle-config
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+ Checkstyle-Configuration: EasyAnt4E
+ Description: none
+-->
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+ <property name="severity" value="warning"/>
+ <module name="TreeWalker">
+ <module name="FileContentsHolder"/>
+ <module name="PackageName"/>
+ <module name="TypeName"/>
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName"/>
+ <module name="MethodName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="Header">
+ <property name="headerFile" value="${checkstyle.src.dir}/RequiredHeader.txt"/>
+ <property name="ignoreLines" value="2"/>
+ </module>
+ <module name="AvoidStarImport"/>
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+ <module name="FileLength"/>
+ <module name="LineLength">
+ <property name="ignorePattern" value="^ *\* *[^ ]+$"/>
+ <property name="max" value="120"/>
+ <property name="tabWidth" value="4"/>
+ </module>
+ <module name="MethodLength"/>
+ <module name="ParameterNumber"/>
+ <module name="EmptyForIteratorPad"/>
+ <module name="NoWhitespaceAfter">
+ <property name="severity" value="ignore"/>
+ </module>
+ <module name="NoWhitespaceBefore">
+ <property name="severity" value="ignore"/>
+ </module>
+ <module name="OperatorWrap"/>
+ <module name="ParenPad"/>
+ <module name="TabCharacter">
+ <property name="severity" value="ignore"/>
+ </module>
+ <module name="WhitespaceAfter">
+ <property name="severity" value="ignore"/>
+ </module>
+ <module name="WhitespaceAround">
+ <property name="severity" value="ignore"/>
+ </module>
+ <module name="ModifierOrder"/>
+ <module name="AvoidNestedBlocks"/>
+ <module name="EmptyBlock">
+ <property name="option" value="text"/>
+ </module>
+ <module name="LeftCurly"/>
+ <module name="NeedBraces"/>
+ <module name="RightCurly"/>
+ <module name="DoubleCheckedLocking"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="IllegalInstantiation">
+ <property name="classes" value="java.lang.Boolean"/>
+ </module>
+ <module name="InnerAssignment"/>
+ <module name="MagicNumber"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="RedundantThrows">
+ <property name="allowUnchecked" value="true"/>
+ </module>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType">
+ <property name="severity" value="ignore"/>
+ </module>
+ <module name="VisibilityModifier"/>
+ <module name="ArrayTypeStyle"/>
+ <module name="UpperEll"/>
+ </module>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CheckStyle\:([\w\|]+) *OFF"/>
+ <property name="onCommentFormat" value="CheckStyle\:([\w\|]+) *ON"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+ <module name="SuppressionFilter">
+ <property name="file" value="${checkstyle.src.dir}/checkstyle-suppress.xml"/>
+ </module>
+</module>
diff --git a/quality/checkstyle/checkstyle-frames.xsl b/quality/checkstyle/checkstyle-frames.xsl
new file mode 100644
index 0000000..7fe4954
--- /dev/null
+++ b/quality/checkstyle/checkstyle-frames.xsl
@@ -0,0 +1,293 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ extension-element-prefixes="redirect">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+ <xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+ <xsl:param name="output.dir" select="'.'"/>
+ <xsl:param name="basedir" select="'.'"/>
+
+ <xsl:template match="checkstyle">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-summary.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="overview"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="." mode="all.classes"/>
+ </redirect:write>
+
+ <!-- process all files -->
+ <xsl:apply-templates select="file[count(error) != 0]"/>
+ </xsl:template>
+
+ <xsl:template name="index.html">
+ <html>
+ <head>
+ <title>CheckStyle Audit</title>
+ </head>
+ <frameset cols="20%,80%">
+ <frame src="allclasses-frame.html" name="fileListFrame"/>
+ <frame src="overview-frame.html" name="fileFrame"/>
+ </frameset>
+ <noframes>
+ <h2>Frame Alert</h2>
+ <p>
+ This document is designed to be viewed using the frames feature.
+ If you see this message, you are using a non-frame-capable web client.
+ </p>
+ </noframes>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="pageHeader">
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td class="text-align:right"><h2>CheckStyle Audit</h2></td>
+ </tr>
+ <tr>
+ <td class="text-align:right">Designed for use with
+ <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and
+ <a href='http://ant.apache.org/'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="overview">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+ </head>
+ <body>
+ <!-- page header -->
+ <xsl:call-template name="pageHeader"/>
+
+ <!-- Summary part -->
+ <xsl:apply-templates select="." mode="summary"/>
+ <hr size="1" width="100%" align="left"/>
+
+ <!-- File list part -->
+ <xsl:apply-templates select="." mode="filelist"/>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="stylesheet.css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .oddrow td {
+ background: #efefef;
+ }
+ .evenrow td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ </xsl:template>
+
+ <!--
+ Creates an all-classes.html file that contains a link to all files.
+ -->
+ <xsl:template match="checkstyle" mode="all.classes">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
+ </head>
+ <body>
+ <h2>Files</h2>
+ <p>
+ <table width="100%">
+ <!-- For each file create its part -->
+ <xsl:apply-templates select="file[count(error) != 0]" mode="all.classes">
+ <xsl:sort select="substring-after(@name, $basedir)"/>
+ </xsl:apply-templates>
+ </table>
+ </p>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <h3>Files</h3>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ </tr>
+ <xsl:apply-templates select="file[count(error) != 0]" mode="filelist">
+ <xsl:sort select="count(error)" order="descending" data-type="number"/>
+ </xsl:apply-templates>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="file" mode="filelist">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td nowrap="nowrap">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>files/</xsl:text><xsl:value-of select="substring-after(@name, $basedir)"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="substring-after(@name, $basedir)"/>
+ </a>
+ </td>
+ <td><xsl:value-of select="count(error)"/></td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="file" mode="all.classes">
+ <tr>
+ <td nowrap="nowrap">
+ <a target="fileFrame">
+ <xsl:attribute name="href">
+ <xsl:text>files/</xsl:text><xsl:value-of select="substring-after(@name, $basedir)"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="substring-after(@name, $basedir)"/>
+ </a>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <!--
+ transform string like a/b/c to ../../../
+ @param path the path to transform into a descending directory path
+ -->
+ <xsl:template name="path">
+ <xsl:param name="path"/>
+ <xsl:if test="contains($path,'/')">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="path">
+ <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'/')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(contains($path,'/')) and not($path = '')">
+ <xsl:text>../</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="file">
+ <redirect:write file="{$output.dir}/files/{substring-after(@name, $basedir)}.html">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css">
+ <xsl:attribute name="href"><xsl:call-template name="path"><xsl:with-param name="path" select="substring-after(@name, $basedir)"/></xsl:call-template><xsl:text>stylesheet.css</xsl:text></xsl:attribute>
+ </link>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <h3>File <xsl:value-of select="substring-after(@name, $basedir)"/></h3>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Error Description</th>
+ <th>Line:Column</th>
+ </tr>
+ <xsl:for-each select="error">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><a title="{@source}"><xsl:value-of select="@message"/></a></td>
+ <td align="center"><xsl:value-of select="@line"/><xsl:if test="@column">:<xsl:value-of select="@column"/></xsl:if></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+ </redirect:write>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="summary">
+ <h3>Summary</h3>
+ <xsl:variable name="fileCount" select="count(file)"/>
+ <xsl:variable name="errorCount" select="count(file/error)"/>
+ <xsl:variable name="fileErrorCount" select="count(file[count(error) != 0])"/>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Total Files</th>
+ <th>Files With Errors</th>
+ <th>Errors</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="$fileCount"/></td>
+ <td><xsl:value-of select="$fileErrorCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">oddrow</xsl:if>
+ <xsl:if test="position() mod 2 = 0">evenrow</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/quality/checkstyle/checkstyle-suppress.xml b/quality/checkstyle/checkstyle-suppress.xml
new file mode 100644
index 0000000..2565f28
--- /dev/null
+++ b/quality/checkstyle/checkstyle-suppress.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<suppressions>
+ <suppress checks="MagicNumber" files=".*[\\/]test[\\/]java[\\/].*"/>
+</suppressions>
\ No newline at end of file
diff --git a/quality/checkstyle/checkstyle-text.xsl b/quality/checkstyle/checkstyle-text.xsl
new file mode 100644
index 0000000..333aecf
--- /dev/null
+++ b/quality/checkstyle/checkstyle-text.xsl
@@ -0,0 +1,33 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <xsl:strip-space elements="checkstyle"/>
+ <xsl:preserve-space elements="file"/>
+ <xsl:output method="text"/>
+ <xsl:template match="checkstyle/file/error">
+ <xsl:value-of select="../@name"/>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of select="@line"/>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of select="@column"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@message"/>
+ </xsl:template>
+</xsl:stylesheet>
+
diff --git a/quality/checkstyle/checkstyle-xdoc.xsl b/quality/checkstyle/checkstyle-xdoc.xsl
new file mode 100644
index 0000000..4d7ab86
--- /dev/null
+++ b/quality/checkstyle/checkstyle-xdoc.xsl
@@ -0,0 +1,129 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ extension-element-prefixes="redirect">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+ <xsl:param name="output.dir" select="'.'"/>
+ <xsl:param name="basedir" select="'.'"/>
+
+ <xsl:template match="checkstyle">
+ <document>
+ <properties>
+ <title>Checkstyle Audit</title>
+ </properties>
+
+ <body>
+ <xsl:apply-templates select="." mode="summary"/>
+ <!-- File list part -->
+ <xsl:apply-templates select="." mode="filelist"/>
+ <xsl:apply-templates select="file[count(error) != 0]"/>
+ </body>
+ </document>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <section name="Files">
+ <table>
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ </tr>
+ <xsl:apply-templates select="file[count(error) != 0]" mode="filelist">
+ <xsl:sort select="count(error)" order="descending" data-type="number"/>
+ </xsl:apply-templates>
+ </table>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="file" mode="filelist">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td nowrap="nowrap">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>files</xsl:text><xsl:value-of select="substring-after(@name, $basedir)"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="substring-after(@name, $basedir)"/>
+ </a>
+ </td>
+ <td><xsl:value-of select="count(error)"/></td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="file">
+ <redirect:write file="{$output.dir}/files{substring-after(@name, $basedir)}.xml">
+ <document>
+ <properties>
+ <title>Checkstyle Audit</title>
+ </properties>
+
+ <body>
+ <section name="Details for {substring-after(@name, $basedir)}">
+ <table>
+ <tr>
+ <th>Error Description</th>
+ <th>Line</th>
+ </tr>
+ <xsl:for-each select="error">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><a title="{@source}"><xsl:value-of select="@message"/></a></td>
+ <td><xsl:value-of select="@line"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </section>
+ </body>
+ </document>
+ </redirect:write>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="summary">
+ <section name="Summary">
+ <xsl:variable name="fileCount" select="count(file)"/>
+ <xsl:variable name="errorCount" select="count(file/error)"/>
+ <xsl:variable name="fileErrorCount" select="count(file[count(error) != 0])"/>
+ <table>
+ <tr>
+ <th>Files</th>
+ <th>Files With Errors</th>
+ <th>Errors</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="$fileCount"/></td>
+ <td><xsl:value-of select="$fileErrorCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ </tr>
+ </table>
+ </section>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">oddrow</xsl:if>
+ <xsl:if test="position() mod 2 = 0">evenrow</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
+