build ivy plugin via sigil vs bnd FELIX-1444
* add resolver dependencies to sigil-defaults
* add ant lib to sigil-repos
* set up sigil and ivy files
* set up ivy/ intermediate build files
* retrieve built ivy plugin jar in top level site target
* tidy up unused targets from build.xml


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@800457 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/sigil/bldcommon/sigil-repos.properties b/sigil/bldcommon/sigil-repos.properties
index ab5dcfd..a2eb4eb 100644
--- a/sigil/bldcommon/sigil-repos.properties
+++ b/sigil/bldcommon/sigil-repos.properties
@@ -2,7 +2,7 @@
 
 # repository config
 
--repositories:  system, project, bld-common, bld-hack, spring
+-repositories:  system, project, bld-ant, bld-common, bld-hack, spring
 
 system;provider:        system
 system;level:           -1
@@ -13,18 +13,23 @@
 	${..}/common/**/[sigilproject] \
 	${..}/eclipse/**/[sigilproject] \
 
+bld-ant;provider:	filesystem
+bld-ant;level:	1
+bld-ant;recurse:	true
+bld-ant;dir:		${..}/cache/ant/lib
+
 bld-common;provider:	filesystem
-bld-common;level:	1
+bld-common;level:	2
 bld-common;recurse:	true
 bld-common;dir:		${..}/cache/all
 
 bld-hack;provider:	filesystem
-bld-hack;level:		2
+bld-hack;level:		3
 bld-hack;recurse:	true
 bld-hack;dir:		${..}/cache/eclipse2
 
 spring;provider:	obr
-spring;level:		3
+spring;level:		4
 spring;url:             http://sigil.codecauldron.org/spring-external.obr
 spring;index:           ${..}/build/spring-external.obr
 spring;cache:		${..}/build/obr-cache
diff --git a/sigil/build.xml b/sigil/build.xml
index 8dd549b..67d8859 100644
--- a/sigil/build.xml
+++ b/sigil/build.xml
@@ -21,7 +21,8 @@
   xmlns:ivy="antlib:org.apache.ivy.ant">
   <import file="bldcommon/common.xml"/>
   <fileset id="my.projects" dir="${basedir}">
-    <exclude name="ivy/**/${build_xml}"/>
+    <exclude name="ivy/resolver/test/**/${build_xml}"/>
+    <exclude name="ivy/resolver/example/**/${build_xml}"/>
     <exclude name="bldcommon/**/${build_xml}" />
     <include name="**/${build_xml}"/>
   </fileset>
@@ -36,15 +37,8 @@
 
   <target name="build" depends="build-list" />
 
-  <target name="build-ivy">
-    <subant buildpath="ivy/resolver" />
-  </target>
-
-  <target name="clean-ivy">
-    <subant buildpath="ivy/resolver" target="clean" />
-  </target>
-
   <target name="site" depends="common-init">
+    <!-- eclipse -->
     <ivy:retrieve organisation="org.apache" module="felix.sigil.common.core" revision="latest.integration" inline="true" pattern="${site.dir}/plugins/[artifact].[ext]" transitive="false"/>
     <ivy:retrieve organisation="org.apache" module="felix.sigil.common.junit" revision="latest.integration" inline="true" pattern="${site.dir}/plugins/[artifact].[ext]" transitive="false"/>
     <ivy:retrieve organisation="org.apache" module="felix.sigil.common.obr" revision="latest.integration" inline="true" pattern="${site.dir}/plugins/[artifact].[ext]" transitive="false"/>
@@ -56,6 +50,9 @@
     <ivy:retrieve organisation="org.apache" module="felix.sigil.eclipse.utils" revision="latest.integration" inline="true" pattern="${site.dir}/plugins/[artifact].[ext]" transitive="false"/>
     <ivy:retrieve organisation="biz.aQute" module="bndlib" revision="0.0.312" inline="true" pattern="${site.dir}/plugins/[artifact].[ext]" transitive="false"/>
     <ivy:retrieve organisation="sigil" module="com.springsource.org.apache.commons.lang" revision="2.4.0" inline="true" pattern="${site.dir}/plugins/[artifact].[ext]" transitive="false"/>
