Skip to content
Snippets Groups Projects
Commit 2a89ccf8 authored by Maxim Shafirov's avatar Maxim Shafirov
Browse files

Make sure loader is installed even if webpack build is initiated from Gradle,...

Make sure loader is installed even if webpack build is initiated from Gradle, especially after clean.
parent ca1e7323
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7,16 +7,27 @@ import java.util.zip.ZipFile
class KWP implements Plugin<Project> {
private static def loaderText = KWP.class.getResourceAsStream("/kwp.js").text
 
void installKwp(File targetDir, boolean force) {
def file = new File(targetDir, "kwp.js")
if (!file.exists() || force) {
targetDir.mkdirs()
writeSafely(file) { buf ->
buf.append(loaderText)
}
}
}
@Override
void apply(Project target) {
def rootProject = target.rootProject
def targetDir = new File(rootProject.buildDir, "kwp")
 
rootProject.afterEvaluate {
targetDir.mkdirs()
writeSafely(new File(targetDir, "kwp.js")) { buf ->
buf.append(loaderText)
}
installKwp(targetDir, true)
}
target.tasks['jar'] << {
installKwp(targetDir, false)
}
 
target.task(dependsOn: 'jar', 'webpack_loader') << {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment