Skip to content

Commit

Permalink
fix code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jj! committed Apr 4, 2018
1 parent a1b2724 commit abf83e7
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,20 @@ task generateSources {
println "generating Builders"

def processLine = { dest, template ->
def token = dest.split('\\.')[-1].replace('Builder', '')
def infile = file(template)
def outfile = file("${generatedSrcDir}/${dest.replaceAll('\\.', '/')}.java")
def outdir = file(outfile.parent)
if (!outdir.exists()) {
outdir.mkdirs()
}
if (!outfile.exists()) {
println "creating class ${dest}"
outfile.withWriter { writer ->
infile.eachLine { line ->
writer.println(line.replaceAll('\\{\\{TOKEN}}', token))
if (!dest.startsWith("org.opensaml")) {
def token = dest.split('\\.')[-1].replace('Builder', '')
def infile = file(template)
def outfile = file("${generatedSrcDir}/${dest.replaceAll('\\.', '/')}.java")
def outdir = file(outfile.parent)
if (!outdir.exists()) {
outdir.mkdirs()
}
if (!outfile.exists()) {
println "creating class ${dest}"
outfile.withWriter { writer ->
infile.eachLine { line ->
writer.println(line.replaceAll('\\{\\{TOKEN}}', token))
}
}
}
}
Expand Down

0 comments on commit abf83e7

Please sign in to comment.