+    
+    <!-- ivy -->
+    <ivy:retrieve organisation="org.apache" module="felix.sigil.ivy.resolver" revision="latest.integration" inline="true" pattern="${site.dir}/ivy/[artifact].[ext]" transitive="false"/>
   </target>
 
   <target name="clean-site">
diff --git a/sigil/ivy/build.xml b/sigil/ivy/build.xml
new file mode 100644
index 0000000..86d090a
--- /dev/null
+++ b/sigil/ivy/build.xml
@@ -0,0 +1,22 @@
+<?xml 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.
+-->
+<project name="ivy" default="build-list">
+  <import file="../bldcommon/common.xml"/>
+</project>
diff --git a/sigil/ivy/resolver/.classpath b/sigil/ivy/resolver/.classpath
index cd526f7..b0a411c 100644
--- a/sigil/ivy/resolver/.classpath
+++ b/sigil/ivy/resolver/.classpath
@@ -2,10 +2,7 @@
 <classpath>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="lib" path="lib/runtime/equinox.common.jar"/>
-	<classpathentry kind="lib" path="lib/runtime/osgi.core.jar"/>
-	<classpathentry kind="lib" path="lib/compile/ant.jar"/>
-	<classpathentry kind="lib" path="lib/compile/ivy-2.0.0-rc1.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/org.apache.felix.sigil.common.core"/>
+	<classpathentry kind="con" path="org.cauldron.sigil.core.classpathContainer"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>
diff --git a/sigil/ivy/resolver/.project b/sigil/ivy/resolver/.project
index c259c9d..b6ab63d 100644
--- a/sigil/ivy/resolver/.project
+++ b/sigil/ivy/resolver/.project
@@ -10,8 +10,14 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.cauldron.sigil.core.newtonBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.cauldron.sigil.core.newtonnature</nature>
 	</natures>
 </projectDescription>
