Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 79488 invoked from network); 11 Jun 2009 21:20:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jun 2009 21:20:11 -0000 Received: (qmail 14843 invoked by uid 500); 11 Jun 2009 21:20:23 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 14811 invoked by uid 500); 11 Jun 2009 21:20:23 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 14802 invoked by uid 99); 11 Jun 2009 21:20:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jun 2009 21:20:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jun 2009 21:20:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C638023888DC; Thu, 11 Jun 2009 21:20:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r783914 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/Main.java src/java/org/apache/ivy/util/filter/FilterHelper.java Date: Thu, 11 Jun 2009 21:20:00 -0000 To: notifications@ant.apache.org From: maartenc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090611212000.C638023888DC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: maartenc Date: Thu Jun 11 21:20:00 2009 New Revision: 783914 URL: http://svn.apache.org/viewvc?rev=783914&view=rev Log: IMPROVEMENT: Standalone runner should accept all the same parameters as ant tasks (IVY-1090) Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=783914&r1=783913&r2=783914&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Thu Jun 11 21:20:00 2009 @@ -89,6 +89,7 @@ ===================================== - NEW: configuration intersections (IVY-1093) +- IMPROVEMENT: Standalone runner should accept all the same parameters as ant tasks (IVY-1090) - IMPROVEMENT: Pre and post retrieve artifact events (IVY-1084) - FIX: Ivy buildnumber task does not find artifact in Sonatype Nexus repo (IVY-1069) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java?rev=783914&r1=783913&r2=783914&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java Thu Jun 11 21:20:00 2009 @@ -55,6 +55,7 @@ import org.apache.ivy.util.cli.CommandLineParser; import org.apache.ivy.util.cli.OptionBuilder; import org.apache.ivy.util.cli.ParseException; +import org.apache.ivy.util.filter.FilterHelper; import org.apache.ivy.util.url.CredentialsStore; import org.apache.ivy.util.url.URLHandler; import org.apache.ivy.util.url.URLHandlerDispatcher; @@ -96,13 +97,23 @@ + "of the work with this as a dependency.").create()) .addOption(new OptionBuilder("confs").arg("configurations").countArgs(false) .description("resolve given configurations").create()) + .addOption(new OptionBuilder("types").arg("types").countArgs(false) + .description("comma separated list of accepted artifact types").create()) + .addOption(new OptionBuilder("mode").arg("resolvemode") + .description("the resolve mode to use").create()) + .addOption(new OptionBuilder("notransitive") + .description("do not resolve dependencies transitively").create()) .addCategory("retrieve options") .addOption(new OptionBuilder("retrieve").arg("retrievepattern") .description("use given pattern as retrieve pattern").create()) + .addOption(new OptionBuilder("ivypattern").arg("pattern") + .description("use given pattern to copy the ivy files").create()) .addOption(new OptionBuilder("sync") .description("use sync mode for retrieve").create()) - + .addOption(new OptionBuilder("symlink") + .description("create symbolic links").create()) + .addCategory("cache path options") .addOption(new OptionBuilder("cachepath").arg("cachepathfile") .description("outputs a classpath consisting of all dependencies in cache " @@ -247,7 +258,12 @@ ivy.getSettings().useDeprecatedUseOrigin(); } ResolveOptions resolveOptions = new ResolveOptions().setConfs(confs) - .setValidate(validate); + .setValidate(validate) + .setResolveMode(line.getOptionValue("mode")) + .setArtifactFilter(FilterHelper.getArtifactTypeFilter(line.getOptionValues("types"))); + if (line.hasOption("notransitive")) { + resolveOptions.setTransitive(false); + } if (line.hasOption("refresh")) { resolveOptions.setRefresh(true); } @@ -265,9 +281,13 @@ if (retrievePattern.indexOf("[") == -1) { retrievePattern = retrievePattern + "/lib/[conf]/[artifact].[ext]"; } + String ivyPattern = settings.substitute(line.getOptionValue("ivypattern")); ivy.retrieve(md.getModuleRevisionId(), retrievePattern, new RetrieveOptions() .setConfs(confs).setSync(line.hasOption("sync")) - .setUseOrigin(line.hasOption("useOrigin"))); + .setUseOrigin(line.hasOption("useOrigin")) + .setDestIvyPattern(ivyPattern) + .setArtifactFilter(FilterHelper.getArtifactTypeFilter(line.getOptionValues("types"))) + .setMakeSymlinks(line.hasOption("symlink"))); } if (line.hasOption("cachepath")) { outputCachePath(ivy, cache, md, confs, line.getOptionValue("cachepath", Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java?rev=783914&r1=783913&r2=783914&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java Thu Jun 11 21:20:00 2009 @@ -33,9 +33,20 @@ return NO_FILTER; } String[] t = types.split(","); - List acceptedTypes = new ArrayList(t.length); - for (int i = 0; i < t.length; i++) { - acceptedTypes.add(t[i].trim()); + return getArtifactTypeFilter(t); + } + + public static Filter getArtifactTypeFilter(String[] types) { + if (types == null || types.length == 0) { + return NO_FILTER; + } + List acceptedTypes = new ArrayList(types.length); + for (int i = 0; i < types.length; i++) { + String current = types[i].trim(); + if ("*".equals(current)) { + return NO_FILTER; + } + acceptedTypes.add(current); } return new ArtifactTypeFilter(acceptedTypes); }