Permalink
Browse files

Added -sysrep option to compile tool to set/override system repository

  • Loading branch information...
quintesse committed Sep 14, 2012
1 parent 0eb1c3b commit dc809aebf879e59bd4a368d4e2aab409ad39ed2d
@@ -48,6 +48,8 @@
private List<String> repo = new ArrayList<String>(1);
+ private String systemRepo;
+
private boolean disableDefault;
@Argument(argumentName="module", multiplicity="1")
@@ -67,6 +69,12 @@ public void setRepo(List<String> repo) {
this.repo = repo;
}
+ @OptionArgument(longName="sysrep", argumentName="url")
+ @Description("Specifies the system repository.")
+ public void setSytemRepo(String systemRepo) {
+ this.systemRepo = systemRepo;
+ }
+
@Option(longName="d")
@Description("Disables the default module repositories and source directory.")
public void setDisableDefault(boolean disableDefault) {
@@ -75,10 +83,17 @@ public void setDisableDefault(boolean disableDefault) {
@Override
public void run() {
- // TODO Auto-generated method stub
ArrayList<String> argList = new ArrayList<String>();
+
+ String sysRep;
+ if (systemRepo != null) {
+ sysRep = systemRepo;
+ } else {
+ sysRep = System.getProperty("ceylon.system.repo");
+ }
+
argList.addAll(Arrays.asList(new String[]{
- "-mp", System.getProperty("ceylon.system.repo"),
+ "-mp", sysRep,
"ceylon.runtime:0.4",
"+executable", "ceylon.modules.jboss.runtime.JBossRuntime"}));
@@ -91,6 +106,9 @@ public void run() {
argList.add("-d");
}
+ argList.add("-sysrep");
+ argList.add(sysRep);
+
for (String repo : this.repo) {
argList.add("-rep");
argList.add(repo);
@@ -82,7 +82,7 @@ public ClassLoader createClassLoader(String name, String version, Configuration
*/
protected RepositoryManager createRepository(Configuration conf) {
Logger log = new JULLogger();
- final RepositoryManagerBuilder builder = CeylonUtils.makeRepositoryManagerBuilder(conf.repositories, null, log);
+ final RepositoryManagerBuilder builder = CeylonUtils.makeRepositoryManagerBuilder(conf.systemRepository, conf.repositories, null, log);
final MergeStrategy ms = getService(MergeStrategy.class, conf);
if (ms != null)
@@ -47,6 +47,11 @@
*/
public List<String> repositories = new LinkedList<String>();
+ /**
+ * The path to the system repository (default = null)
+ */
+ public String systemRepository;
+
/**
* Name of class or toplevel method to run
*/
@@ -104,6 +109,9 @@ public int setArgument(String name, ArgumentType type, String[] values, int i) {
case RUN:
run = values[arg];
break;
+ case SYSTEM_REPOSITORY:
+ systemRepository = values[arg];
+ break;
case REPOSITORY:
repositories.add(values[arg]);
break;
@@ -26,6 +26,7 @@
IMPLEMENTATION("impl", ArgumentType.IMPL, 2),
RUN("run", ArgumentType.CEYLON, 1),
REPOSITORY("rep", ArgumentType.CEYLON, 1),
+ SYSTEM_REPOSITORY("sysrep", ArgumentType.CEYLON, 1),
SOURCE("src", ArgumentType.CEYLON, 1),
VERBOSE("verbose", ArgumentType.CEYLON, 0),
HELP("help", ArgumentType.CEYLON, 0, "h", "-help"),

0 comments on commit dc809ae

Please sign in to comment.