466647 - Add ${jetty.tag.version} property and expand URL properties

+ Add missing Props.expand(String) for:
  * the --add-to-start(d) options
  * the Module.hasFiles() method
This commit is contained in:
Joakim Erdfelt 2015-05-06 19:08:18 -07:00
parent f4faf7cb37
commit e91d3dd18e
3 changed files with 9 additions and 8 deletions

View File

@ -107,7 +107,7 @@ public class BaseBuilder
Licensing licensing = new Licensing(); Licensing licensing = new Licensing();
for (Module module : startArgs.getAllModules().getSelected()) for (Module module : startArgs.getAllModules().getSelected())
{ {
if (!module.hasFiles(baseHome)) if (!module.hasFiles(baseHome,startArgs.getProperties()))
{ {
licensing.addModule(module); licensing.addModule(module);
} }
@ -208,7 +208,7 @@ public class BaseBuilder
dirty |= builder.addModule(mod); dirty |= builder.addModule(mod);
for (String file : mod.getFiles()) for (String file : mod.getFiles())
{ {
files.add(new FileArg(mod,file)); files.add(new FileArg(mod,startArgs.getProperties().expand(file)));
} }
} }
} }
@ -228,7 +228,7 @@ public class BaseBuilder
dirty |= builder.addModule(mod); dirty |= builder.addModule(mod);
for (String file : mod.getFiles()) for (String file : mod.getFiles())
{ {
files.add(new FileArg(mod,file)); files.add(new FileArg(mod,startArgs.getProperties().expand(file)));
} }
} }
} }

View File

@ -221,11 +221,11 @@ public class Module extends Node<Module>
return !getName().equals(fileRef); return !getName().equals(fileRef);
} }
public boolean hasFiles(BaseHome baseHome) public boolean hasFiles(BaseHome baseHome, Props props)
{ {
for (String ref : getFiles()) for (String ref : getFiles())
{ {
FileArg farg = new FileArg(this,ref); FileArg farg = new FileArg(this,props.expand(ref));
Path refPath = baseHome.getBasePath(farg.location); Path refPath = baseHome.getBasePath(farg.location);
if (!Files.exists(refPath)) if (!Files.exists(refPath))
{ {

View File

@ -50,7 +50,7 @@ public class StartArgs
static static
{ {
String ver = System.getProperty("jetty.version",null); String ver = System.getProperty("jetty.version",null);
String tag = System.getProperty("jetty.tag.version",null); String tag = System.getProperty("jetty.tag.version","master");
if (ver == null) if (ver == null)
{ {
@ -73,7 +73,8 @@ public class StartArgs
tag = "master"; tag = "master";
} }
} }
else if (ver.contains("-SNAPSHOT"))
if (tag == null || tag.contains("-SNAPSHOT"))
{ {
tag = "master"; tag = "master";
} }