Mercurial > hg > icedrobot > ika
changeset 38:987433a90b52
Enable downloading of bundle fro github.
author | Mario Torre <neugens.limasoftware@gmail.com> |
---|---|
date | Fri, 02 Sep 2011 22:44:58 +0200 |
parents | 5463492cd2c9 |
children | 15d0590a8fa8 |
files | src/main/java/org/icedrobot/ika/plugins/scm/IkaInitPlugin.java src/main/java/org/icedrobot/ika/runtime/scm/GITCommand.java src/main/resources/org/icedrobot/ika/plugins/borg/icedrobot.properties |
diffstat | 3 files changed, 18 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/org/icedrobot/ika/plugins/scm/IkaInitPlugin.java Thu Sep 01 23:16:55 2011 +0200 +++ b/src/main/java/org/icedrobot/ika/plugins/scm/IkaInitPlugin.java Fri Sep 02 22:44:58 2011 +0200 @@ -22,6 +22,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Properties; import java.util.Set; @@ -73,8 +74,10 @@ Options.HELP.getDescription()); accepts(Options.DEST.getOption(), Options.DEST.getDescription()).withRequiredArg(); - accepts(Options.SRC.getOption(), - Options.SRC.getDescription()).withRequiredArg(); + // TODO: remove source for now, need to read to clone from + // local repository +// accepts(Options.SRC.getOption(), +// Options.SRC.getDescription()).withRequiredArg(); } }; } @@ -109,9 +112,9 @@ try { String source = getSourceFromPropertyFile(); List<String> commandLine = new ArrayList<String>(); - if (options.has(Options.SRC.getOption())) { - source = (String) options.valueOf(Options.SRC.getOption()); - } +// if (options.has(Options.SRC.getOption())) { +// source = (String) options.valueOf(Options.SRC.getOption()); +// } commandLine.add(source); File dest = new File("./icedrobot"); @@ -122,16 +125,16 @@ } // clone the root repository - GITCommand command = new GITCommand("git", "clone", + GITCommand command = new GITCommand("clone", commandLine.toArray(new String[commandLine.size()])); System.err.println(command); IkaRuntime.exec(new File("."), command); // now we need to load the conf file to grab the subrepo list - Set subrepos = getSubRepos(dest.getCanonicalPath()); + Collection subrepos = getSubRepos(dest.getCanonicalPath()); for (Object repo : subrepos) { - command = new GITCommand("git", "clone", source + "/" + repo); + command = new GITCommand("clone", repo.toString()); System.err.println(command); IkaRuntime.exec(dest, command); } @@ -144,7 +147,7 @@ return IkaPluginResult.OK; } - private Set getSubRepos(String dest) { + private Collection getSubRepos(String dest) { Properties subrepos = new Properties(); try { System.err.println("reading: " + dest + "/.ika.properties"); @@ -154,7 +157,7 @@ throw new IkaPluginException("cannot load plugin list", ex); } - return subrepos.keySet(); + return subrepos.values(); } private String getSourceFromPropertyFile() {
--- a/src/main/java/org/icedrobot/ika/runtime/scm/GITCommand.java Thu Sep 01 23:16:55 2011 +0200 +++ b/src/main/java/org/icedrobot/ika/runtime/scm/GITCommand.java Fri Sep 02 22:44:58 2011 +0200 @@ -21,9 +21,10 @@ import org.icedrobot.ika.runtime.RuntimeCommand; public class GITCommand extends RuntimeCommand { - public GITCommand (String name, String subcommand, String... arguments) { - super("git " + subcommand + " (" + name + ")", arguments); + + public GITCommand(String subcommand, String... arguments) { + super("git " + subcommand, arguments); this.commandLine.add(0, subcommand); this.commandLine.add(0, "git"); } -} \ No newline at end of file +}
--- a/src/main/resources/org/icedrobot/ika/plugins/borg/icedrobot.properties Thu Sep 01 23:16:55 2011 +0200 +++ b/src/main/resources/org/icedrobot/ika/plugins/borg/icedrobot.properties Fri Sep 02 22:44:58 2011 +0200 @@ -1,3 +1,2 @@ # defautl location for the icedrobot root repositories -#icedrobot=http://icedtea.classpath.org/icedrobot/hg/icedrobot/ -icedrobot=/home/neugens/work_space/icedrobot2/icedrobot +icedrobot=git://github.com/neugens/icedrobot.git