Skip to content

Commit

Permalink
API-86: generate eclipse files based on the config flag (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
santoshaherkar authored and stevehu committed May 8, 2019
1 parent 6720ce0 commit 444a4ec
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 6 deletions.
39 changes: 39 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "api-customers",
"version": "1.0.0",
"groupId": "com.cibc.api",
"artifactId": "api-customers",
"rootPackage": "com.cibc.apif.customers",
"handlerPackage":"com.cibc.apif.customers.handler",
"modelPackage":"com.cibc.apif.customers.model",
"overwriteHandler": false,
"overwriteHandlerTest": false,
"overwriteModel": true,
"httpPort": 8080,
"enableHttp": false,
"httpsPort": 9443,
"enableHttps": true,
"enableRegistry": false,
"eclipseIDE": false,
"supportDb": false,
"dbInfo": {
"name": "mysql",
"driverClassName": "com.mysql.jdbc.Driver",
"jdbcUrl": "jdbc:mysql://mysqldb:3306/oauth2?useSSL=false",
"username": "root",
"password": "my-secret-pw"
},
"supportH2ForTest": false,
"supportClient": true,
"dockerOrganization": "cibc-api",
"generateEnvVars": {
"generate": true,
"skipArray": true,
"skipMap": true,
"exclude": [
"service.yml",
"handerl.yml",
"values.yml"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void generate(final String targetPath, Object model, Any config) throws I
String httpsPort = config.toString("httpsPort").trim();

boolean enableRegistry = config.toBoolean("enableRegistry");
boolean eclipseIDE = config.toBoolean("eclipseIDE");
boolean supportClient = config.toBoolean("supportClient");
String dockerOrganization = config.toString("dockerOrganization").trim();

Expand Down Expand Up @@ -157,9 +158,10 @@ public void generate(final String targetPath, Object model, Any config) throws I
transfer(targetPath, "", ".gitignore", templates.rest.gitignore.template());
transfer(targetPath, "", "README.md", templates.rest.README.template());
transfer(targetPath, "", "LICENSE", templates.rest.LICENSE.template());
transfer(targetPath, "", ".classpath", templates.rest.classpath.template());
transfer(targetPath, "", ".project", templates.rest.project.template(config));

if(eclipseIDE) {
transfer(targetPath, "", ".classpath", templates.rest.classpath.template());
transfer(targetPath, "", ".project", templates.rest.project.template(config));
}
// config
transfer(targetPath, ("src.main.resources.config").replace(".", separator), "service.yml", templates.rest.openapi.service.template(config));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep
boolean enableHttps = config.toBoolean("enableHttps");
String httpsPort = config.toString("httpsPort");
boolean enableRegistry = config.toBoolean("enableRegistry");
boolean eclipseIDE = config.toBoolean("eclipseIDE");
boolean supportClient = config.toBoolean("supportClient");
String dockerOrganization = config.toString("dockerOrganization");
prometheusMetrics = config.toBoolean("prometheusMetrics");
Expand Down Expand Up @@ -111,9 +112,10 @@ public void generate(String targetPath, Object model, Any config) throws IOExcep
transfer(targetPath, "", ".gitignore", templates.rest.gitignore.template());
transfer(targetPath, "", "README.md", templates.rest.README.template());
transfer(targetPath, "", "LICENSE", templates.rest.LICENSE.template());
transfer(targetPath, "", ".classpath", templates.rest.classpath.template());
transfer(targetPath, "", ".project", templates.rest.project.template(config));

if(eclipseIDE) {
transfer(targetPath, "", ".classpath", templates.rest.classpath.template());
transfer(targetPath, "", ".project", templates.rest.project.template(config));
}
// config
transfer(targetPath, ("src.main.resources.config").replace(".", separator), "service.yml", templates.rest.swagger.service.template(config));

Expand Down
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,20 @@
</pluginManagement>
</build>

<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
</repositories>

<reporting>
<plugins>
<plugin>
Expand Down

0 comments on commit 444a4ec

Please sign in to comment.