Skip to content

Instantly share code, notes, and snippets.

@jochenberger
Last active February 23, 2017 12:45
Show Gist options
  • Save jochenberger/9c61fbbb1db5d935ee35ed65e15ba1aa to your computer and use it in GitHub Desktop.
Save jochenberger/9c61fbbb1db5d935ee35ed65e15ba1aa to your computer and use it in GitHub Desktop.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "de.eddyson:tapestry-react:0.26.0"
}
}
allprojects {
processResources {
def compilerInputs = [:]
filesMatching(['**/*.jsm', '**/*.jsx', '**/*.jsxm']){
def relativePath = it.path
def relativeOutputPath = relativePath.replaceAll(/x?m?$/, '')
compilerInputs.put(relativeOutputPath, it.file.text)
it.exclude()
}
doLast {
def compiler = new de.eddyson.tapestry.react.StandaloneCompiler()
def outputs = compiler.compile(compilerInputs)
outputs.each { k,v->
def target = new File(destinationDir, k)
target.parentFile.mkdirs()
target.text = v
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment