Skip to content

Commit

Permalink
add skip logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hodayaGamliel committed Aug 14, 2018
1 parent b028a28 commit 2b31764
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Expand Up @@ -32,7 +32,8 @@ run {
"switcher-max-routes",
"methods-per-class",
"entry-points",
"io-cpu-intensive-matrix-size"
"io-cpu-intensive-matrix-size",
"skip-logic-code"
]

availableCommandLineArguments.each {
Expand Down
12 changes: 10 additions & 2 deletions src/main/groovy/generator/AppGenerator.groovy
Expand Up @@ -70,7 +70,11 @@ public class AppGenerator {
if (commandLine."io-cpu-intensive-matrix-size") {
Config.ioCpuIntensiveMatrixSize = commandLine."io-cpu-intensive-matrix-size"
}


if (commandLine."skip-logic-code") {
Config.shouldLogicCode = false
}

if (!Config.rootDirectory.isDirectory()) {
Config.rootDirectory.mkdirs()
}
Expand Down Expand Up @@ -148,7 +152,7 @@ public class AppGenerator {

println "\tGenerating dynamic code"

classes.each({ it.generateMethods(classes, true, true, true, true)})
classes.each({ it.generateMethods(classes, Config.shouldLogicCode, true, true, true)})

println "\tWriting ${classes.size()} classes"

Expand Down Expand Up @@ -291,5 +295,9 @@ public class AppGenerator {
args:1,
argName:"number",
"matrix size to use for io/cpu intensive logic (defaults to $Config.ioCpuIntensiveMatrixSize")

commandLineOptions._(
longOpt:"skip-logic-code",
"set for generate without logic code")
}
}
1 change: 1 addition & 0 deletions src/main/groovy/generator/Config.groovy
Expand Up @@ -30,4 +30,5 @@ public class Config {

public static ioCpuIntensiveMatrixSize = 300
public static ioCpuIntensiveFileLimit = 100
public static shouldLogicCode = true
}

0 comments on commit 2b31764

Please sign in to comment.