diff --git a/sigil/ivy/resolver/build.xml b/sigil/ivy/resolver/build.xml
index e8cc813..d2aa097 100644
--- a/sigil/ivy/resolver/build.xml
+++ b/sigil/ivy/resolver/build.xml
@@ -17,102 +17,10 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<project xmlns:ivy="antlib:org.apache.ivy.ant" name="bld-ivy" default="jar">
-
-    <!-- buildVersion is overridden by Hudson -->
-    <property name="buildVersion" value="0.8.0-dev" />
-    <property name="version" value="${buildVersion}" />
-
-    <property name="name" value="sigil-ivy-plugin" />
-    <property name="name.jar" value="${name}.jar" />
-    <property name="name-version.jar" value="${name}-${version}.jar" />
-
-    <property name="lib.dir" value="${basedir}/lib" />
-    <property name="target.dir" value="${basedir}/target" />
-    <property name="classes.dir" value="${basedir}/target/classes" />
-
-    <property name="java-src.dir" value="${basedir}/src" />
-
-    <property name="sigil-plugins.dir" location="../../build/repository/local/" />
-    <property name="bnd-plugins.dir" location="../../common/core/lib" />
-
-    <target name="init" depends="find-plugins">
-
-      <path id="run.classpath">
-        <pathelement location="${classes.dir}" />
-        <pathelement location="${bld-core.jar}" />
-        <pathelement location="${bld-obr.jar}" />
-        <pathelement location="${equinox-common.jar}" />
-        <pathelement location="${osgi-core.jar}" />
-      </path>
-
-      <path id="compile.classpath">
-	<path refid="run.classpath"/>
-        <fileset dir="${lib.dir}/compile">
-            <include name="*.jar" />
-        </fileset>
-      </path>
-
-    </target>
-
-    <target name="mkdirs">
-        <mkdir dir="${target.dir}" />
-        <mkdir dir="${classes.dir}" />
-    </target>
-
-    <target name="find-plugins" depends="mkdirs">
-      <property name="osgi-core.jar" value="${lib.dir}/runtime/osgi.core.jar"/>
-      <property name="equinox-common.jar" value="${lib.dir}/runtime/equinox.common.jar"/>
-
-      <fileset id="bld-core" dir="${sigil-plugins.dir}"
-	includes="felix.sigil.common.core/*/jars/org.apache.felix.sigil.common.core.jar" />
-      <property name="bld-core" refid="bld-core"/>
-      <property name="bld-core.jar" location="${sigil-plugins.dir}/${bld-core}"/>
-
-      <fileset id="bld-obr" dir="${sigil-plugins.dir}"
-	includes="felix.sigil.common.obr/*/jars/org.apache.felix.sigil.common.obr.jar" />
-      <property name="bld-obr" refid="bld-obr"/>
-      <property name="bld-obr.jar" location="${sigil-plugins.dir}/${bld-obr}"/>
-    </target>
-
-    <target name="clean">
-        <delete dir="${target.dir}" />
-    </target>
-    
-    <target name="compile" depends="init">
-        <javac debug="true" debuglevel="source,lines,vars" source="1.5" target="1.5" fork="true" destdir="${classes.dir}" srcdir="${java-src.dir}">
-            <classpath refid="compile.classpath" />
-        </javac>
-    </target>
-    
-    <target name="dist" depends="jar">
-	<zip destfile="${target.dir}/sigil-${version}.zip">
-	  <zipfileset dir="example" prefix="sigil-${version}/example"
-	  	excludes="**/build/**, **/lib/**, **/ivy-cache/**, **/repository/**"/>
-	  <zipfileset dir="target" prefix="sigil-${version}/lib"
-		includes="${name.jar}, bndlib.jar"/>
-	</zip>
-    
-    	<copy file="${target.dir}/${name.jar}" tofile="${target.dir}/${name-version.jar}"/>
-    </target>
-
-    <target name="jar" depends="compile, taskdefs">
-       <bnd 
-	  classpath="${toString:run.classpath}" 
-	  files="sigil-ivy-plugin.bnd" 
-	  output="${target.dir}/${name.jar}"
-	  eclipse="false" 
-	  failok="false" 
-	  exceptions="true" />
-
-      <copy todir="${target.dir}">
-        <fileset dir="${bnd-plugins.dir}" includes="bndlib.jar"/>
-      </copy>
-    </target>
-
-    <target name="taskdefs"> 
-      <taskdef resource="aQute/bnd/ant/taskdef.properties"
-	classpath="${lib.dir}/ant/bnd-0.0.312.jar"/> 
-    </target>
-
+<project name="ivy.resolver" default="build"
+  xmlns:ivy="antlib:org.apache.ivy.ant">
+  <import file="../build.xml"/>
+  <target name="init">
+    <!--ivy:retrieve organisation="org.eclipse" module="org.eclipse.swt.carbon.macosx" revision="3.4.1.v3452b" inline="true" pattern="lib/[artifact].[ext]" transitive="false"/-->
+  </target>
 </project>
