defaulted sources to go to src/gen/main and added possibility to set impl folder via system property at command-line

This commit is contained in:
Ole Lensmar
2015-05-20 16:49:50 -06:00
parent adcd0f4bb8
commit 17d8d14cc8
3 changed files with 61 additions and 11 deletions

View File

@@ -54,10 +54,16 @@ public class Generate implements Runnable {
"Pass in a URL-encoded string of name:header with a comma separating multiple values")
private String auth;
@Option( name= {"-D"}, title = "system properties", description = "sets specified system properties in " +
"the format of name=value,name=value")
private String systemProperties;
@Override
public void run() {
verbosed(verbose);
setSystemProperties();
ClientOptInput input = new ClientOptInput();
if (isNotEmpty(auth)) {
@@ -77,6 +83,17 @@ public class Generate implements Runnable {
new DefaultGenerator().opts(input.opts(new ClientOpts()).swagger(swagger)).generate();
}
private void setSystemProperties() {
if( systemProperties != null && systemProperties.length() > 0 ){
for( String property : systemProperties.split(",")) {
int ix = property.indexOf('=');
if( ix > 0 && ix < property.length()-1 ){
System.setProperty( property.substring(0, ix), property.substring(ix+1) );
}
}
}
}
/**
* If true parameter, adds system properties which enables debug mode in generator
* @param verbose - if true, enables debug mode