incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1095923 - in /incubator/easyant/core/trunk: experiment/ experiment/repo/ experiment/repo/org.apache.ant/ experiment/repo/org.apache.ant/ant-groovyfront/ experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ experiment/repo/org.apache.ant/a...
Date Fri, 22 Apr 2011 11:45:31 GMT
Author: hibou
Date: Fri Apr 22 11:45:30 2011
New Revision: 1095923

URL: http://svn.apache.org/viewvc?rev=1095923&view=rev
Log:
Add an experiment around resolving plugin dependencies with Ivy

Added:
    incubator/easyant/core/trunk/experiment/
    incubator/easyant/core/trunk/experiment/repo/   (with props)
    incubator/easyant/core/trunk/experiment/repo/.project   (with props)
    incubator/easyant/core/trunk/experiment/repo/ivysettings.xml   (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.ant/
    incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/
    incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/
    incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml
  (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/jars/
    incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/jars/ant-groovyfront.jar
  (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml
  (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml
  (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy
  (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml
  (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml
  (with props)
    incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml
  (with props)
    incubator/easyant/core/trunk/experiment/sample/   (with props)
    incubator/easyant/core/trunk/experiment/sample/.project   (with props)
    incubator/easyant/core/trunk/experiment/sample/build.properties   (with props)
    incubator/easyant/core/trunk/experiment/sample/build.xml   (with props)
    incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml   (with props)
    incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml   (with props)
    incubator/easyant/core/trunk/experiment/sample/ea-jars/   (with props)
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java
  (with props)

Propchange: incubator/easyant/core/trunk/experiment/repo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 22 11:45:30 2011
@@ -0,0 +1 @@
+.cache

Added: incubator/easyant/core/trunk/experiment/repo/.project
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/.project?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/.project (added)
+++ incubator/easyant/core/trunk/experiment/repo/.project Fri Apr 22 11:45:30 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>anthill-repo</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Propchange: incubator/easyant/core/trunk/experiment/repo/.project
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/.project
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/.project
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/repo/ivysettings.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/ivysettings.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/ivysettings.xml (added)
+++ incubator/easyant/core/trunk/experiment/repo/ivysettings.xml Fri Apr 22 11:45:30 2011
@@ -0,0 +1,22 @@
+<ivysettings>
+
+    <caches>
+        <!--  since it is all filesystem with useOrigin=true, nothing should actually
be put in cache -->
+        <cache name="easyant-repo-cache" useOrigin="true" basedir="${ivy.settings.dir}/.cache"
/>
+    </caches>
+
+    <resolvers>
+        <filesystem name="easyant-repo" cache="easyant-repo-cache">
+            <ivy pattern="${ivy.settings.dir}/[organization]/[module]/[revision]/ivy.xml"
/>
+            <artifact pattern="${ivy.settings.dir}/[organization]/[module]/[revision]/[type]s/[artifact].[ext]"
/>
+        </filesystem>
+
+        <ibiblio name="maven" m2compatible="true" />
+
+        <chain name="easyant-chain">
+            <resolver ref="easyant-repo" />
+            <resolver ref="maven" />
+        </chain>
+    </resolvers>
+
+</ivysettings>

Propchange: incubator/easyant/core/trunk/experiment/repo/ivysettings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/ivysettings.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/ivysettings.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml
(added)
+++ incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,16 @@
+<ivy-module version="2.0">
+    <info organisation="org.apache.ant" module="ant-groovyfront" revision="1.0.0" />
+    <configurations defaultconfmapping="default->default;sources->sources;javadoc->javadoc">
+        <conf name="default" />
+        <conf name="sources" />
+        <conf name="javadoc" />
+    </configurations>
+    <publications>
+        <artifact name="ant-groovyfront" ext="jar" type="jar" conf="default" />
+    </publications>
+    <dependencies>
+        <dependency org="org.codehaus.groovy" name="groovy" rev="1.7.9" transitive="false"
/>
+        <dependency org="antlr"               name="antlr"  rev="2.7.7" transitive="false"
/>
+        <dependency org="asm"                 name="asm"    rev="3.2"   transitive="false"
/>
+    </dependencies>
+</ivy-module>
\ No newline at end of file

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/jars/ant-groovyfront.jar
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/jars/ant-groovyfront.jar?rev=1095923&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.ant/ant-groovyfront/1.0.0/jars/ant-groovyfront.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml
(added)
+++ incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,10 @@
+<project name="org.apache.easyant#groovyfrontend">
+
+    <typedef name="groovyfrontend" classname="org.apache.ant.groovyfront.GroovyFrontProjectHelper">
+        <classpath refid="org.apache.easyant#groovyfrontend[projecthelper]" />
+    </typedef>
+    <projecthelper>
+        <groovyfrontend />
+    </projecthelper>
+
+</project>

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/antscripts/groovyfrontend.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml
(added)
+++ incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,13 @@
+<ivy-module version="2.0">
+    <info organisation="org.apache.easyant" module="groovyfrontend" revision="1.0" />
+    <configurations>
+        <conf name="default" />
+        <conf name="projecthelper" />
+    </configurations>
+    <publications>
+        <artifact name="groovyfrontend" ext="xml" type="antscript" conf="default" />
+    </publications>
+    <dependencies>
+        <dependency org="org.apache.ant" name="ant-groovyfront" rev="1.0.0" conf="projecthelper->default"
/>
+    </dependencies>
+</ivy-module>
\ No newline at end of file

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/groovyfrontend/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy
(added)
+++ incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,6 @@
+
+
+target(name: "hellogroovy") {
+    echo(message: "hello groovy world !")
+}
+

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/antscripts/hellogroovy.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml
(added)
+++ incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,9 @@
+<ivy-module version="2.0">
+    <info organisation="org.apache.easyant" module="hellogroovy" revision="1.0" />
+    <publications>
+        <artifact name="hellogroovy" ext="groovy" type="antscript" />
+    </publications>
+    <dependencies>
+        <dependency org="org.apache.easyant" name="groovyfrontend" rev="1.0" conf="default->default"
/>
+    </dependencies>
+</ivy-module>

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/hellogroovy/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml
(added)
+++ incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,7 @@
+<project name="org.apache.easyant#helloworld">
+
+    <target name="hello">
+        <echo message="hello world !" />
+    </target>
+
+</project>

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/antscripts/helloworld.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml
(added)
+++ incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,6 @@
+<ivy-module version="2.0">
+    <info organisation="org.apache.easyant" module="helloworld" revision="1.0" />
+    <publications>
+        <artifact name="helloworld" ext="xml" type="antscript" />
+    </publications>
+</ivy-module>
\ No newline at end of file

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/repo/org.apache.easyant/helloworld/1.0/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Propchange: incubator/easyant/core/trunk/experiment/sample/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 22 11:45:30 2011
@@ -0,0 +1,2 @@
+localrepo
+.resolution-cache

Added: incubator/easyant/core/trunk/experiment/sample/.project
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/sample/.project?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/sample/.project (added)
+++ incubator/easyant/core/trunk/experiment/sample/.project Fri Apr 22 11:45:30 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>anthill-sample</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Propchange: incubator/easyant/core/trunk/experiment/sample/.project
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/sample/.project
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/sample/.project
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/sample/build.properties
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/sample/build.properties?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/sample/build.properties (added)
+++ incubator/easyant/core/trunk/experiment/sample/build.properties Fri Apr 22 11:45:30 2011
@@ -0,0 +1 @@
+#easyant.localrepo.basedir=${basedir}/localrepo

Propchange: incubator/easyant/core/trunk/experiment/sample/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/sample/build.properties
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Added: incubator/easyant/core/trunk/experiment/sample/build.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/sample/build.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/sample/build.xml (added)
+++ incubator/easyant/core/trunk/experiment/sample/build.xml Fri Apr 22 11:45:30 2011
@@ -0,0 +1,12 @@
+<project name="myproject" default="hello">
+
+    <property file="build.properties" />
+
+    <path id="anttasks.classpath">
+        <fileset dir="${basedir}/ea-jars" includes="*.jar" />
+    </path>
+    <typedef name="importantscripts" classname="org.apache.easyant.tasks.ImportAntscripts"
classpathref="anttasks.classpath" loaderref="anttasks.classpath.loader" />
+
+    <importantscripts ivyfile="${basedir}/ea-ivy.xml" ivysettings="${basedir}/ea-ivysettings.xml"
/>
+
+</project>

Propchange: incubator/easyant/core/trunk/experiment/sample/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/sample/build.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/sample/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml (added)
+++ incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml Fri Apr 22 11:45:30 2011
@@ -0,0 +1,7 @@
+<ivy-module version="2.0">
+    <info organisation="com.acme" module="myproject_easyant" />
+    <dependencies>
+        <dependency org="org.apache.easyant" name="helloworld"  rev="1.0" />
+        <dependency org="org.apache.easyant" name="hellogroovy" rev="1.0" />
+    </dependencies>
+</ivy-module>

Propchange: incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/sample/ea-ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml (added)
+++ incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml Fri Apr 22 11:45:30
2011
@@ -0,0 +1,9 @@
+<ivysettings>
+
+    <include file="${ivy.settings.dir}/../repo/ivysettings.xml" />
+
+    <caches resolutionCacheDir="${ivy.settings.dir}/.resolution-cache" />
+
+    <settings defaultResolver="easyant-chain" />
+
+</ivysettings>

Propchange: incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/experiment/sample/ea-ivysettings.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Propchange: incubator/easyant/core/trunk/experiment/sample/ea-jars/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 22 11:45:30 2011
@@ -0,0 +1 @@
+*.jar

Added: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java?rev=1095923&view=auto
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java
(added)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java
Fri Apr 22 11:45:30 2011
@@ -0,0 +1,442 @@
+/*
+ *  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.
+ *
+ */
+package org.apache.easyant.tasks;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ivy.Ivy;
+import org.apache.ivy.core.cache.DefaultRepositoryCacheManager;
+import org.apache.ivy.core.cache.DefaultResolutionCacheManager;
+import org.apache.ivy.core.cache.RepositoryCacheManager;
+import org.apache.ivy.core.cache.ResolutionCacheManager;
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.report.ArtifactDownloadReport;
+import org.apache.ivy.core.report.ConfigurationResolveReport;
+import org.apache.ivy.core.report.ResolveReport;
+import org.apache.ivy.core.resolve.ResolveOptions;
+import org.apache.ivy.core.retrieve.RetrieveOptions;
+import org.apache.ivy.core.settings.IvySettings;
+import org.apache.ivy.core.sort.SortOptions;
+import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
+import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
+import org.apache.ivy.plugins.report.XmlReportParser;
+import org.apache.ivy.plugins.repository.url.URLResource;
+import org.apache.ivy.plugins.resolver.FileSystemResolver;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.Delete;
+import org.apache.tools.ant.taskdefs.ImportTask;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Path.PathElement;
+
+/**
+ * EXPERIMENTAL, IT IS NOT INTENDED FOR PUBLIC USE
+ * <p>
+ * An Ant task which resolve some build scripts and import them
+ */
+public class ImportAntscripts extends Task {
+
+    private File ivyfile;
+
+    private File ivysettings;
+
+    private Ivy externalIvy;
+
+    public void setIvyfile(File ivyfile) {
+        this.ivyfile = ivyfile;
+    }
+
+    public void setIvysettings(File ivysettings) {
+        this.ivysettings = ivysettings;
+    }
+
+    @Override
+    public void execute() throws BuildException {
+        long startTime = System.currentTimeMillis();
+
+        if (getOwningTarget() == null || !"".equals(getOwningTarget().getName())) {
+            throw new BuildException("import only allowed as a top-level task");
+        }
+
+        if (ivyfile == null) {
+            throw new BuildException("ivyfile is required");
+        }
+        if (ivysettings == null) {
+            throw new BuildException("ivysettings is required");
+        }
+
+        boolean refresh = false;
+        String refreshValue = getProject().getProperty("easyant.refresh");
+        if (refreshValue != null) {
+            refresh = Boolean.parseBoolean(refreshValue);
+        }
+
+        // configure ivy, which may be the local retrieve repo, depending of the setup
+        Ivy ivy = getIvy();
+        ModuleDescriptor md = getMd(ivy, ivyfile);
+
+        ArtifactDownloadReport[] artifacts;
+        List<ModuleDescriptor> dependencies = new ArrayList<ModuleDescriptor>();
+
+        // first, let's resolve the ant scripts, just the scripts, not their possible jar
dependencies, thus only the
+        // configuration "default"
+
+        XmlReportParser xmlreport = null;
+        if (!refresh) {
+            // first try to relad the resolve from the last report
+            xmlreport = getResolveReport(ivy, md.getModuleRevisionId().getModuleId(), "default");
+        }
+        if (xmlreport != null) {
+            // collect the ant scripts
+            artifacts = xmlreport.getArtifactReports();
+
+            // collect the descriptor associated with each ant script
+            ModuleRevisionId[] depIds = xmlreport.getDependencyRevisionIds();
+            for (int i = 0; i < depIds.length; i++) {
+                File depIvyFile = xmlreport.getMetadataArtifactReport(depIds[i]).getLocalFile();
+                dependencies.add(getMd(ivy, depIvyFile));
+            }
+        } else {
+            // do a full resolve
+
+            // if in a retrieved setup, clean the repo and repopulate it
+            maybeClearLocalRepo();
+            maybeRetrieve(md, "default");
+
+            // launch the actual resolve
+            ResolveReport resolveReport = resolve(ivy, md, "default");
+            ConfigurationResolveReport confReport = resolveReport.getConfigurationReport("default");
+
+            // collect the ant scripts
+            artifacts = confReport.getAllArtifactsReports();
+
+            // collect the descriptor associated with each ant script
+            Set<ModuleRevisionId> mrids = confReport.getModuleRevisionIds();
+            for (ModuleRevisionId mrid : mrids) {
+                dependencies.add(confReport.getDependency(mrid).getDescriptor());
+            }
+        }
+
+        int nbPaths = 1;
+
+        // save the collection of ant scripts as a path
+        Path antScriptsPath = makePath("easyant.antscripts", sortArtifacts(ivy, artifacts,
dependencies));
+
+        // now, for each ant script descriptor, search for an ivy configuration which is
used by the ant script itself
+
+        for (ModuleDescriptor depmd : dependencies) {
+            log("Searching for external conf for " + depmd.getModuleRevisionId(), Project.MSG_VERBOSE);
+            String[] confs = depmd.getConfigurationsNames();
+            log("configurations for " + depmd.getModuleRevisionId() + " : " + Arrays.toString(confs),
Project.MSG_DEBUG);
+            for (String conf : confs) {
+                if (conf.equals("default")) {
+                    continue;
+                }
+
+                nbPaths++;
+                log("Found configuration " + conf, Project.MSG_VERBOSE);
+
+                // same process than for the ant script:
+                // * trust the last resolve report
+                // * or launch a full resolve
+                // A full resolve might trigger a retrieve to populate the local repo
+
+                XmlReportParser xmldepreport = null;
+                if (!refresh) {
+                    xmldepreport = getResolveReport(ivy, depmd.getModuleRevisionId().getModuleId(),
conf);
+                }
+                if (xmldepreport != null) {
+                    artifacts = xmldepreport.getArtifactReports();
+                } else {
+                    maybeRetrieve(depmd, conf);
+                    ResolveReport resolveReport = resolve(ivy, depmd, conf);
+                    ConfigurationResolveReport confReport = resolveReport.getConfigurationReport(conf);
+                    artifacts = confReport.getAllArtifactsReports();
+                }
+
+                // finally make the resolved artifact a path which can be used by the ant
script itself
+                makePath(depmd.getModuleRevisionId().getModuleId().toString() + "[" + conf
+ "]",
+                        Arrays.asList(artifacts));
+            }
+        }
+
+        log(nbPaths + " paths resolved in " + (System.currentTimeMillis() - startTime) +
"ms.", Project.MSG_VERBOSE);
+
+        log("Importing " + antScriptsPath.size() + " ant scripts", Project.MSG_VERBOSE);
+        Iterator itScripts = antScriptsPath.iterator();
+        while(itScripts.hasNext()) {
+            log("\t" + itScripts.next(), Project.MSG_VERBOSE);
+        }
+
+        ImportTask importTask = new ImportTask();
+        importTask.setProject(getProject());
+        importTask.setOwningTarget(getOwningTarget());
+        importTask.setLocation(getLocation());
+        importTask.add(antScriptsPath);
+        importTask.execute();
+    }
+
+    private List<ArtifactDownloadReport> sortArtifacts(Ivy ivy, ArtifactDownloadReport[]
artifacts,
+            List<ModuleDescriptor> dependencies) {
+        // first lets map the artifacts to their id
+        Map<ModuleRevisionId, List<ArtifactDownloadReport>> artifactsById = new
HashMap<ModuleRevisionId, List<ArtifactDownloadReport>>();
+        for (ArtifactDownloadReport artifact : artifacts) {
+            List<ArtifactDownloadReport> artifactsForId = artifactsById.get(artifact.getArtifact()
+                    .getModuleRevisionId());
+            if (artifactsForId == null) {
+                artifactsForId = new ArrayList<ArtifactDownloadReport>();
+                artifactsById.put(artifact.getArtifact().getModuleRevisionId(), artifactsForId);
+            }
+            artifactsForId.add(artifact);
+        }
+
+        List<ModuleDescriptor> sorted = ivy.sortModuleDescriptors(dependencies, SortOptions.DEFAULT);
+
+        List<ArtifactDownloadReport> sortedArifacts = new ArrayList<ArtifactDownloadReport>(artifacts.length);
+        for (ModuleDescriptor md : sorted) {
+            List<ArtifactDownloadReport> artifactsForId = artifactsById.get(md.getModuleRevisionId());
+            if (artifactsForId != null) {
+                sortedArifacts.addAll(artifactsForId);
+            }
+        }
+
+        return sortedArifacts;
+    }
+
+    private Ivy getIvy() {
+        Ivy ivy = getLocalRepoIvy();
+        if (ivy != null) {
+            return ivy;
+        }
+        return getExternalIvy();
+    }
+
+    /**
+     * 
+     * @return the ivy instance corresponding to the ivysettings.xml provided by the end
user
+     */
+    private Ivy getExternalIvy() {
+        if (externalIvy == null) {
+            externalIvy = new Ivy();
+            try {
+                externalIvy.configure(ivysettings);
+            } catch (ParseException e) {
+                throw new BuildException("Incorrect setup of the ivysettings for easyant
(" + e.getMessage() + ")", e);
+            } catch (IOException e) {
+                throw new BuildException("Incorrect setup of the ivysettings for easyant
(" + e.getMessage() + ")", e);
+            }
+        }
+        return externalIvy;
+    }
+
+    /**
+     * Parse an ivy.xml
+     */
+    private ModuleDescriptor getMd(Ivy ivy, File file) {
+        URL url;
+        try {
+            url = file.toURI().toURL();
+        } catch (MalformedURLException e) {
+            throw new BuildException("[easyant bug] a file has not a proper url", e);
+        }
+        URLResource res = new URLResource(url);
+        ModuleDescriptorParser mdparser = ModuleDescriptorParserRegistry.getInstance().getParser(res);
+        ModuleDescriptor md;
+        ivy.pushContext();
+        try {
+            md = mdparser.parseDescriptor(ivy.getSettings(), url, true);
+        } catch (ParseException e) {
+            throw new BuildException("The file " + file + " is not a correct ivy file ("
+ e.getMessage() + ")", e);
+        } catch (IOException e) {
+            throw new BuildException("The file " + file + " could not be read (" + e.getMessage()
+ ")", e);
+        } finally {
+            ivy.popContext();
+        }
+        return md;
+    }
+
+    /**
+     * Try to load a resolve report. If not found or not available, it returns <code>null</code>.
+     */
+    private XmlReportParser getResolveReport(Ivy ivy, ModuleId mid, String conf) {
+        File report = ivy.getResolutionCacheManager().getConfigurationResolveReportInCache(
+                ResolveOptions.getDefaultResolveId(mid), conf);
+        if (!report.exists()) {
+            return null;
+        }
+        // found a report, try to parse it.
+        try {
+            log("Reading resolve report " + report, Project.MSG_DEBUG);
+            XmlReportParser reportparser = new XmlReportParser();
+            reportparser.parse(report);
+            log("Loading last resolve report for " + mid + "[" + conf + "]", Project.MSG_VERBOSE);
+            return reportparser;
+        } catch (ParseException e) {
+            return null;
+        }
+    }
+
+    /**
+     * Launch an actual resolve
+     */
+    private ResolveReport resolve(Ivy ivy, ModuleDescriptor md, String conf) {
+        ResolveOptions options = new ResolveOptions();
+        options.setConfs(new String[] { conf });
+        ResolveReport report;
+        try {
+            report = ivy.resolve(md, options);
+        } catch (ParseException e) {
+            throw new BuildException("Error while resolving " + ivyfile, e);
+        } catch (IOException e) {
+            throw new BuildException("Error while resolving " + ivyfile, e);
+        }
+
+        if (report.hasError()) {
+            throw new BuildException("[easyant bug] fail to resolve antlib dependencies");
+        }
+
+        return report;
+    }
+
+    /**
+     * Make an array of artifacts a path and save it in the ant references
+     */
+    private Path makePath(String pathId, List<ArtifactDownloadReport> artifacts) {
+        log("Path '" + pathId + "' computed with " + artifacts.size() + " files", Project.MSG_VERBOSE);
+        Path path = new Path(getProject());
+        for (ArtifactDownloadReport artifact : artifacts) {
+            if (artifact.getLocalFile() != null) {
+                PathElement pe = path.createPathElement();
+                pe.setLocation(artifact.getLocalFile());
+                log("Adding to path '" + pathId + "': " + artifact.getLocalFile(), Project.MSG_DEBUG);
+            }
+        }
+
+        getProject().addReference(pathId, path);
+        return path;
+    }
+
+    /**
+     * If it is setup to have a retrieved local repo, get the basedir of the repo. Returns
<code>null</code> otherwise
+     */
+    private File getLocalRepoBaseDir() {
+        String basedirValue = getProject().getProperty("easyant.localrepo.basedir");
+        if (basedirValue == null) {
+            return null;
+        }
+        return getProject().resolveFile(basedirValue);
+    }
+
+    /**
+     * Build the ivy instance to be used on the local retrieved repo
+     */
+    private Ivy getLocalRepoIvy() {
+        File basedir = getLocalRepoBaseDir();
+        if (basedir == null) {
+            return null;
+        }
+
+        IvySettings settings = new IvySettings();
+        settings.setBaseDir(basedir);
+        settings.setDefaultUseOrigin(true);
+
+        File cacheDir = new File(basedir, ".cache");
+
+        ResolutionCacheManager resolutionCacheManager = new DefaultResolutionCacheManager(cacheDir);
+        settings.setResolutionCacheManager(resolutionCacheManager);
+
+        RepositoryCacheManager repositoryCacheManager = new DefaultRepositoryCacheManager("default-cache",
settings,
+                cacheDir);
+        settings.setDefaultRepositoryCacheManager(repositoryCacheManager);
+
+        FileSystemResolver localResolver = new FileSystemResolver();
+        localResolver.setName("local-repo");
+        localResolver.addIvyPattern(basedir.getAbsolutePath() + "/[organization]/[module]/[revision]/ivy.xml");
+        localResolver.addArtifactPattern(basedir.getAbsolutePath()
+                + "/[organization]/[module]/[revision]/[type]s/[artifact].[ext]");
+
+        settings.addResolver(localResolver);
+
+        settings.setDefaultResolver("local-repo");
+
+        return Ivy.newInstance(settings);
+    }
+
+    /**
+     * If setup with a local repo, clean it
+     */
+    private void maybeClearLocalRepo() {
+        File basedir = getLocalRepoBaseDir();
+        if (basedir == null) {
+            return;
+        }
+
+        log("Deleting the local repository '" + basedir + "'", Project.MSG_VERBOSE);
+
+        Delete delete = new Delete();
+        delete.setFailOnError(false);
+        delete.setDir(basedir);
+    }
+
+    /**
+     * If setup with a local repo, resolve the module and retrieve the artifacts into the
local repo.
+     */
+    private void maybeRetrieve(ModuleDescriptor md, String conf) {
+        File basedir = getLocalRepoBaseDir();
+        if (basedir == null) {
+            return;
+        }
+
+        log("Populating the local repository '" + basedir + "' with dependencies of " + md,
Project.MSG_VERBOSE);
+
+        Ivy ivy = getExternalIvy();
+        try {
+            ivy.setVariable("easyant.localrepo.basedir", basedir.getCanonicalPath());
+        } catch (IOException e) {
+            throw new BuildException("Unable to compute the path to the local repository",
e);
+        }
+        ResolveReport resolve = resolve(ivy, md, conf);
+
+        RetrieveOptions options = new RetrieveOptions();
+        options.setSync(false);
+        options.setResolveId(resolve.getResolveId());
+        options.setConfs(new String[] { conf });
+        options.setDestIvyPattern("${easyant.localrepo.basedir}/[organization]/[module]/[revision]/ivy.xml");
+        try {
+            ivy.retrieve(md.getModuleRevisionId(),
+                    "${easyant.localrepo.basedir}/[organization]/[module]/[revision]/[type]s/[artifact].[ext]",
options);
+        } catch (IOException e) {
+            throw new BuildException("Unable to build the local repository", e);
+        }
+    }
+
+}

Propchange: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/ImportAntscripts.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message