diff --git a/sigil/ivy/resolver/ivy.xml b/sigil/ivy/resolver/ivy.xml
new file mode 100644
index 0000000..2c7d0e6
--- /dev/null
+++ b/sigil/ivy/resolver/ivy.xml
@@ -0,0 +1,28 @@
+<?xml 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.
+-->
+<ivy-module version="1.0">
+  <info 
+        organisation="org.apache"
+        module="felix.sigil.ivy.resolver"
+        status="integration"/>
+   <publications>
+     <artifact name="org.apache.felix.sigil.ivy.resolver" />
+   </publications>
+</ivy-module>
diff --git a/sigil/ivy/resolver/sigil-ivy-plugin.bnd b/sigil/ivy/resolver/sigil-ivy-plugin.bnd
deleted file mode 100644
index 8ae60c5..0000000
--- a/sigil/ivy/resolver/sigil-ivy-plugin.bnd
+++ /dev/null
@@ -1,22 +0,0 @@
-# sigil-ivy-plugin.jar
-
-Bundle-DocURL: http://sigil.codecauldron.org
-Bundle-Vendor: Paremus Limited
-Bundle-Version: ${version}
-
-# we depend on bndlib, but don't want to embed it,
-# in case other tasks want a different version.
-# So just add Class-Path to the manifest, so we load bndlib.jar
-# if it's in the same directory as the sigil-ivy-plugin.
-Class-Path: bndlib.jar equinox.common.jar
-
-# embed other dependencies directly in the plugin
-Private-Package: \
-  org.apache.felix.sigil.*, \
-  profiles.*, \
-  org.osgi.framework
-
--removeheaders: TODAY, DSTAMP, TSTAMP
--pedantic: true
-
-# end
diff --git a/sigil/ivy/resolver/sigil.properties b/sigil/ivy/resolver/sigil.properties
new file mode 100644
index 0000000..18622f6
--- /dev/null
+++ b/sigil/ivy/resolver/sigil.properties
@@ -0,0 +1,45 @@
+
+# sigil project file, saved by plugin.
+
+-bundles: \
+	org.apache.felix.sigil.ivy.resolver, \
+
+-contents: \
+  org.apache.felix.sigil.*, \
+  profiles.*, \
+  org.osgi.framework, \
+
+-imports: \
+	org.apache.felix.sigil.bnd, \
+	org.apache.felix.sigil.config, \
+	org.apache.felix.sigil.core, \
+	org.apache.felix.sigil.core.licence, \
+	org.apache.felix.sigil.core.repository, \
+	org.apache.felix.sigil.model, \
+	org.apache.felix.sigil.model.common, \
+	org.apache.felix.sigil.model.eclipse, \
+	org.apache.felix.sigil.model.osgi, \
+	org.apache.felix.sigil.obr, \
+	org.apache.felix.sigil.repository, \
+	org.apache.ivy, \
+	org.apache.ivy.core, \
+	org.apache.ivy.core.module.descriptor, \
+	org.apache.ivy.core.module.id, \
+	org.apache.ivy.core.resolve, \
+	org.apache.ivy.core.settings, \
+	org.apache.ivy.plugins.parser, \
+	org.apache.ivy.plugins.parser.xml, \
+	org.apache.ivy.plugins.repository, \
+	org.apache.ivy.plugins.repository.file, \
+	org.apache.ivy.plugins.repository.url, \
+	org.apache.ivy.plugins.resolver, \
+	org.apache.ivy.plugins.resolver.util, \
+	org.apache.ivy.util, \
+	org.apache.tools.ant, \
+	org.apache.tools.ant.types, \
+	org.osgi.framework, \
+
+-requires: \
+	org.eclipse.equinox.common;version=3.4.0, \
+
+# end
diff --git a/sigil/ivy/sigil-defaults.properties b/sigil/ivy/sigil-defaults.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/sigil/ivy/sigil-defaults.properties
diff --git a/sigil/sigil-defaults.properties b/sigil/sigil-defaults.properties
index 25adfab..86bdfd9 100644
--- a/sigil/sigil-defaults.properties
+++ b/sigil/sigil-defaults.properties
@@ -22,6 +22,9 @@
 package;org.apache.commons.lang:				2.4.0
 package;org.apache.commons.lang.text:				2.4.0
 
+package;org.apache.ivy*:					2.0.0
+package;org.apache.tools.ant*:					1.7.1
+
 # ganymede
 # package;org.eclipse.core.resources:				3.4.1
 # package;org.eclipse.core.runtime.content:			1.5.4