You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2012/08/29 15:22:43 UTC
svn commit: r1378533 [3/3] - in
/ant/sandbox/antdsl/branches/import-experiment: ./ ant/
org.apache.ant.antdsl/ org.apache.ant.antdsl/.settings/
org.apache.ant.antdsl/META-INF/services/
org.apache.ant.antdsl/src/org/apache/ant/antdsl/ org.apache.ant.ant...
Modified: ant/sandbox/antdsl/branches/import-experiment/ivy.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/ivy.xml?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/ivy.xml (original)
+++ ant/sandbox/antdsl/branches/import-experiment/ivy.xml Wed Aug 29 13:22:42 2012
@@ -3,11 +3,12 @@
<extends organisation="bundle" module="org.apache.ant.antdsl" revision="1.0.0" location="org.apache.ant.antdsl/META-INF/MANIFEST.MF"/>
</info>
<configurations>
+ <conf name="compile" extends="default" />
<conf name="antruntime" extends="default" />
<conf name="generate" extends="optional" />
<conf name="osgi" />
</configurations>
- <dependencies>
+ <dependencies>
<!-- ambiguity fix -->
<dependency org="bundle" name="org.apache.log4j" rev="1.2.15.v201012070815" conf="default->default" />
<dependency org="bundle" name="org.apache.commons.logging" rev="1.1.1.v201101211721" conf="default->default" />
@@ -19,6 +20,9 @@
<dependency org="org.apache.felix" name="org.apache.felix.framework" rev="4.0.3" conf="osgi,antruntime->default,sources" />
+ <!-- at ant runtime, ant is already provided -->
+ <exclude org="bundle" module="org.apache.ant" conf="antruntime" />
+
<!-- provided -->
<exclude org="package" module="javax.xml.parsers" />
<exclude org="package" module="javax.xml.transform" />
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/.classpath
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/.classpath?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
Binary files - no diff available.
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/.settings/org.eclipse.jdt.core.prefs?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/.settings/org.eclipse.jdt.core.prefs (original)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/.settings/org.eclipse.jdt.core.prefs Wed Aug 29 13:22:42 2012
@@ -1,11 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.5
Added: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ArgumentProcessor
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ArgumentProcessor?rev=1378533&view=auto
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ArgumentProcessor (added)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ArgumentProcessor Wed Aug 29 13:22:42 2012
@@ -0,0 +1 @@
+org.apache.ant.antdsl.AntDSLArgProcessor
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ProjectHelper
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ProjectHelper?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ProjectHelper (original)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/META-INF/services/org.apache.tools.ant.ProjectHelper Wed Aug 29 13:22:42 2012
@@ -1 +1 @@
-org.apache.ant.antdsl.antlr.AntDslAntlrProjectHelper
+org.apache.ant.antdsl.xtext.AntDslXTextProjectHelper
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AbstractAntDslProjectHelper.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AbstractAntDslProjectHelper.java?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AbstractAntDslProjectHelper.java (original)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AbstractAntDslProjectHelper.java Wed Aug 29 13:22:42 2012
@@ -19,10 +19,15 @@ package org.apache.ant.antdsl;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
+import java.nio.charset.Charset;
+import java.text.ParseException;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
@@ -39,6 +44,16 @@ import org.apache.ant.antdsl.expr.AntExp
import org.apache.ant.antdsl.expr.AntExpressionCondition;
import org.apache.ant.antdsl.expr.ConditionAntExpression;
import org.apache.ant.antdsl.expr.func.FunctionRegistry;
+import org.apache.ivy.Ivy;
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.report.ArtifactDownloadReport;
+import org.apache.ivy.core.report.ResolveReport;
+import org.apache.ivy.core.resolve.ResolveOptions;
+import org.apache.ivy.osgi.core.BundleInfo;
+import org.apache.ivy.osgi.core.ManifestParser;
+import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter;
+import org.apache.ivy.util.filter.Filter;
+import org.apache.ivy.util.filter.FilterHelper;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.ExtensionPoint;
import org.apache.tools.ant.MagicNames;
@@ -72,6 +87,12 @@ public abstract class AbstractAntDslProj
public static final String REFID_CLASSLOADER_STACK = "antdsl.classloader.stack";
+ public static final String REFID_ANT_PATH = "antdsl.path";
+
+ public static final String REFID_UPDATE_BUILD = "antdsl.update-build";
+
+ private static final Charset UTF8 = Charset.forName("UTF-8");
+
public String getDefaultBuildFile() {
return "build.ant";
}
@@ -250,17 +271,6 @@ public abstract class AbstractAntDslProj
}
}
- OSGiFrameworkManager osgiFrameworkManager = project.getReference(REFID_OSGI_FRAMEWORK_MANAGER);
- if (osgiFrameworkManager == null) {
- try {
- osgiFrameworkManager = new OSGiFrameworkManager(project.getBaseDir());
- } catch (BundleException e) {
- throw new BuildException("Unable to boot the OSGi framwork (" + e.getMessage() + ")", e);
- }
- project.addReference(REFID_OSGI_FRAMEWORK_MANAGER, osgiFrameworkManager);
- }
- getClassloaderStack(project).push(osgiFrameworkManager.getGodClassLoader());
-
String antFileProp = MagicNames.ANT_FILE + "." + context.getCurrentProjectName();
String dup = project.getProperty(antFileProp);
String typeProp = MagicNames.ANT_FILE_TYPE + "." + context.getCurrentProjectName();
@@ -298,6 +308,18 @@ public abstract class AbstractAntDslProj
// no further processing
return;
}
+
+ OSGiFrameworkManager osgiFrameworkManager = project.getReference(REFID_OSGI_FRAMEWORK_MANAGER);
+ if (osgiFrameworkManager == null) {
+ try {
+ osgiFrameworkManager = new OSGiFrameworkManager(project.getBaseDir());
+ } catch (BundleException e) {
+ throw new BuildException("Unable to boot the OSGi framwork (" + e.getMessage() + ")", e);
+ }
+ project.addReference(REFID_OSGI_FRAMEWORK_MANAGER, osgiFrameworkManager);
+ }
+ getClassloaderStack(project).push(osgiFrameworkManager.getGodClassLoader());
+
// set explicitly before starting ?
if (project.getProperty("basedir") != null) {
project.setBasedir(project.getProperty("basedir"));
@@ -336,21 +358,33 @@ public abstract class AbstractAntDslProj
}
protected void setupAntpath(Project project, AntDslContext context, List<InnerElement> antpathElements) {
- UnknownElement element = new UnknownElement("path");
- element.setProject(project);
- RuntimeConfigurable wrapper = new RuntimeConfigurable(element, element.getTaskName());
- context.pushWrapper(wrapper);
- for (InnerElement antpathElement : antpathElements) {
- UnknownElement child = mapUnknown(project, context, antpathElement, false);
- element.addChild(child);
+ OSGiFrameworkManager osgiFrameworkManager = getOSGiFrameworkManager(project);
+
+ Path antPath = project.getReference(REFID_ANT_PATH);
+ if (antPath == null) {
+ antPath = new Path(project);
}
- context.popWrapper();
- Path path = new Path(project);
- element.configure(path);
+ if (Boolean.TRUE.equals(project.getReference(REFID_UPDATE_BUILD))) {
+ updateBuild(project, antPath);
+ } else {
+ readAntPath(project, antPath);
+ }
- OSGiFrameworkManager osgiFrameworkManager = getOSGiFrameworkManager(project);
- Iterator<Resource> itResources = path.iterator();
+ if (!antpathElements.isEmpty()) {
+ UnknownElement element = new UnknownElement("path");
+ element.setProject(project);
+ RuntimeConfigurable wrapper = new RuntimeConfigurable(element, element.getTaskName());
+ context.pushWrapper(wrapper);
+ for (InnerElement antpathElement : antpathElements) {
+ UnknownElement child = mapUnknown(project, context, antpathElement, false);
+ element.addChild(child);
+ }
+ context.popWrapper();
+ element.configure(antPath);
+ }
+
+ Iterator<Resource> itResources = antPath.iterator();
while (itResources.hasNext()) {
Resource resource = itResources.next();
String url;
@@ -380,8 +414,178 @@ public abstract class AbstractAntDslProj
}
}
+ private void updateBuild(Project project, Path antPath) {
+ File ivyFile = new File(project.getBaseDir(), "ant/ivy.xml");
+ if (!ivyFile.exists()) {
+ return;
+ }
+
+ Ivy ivy = configureBuildIvy(project);
+
+ ResolveReport report = resolveBuild(project, ivyFile, ivy);
+
+ File ivyFixFile = new File(project.getBaseDir(), "ant/ivy-fixed.xml");
+ ModuleDescriptor md = report.toFixedModuleDescriptor(ivy.getSettings());
+ try {
+ XmlModuleDescriptorWriter.write(md, ivyFixFile);
+ } catch (IOException e) {
+ throw new BuildException("Failed to write into the file " + ivyFixFile + " (" + e.getMessage() + ")", e);
+ }
+
+ Path ivyPath = getIvyBuildPath(project, report);
+ writePath(project, ivyPath);
+ antPath.add(ivyPath);
+ }
+
+ private ResolveReport resolveBuild(Project project, File ivyFile, Ivy ivy) {
+ ResolveReport report;
+ try {
+ ResolveOptions options = new ResolveOptions();
+ options.setUncompress(true);
+ options.setDownload(false);
+ report = ivy.resolve(ivyFile, options );
+ } catch (ParseException e) {
+ throw new BuildException("The ivy file " + ivyFile + " could not be parsed", e);
+ } catch (IOException e) {
+ throw new BuildException("The ivy file " + ivyFile + " could not be read", e);
+ }
+ if (report.hasError()) {
+ for (String error : ((List<String>) report.getAllProblemMessages())) {
+ project.log(error, Project.MSG_ERR);
+ }
+ throw new BuildException("Resolve of the build path failed");
+ }
+ return report;
+ }
+
+ private Ivy configureBuildIvy(Project project) {
+ Ivy ivy = Ivy.newInstance();
+
+ File ivysettingsFile = new File(project.getBaseDir(), "ant/ivysettings.xml");
+ if (ivysettingsFile.exists()) {
+ try {
+ ivy.configure(ivysettingsFile);
+ } catch (ParseException e) {
+ throw new BuildException("The ivysettings file " + ivysettingsFile + " could not be parsed", e);
+ } catch (IOException e) {
+ throw new BuildException("The ivysettings file " + ivysettingsFile + " could not be read", e);
+ }
+ } else {
+ try {
+ ivy.configureDefault();
+ } catch (ParseException e) {
+ throw new BuildException("The default ivysettings file could not be parsed", e);
+ } catch (IOException e) {
+ throw new BuildException("The default ivysettings file could not be read", e);
+ }
+ }
+ return ivy;
+ }
+
+ private void readAntPath(Project project, Path antPath) {
+ File antPathFile = new File(project.getBaseDir(), "ant/ant.path");
+ if (!antPathFile.exists()) {
+ File ivyFixFile = new File(project.getBaseDir(), "ant/ivy-fixed.xml");
+ if (!ivyFixFile.exists()) {
+ return;
+ }
+ Ivy ivy = configureBuildIvy(project);
+ ResolveReport report = resolveBuild(project, ivyFixFile, ivy);
+ Path ivyPath = getIvyBuildPath(project, report);
+ writePath(project, ivyPath);
+ antPath.add(ivyPath);
+ return;
+ }
+
+ String path;
+ try {
+ path = FileUtils.readFully(new FileReader(antPathFile));
+ } catch (FileNotFoundException e) {
+ throw new BuildException("The cached ant path " + antPathFile + " has been deleted juste before reading it", e);
+ } catch (IOException e) {
+ throw new BuildException("The cached ant path " + antPathFile + " cannot be read", e);
+ }
+ antPath.createPathElement().setPath(path);
+ }
+
+ private Path getIvyBuildPath(Project project, ResolveReport report) {
+ // TODO make it configurable
+ boolean uncompress = true;
+ boolean osgi = true;
+ Filter artifactfilter = FilterHelper.getArtifactTypeFilter(new String[] {"bundle", "jar"});
+
+ Path ivyPath = new Path(project);
+ for (ArtifactDownloadReport adr : report.getAllArtifactsReports()) {
+ if (artifactfilter.accept(adr.getArtifact())) {
+ File f = adr.getLocalFile();
+ if (uncompress && adr.getUncompressedLocalDir() != null) {
+ f = adr.getUncompressedLocalDir();
+ }
+ addToPath(ivyPath, f, osgi);
+ }
+ }
+ return ivyPath;
+ }
+
+ private void writePath(Project project, Path ivyPath) {
+ File antPathFile = new File(project.getBaseDir(), "ant/ant.path");
+ FileOutputStream out;
+ try {
+ out = new FileOutputStream(antPathFile);
+ } catch (FileNotFoundException e) {
+ throw new BuildException("The cached ant path " + antPathFile + "could not be written", e);
+ }
+ try {
+ out.write(ivyPath.toString().getBytes(UTF8.name()));
+ } catch (IOException e) {
+ throw new BuildException("The cached ant path " + antPathFile + "could not be written", e);
+ } finally {
+ try {
+ out.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+
+ private void addToPath(Path path, File f, boolean osgi) {
+ if (!osgi || !f.isDirectory()) {
+ path.createPathElement().setLocation(f);
+ return;
+ }
+ File manifest = new File(f, "META-INF/MANIFEST.MF");
+ if (!manifest.exists()) {
+ path.createPathElement().setLocation(f);
+ return;
+ }
+ BundleInfo bundleInfo;
+ try {
+ bundleInfo = ManifestParser.parseManifest(manifest);
+ } catch (IOException e) {
+ throw new BuildException("The manifest " + manifest + " could not be read", e);
+ } catch (ParseException e) {
+ throw new BuildException("The manifest " + manifest + " could not be parsed", e);
+ }
+ @SuppressWarnings("unchecked")
+ List<String> cp = bundleInfo.getClasspath();
+ if (cp == null) {
+ path.createPathElement().setLocation(f);
+ return;
+ }
+ for (int i = 0; i < cp.size(); i++) {
+ String p = (String) cp.get(i);
+ if (p.equals(".")) {
+ path.createPathElement().setLocation(f);
+ } else {
+ path.createPathElement().setLocation(new File(f, p));
+ }
+ }
+ }
+
protected void importAntlib(Project project, AntDslContext context, String name, String resource) {
- // FIXME seems ugly
+ // TODO maybe we can do some caching here, each time a build module import the exact same antlib, it is reloaded
+
+ // FIXME we ensured it is unique, but it is ugly for the end user: we should prefer something derived from 'resource'
String uri = UUID.randomUUID().toString();
ClassLoader cl = getClassloaderStack(project).peek();
Added: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AntDSLArgProcessor.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AntDSLArgProcessor.java?rev=1378533&view=auto
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AntDSLArgProcessor.java (added)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AntDSLArgProcessor.java Wed Aug 29 13:22:42 2012
@@ -0,0 +1,33 @@
+package org.apache.ant.antdsl;
+
+import java.util.List;
+
+import org.apache.tools.ant.ArgumentProcessor;
+import org.apache.tools.ant.Project;
+
+public class AntDSLArgProcessor implements ArgumentProcessor {
+
+ public int readArgument(String arg) {
+ if (arg.equals("-update-build")) {
+ return 1;
+ }
+ return 0;
+ }
+
+ public boolean handleArg(List<String> extraArgs) {
+ return false;
+ }
+
+ public void prepareConfigure(Project project, List<String> extraArgs) {
+ project.addReference(AbstractAntDslProjectHelper.REFID_UPDATE_BUILD, true);
+ }
+
+ public boolean handleArg(Project project, List<String> arg) {
+ return true;
+ }
+
+ public void printUsage(StringBuffer msg, String lSep) {
+ msg.append(" -update-build launch a resolve of the ant path" + lSep);
+ }
+
+}
Propchange: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AntDSLArgProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AntDSLArgProcessor.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AntDSLArgProcessor.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/OSGiFrameworkManager.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/OSGiFrameworkManager.java?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/OSGiFrameworkManager.java (original)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/OSGiFrameworkManager.java Wed Aug 29 13:22:42 2012
@@ -40,7 +40,7 @@ public class OSGiFrameworkManager {
public OSGiFrameworkManager(File basedir) throws BundleException {
Map<String, String> configMap = new HashMap<String, String>();
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, ANT_PACKAGES);
- configMap.put(Constants.FRAMEWORK_STORAGE, new File(basedir, ".ant/.felix-cache").getAbsolutePath());
+ configMap.put(Constants.FRAMEWORK_STORAGE, new File(basedir, "ant/felix-cache").getAbsolutePath());
configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN, "true");
framework = getFrameworkFactory().newFramework(configMap);
framework.init();
@@ -91,6 +91,9 @@ public class OSGiFrameworkManager {
}
public void install(String bundleURI) throws BundleException {
+ if (bundleURI.startsWith("file:")) {
+ bundleURI = "reference:" + bundleURI;
+ }
Bundle bundle = framework.getBundleContext().installBundle(bundleURI);
if (!isFragment(bundle)) {
bundles.add(bundle);
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/expr/AntExpressionCondition.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/expr/AntExpressionCondition.java?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/expr/AntExpressionCondition.java (original)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/expr/AntExpressionCondition.java Wed Aug 29 13:22:42 2012
@@ -32,7 +32,6 @@ public class AntExpressionCondition impl
return expr;
}
- @Override
public boolean eval() throws BuildException {
return (Boolean) expr.eval();
}
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/AntDslXTextProjectHelper.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/AntDslXTextProjectHelper.java?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/AntDslXTextProjectHelper.java (original)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/AntDslXTextProjectHelper.java Wed Aug 29 13:22:42 2012
@@ -164,11 +164,13 @@ public class AntDslXTextProjectHelper ex
setupProject(project, context, name, basedir, def);
- EList<EInnerElement> eAntpathElements = eProject.getAntpath();
- if (eAntpathElements != null) {
+ if (!context.isIgnoringProjectTag()) {
+ EList<EInnerElement> eAntpathElements = eProject.getAntpath();
List<InnerElement> antpathElements = new ArrayList<InnerElement>();
- for (EInnerElement eAntpathElement : eAntpathElements) {
- antpathElements.add(mapInnerElement(project, context, eAntpathElement));
+ if (eAntpathElements != null) {
+ for (EInnerElement eAntpathElement : eAntpathElements) {
+ antpathElements.add(mapInnerElement(project, context, eAntpathElement));
+ }
}
setupAntpath(project, context, antpathElements);
}
Modified: ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/ParserCreator.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/ParserCreator.java?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/ParserCreator.java (original)
+++ ant/sandbox/antdsl/branches/import-experiment/org.apache.ant.antdsl/src/org/apache/ant/antdsl/xtext/ParserCreator.java Wed Aug 29 13:22:42 2012
@@ -166,7 +166,6 @@ public class ParserCreator {
private static <T> Provider<T> makeProvider(final T provided) {
return new Provider<T>() {
- @Override
public T get() {
return provided;
}
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Aug 29 13:22:42 2012
@@ -2,3 +2,4 @@ org.apache.ant.antunit-1.2.jar
ant-antunit-1.2.jar
biz.aQute.bnd-1.50.0.jar
org.apache.ant.antdsl.test-1.0.jar
+repo
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Aug 29 13:22:42 2012
@@ -0,0 +1,2 @@
+felix-cache
+ant.path
Added: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy-fixed.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy-fixed.xml?rev=1378533&view=auto
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy-fixed.xml (added)
+++ ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy-fixed.xml Wed Aug 29 13:22:42 2012
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ivy-module version="2.0">
+ <info organisation="org.apache.ant.antdsl"
+ module="test-build"
+ revision="working@hibpro.home"
+ status="integration"
+ publication="20120828211112"
+ />
+ <configurations>
+ <conf name="default" visibility="public"/>
+ </configurations>
+ <publications>
+ </publications>
+ <dependencies>
+ <dependency org="bundle" name="org.apache.ant.antdsl.test" rev="1.0.0" force="true" transitive="false" conf="default->default"/>
+ <dependency org="bundle" name="org.apache.ant.antunit" rev="1.2.0" force="true" transitive="false" conf="default->default,use_org.apache.ant.antunit.listener,use_org.apache.ant.antunit"/>
+ </dependencies>
+</ivy-module>
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy-fixed.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy-fixed.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy-fixed.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy.xml?rev=1378533&view=auto
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy.xml (added)
+++ ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy.xml Wed Aug 29 13:22:42 2012
@@ -0,0 +1,7 @@
+<ivy-module version="2.0">
+ <info organisation="org.apache.ant.antdsl" module="test-build" />
+ <dependencies>
+ <dependency org="bundle" name="org.apache.ant.antdsl.test" rev="1.0.0" conf="default->default" />
+ <dependency org="bundle" name="org.apache.ant.antunit" rev="1.2.0" conf="default->default" />
+ </dependencies>
+</ivy-module>
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivy.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivysettings.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/test/ant/ivysettings.xml?rev=1378533&view=auto
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/test/ant/ivysettings.xml (added)
+++ ant/sandbox/antdsl/branches/import-experiment/test/ant/ivysettings.xml Wed Aug 29 13:22:42 2012
@@ -0,0 +1,9 @@
+<ivysettings>
+
+ <settings defaultResolver="obr" defaultLatestStrategy="latest-osgi" />
+
+ <resolvers>
+ <obr name="obr" repoXmlFile="${ivy.settings.dir}/../repo/obr.xml" />
+ </resolvers>
+
+</ivysettings>
\ No newline at end of file
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivysettings.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivysettings.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/sandbox/antdsl/branches/import-experiment/test/ant/ivysettings.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: ant/sandbox/antdsl/branches/import-experiment/test/build.ant
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/test/build.ant?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/test/build.ant (original)
+++ ant/sandbox/antdsl/branches/import-experiment/test/build.ant Wed Aug 29 13:22:42 2012
@@ -1,10 +1,11 @@
name : myproject
default : build
-
+/*
antpath {
- file(file = "test/org.apache.ant.antunit-1.2.jar")
- file(file = "test/org.apache.ant.antdsl.test-1.0.jar")
+ file(file = "org.apache.ant.antunit-1.2.jar")
+ file(file = "org.apache.ant.antdsl.test-1.0.jar")
}
+*/
import antlib "org/apache/ant/antunit/antlib.xml" as antunit
import module "org/apache/ant/antdsl/test/build.ant"
Modified: ant/sandbox/antdsl/branches/import-experiment/test/build.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/test/build.xml?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/test/build.xml (original)
+++ ant/sandbox/antdsl/branches/import-experiment/test/build.xml Wed Aug 29 13:22:42 2012
@@ -1,4 +1,4 @@
-<project>
+<project xmlns:ivy="antlib:org.apache.ivy.ant">
<target name="get-bnd">
<get src="http://dl.dropbox.com/u/2590603/bnd/biz.aQute.bnd.jar" dest="biz.aQute.bnd-1.50.0.jar" />
@@ -15,4 +15,11 @@
<bnd files="test-module.bnd" output="org.apache.ant.antdsl.test-1.0.jar" />
</target>
+ <target name="build-repo">
+ <mkdir dir="repo" />
+ <copy file="org.apache.ant.antunit-1.2.jar" todir="repo" />
+ <copy file="org.apache.ant.antdsl.test-1.0.jar" todir="repo" />
+ <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="../build-deps/ivy-2.4.0-alpha.jar" />
+ <ivy:buildobr baseDir="repo" out="repo/obr.xml" indent="true" />
+ </target>
</project>
\ No newline at end of file
Modified: ant/sandbox/antdsl/branches/import-experiment/test/test-module.bnd
URL: http://svn.apache.org/viewvc/ant/sandbox/antdsl/branches/import-experiment/test/test-module.bnd?rev=1378533&r1=1378532&r2=1378533&view=diff
==============================================================================
--- ant/sandbox/antdsl/branches/import-experiment/test/test-module.bnd (original)
+++ ant/sandbox/antdsl/branches/import-experiment/test/test-module.bnd Wed Aug 29 13:22:42 2012
@@ -4,4 +4,4 @@ Bundle-Version: ${version}
Bundle-SymbolicName: org.apache.ant.antdsl.test
Include-Resource: test-module
Export-Package: org.apache.ant.antdsl.test.*
-Import-Package: org.apache.ant.antunit
\ No newline at end of file
+Import-Package: org.apache.ant.antunit,org.apache.ant.antunit.listener
\ No newline at end of file