diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-02-02 18:46:56 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-02-02 18:49:41 +0100 |
commit | 02e10f1b1602e1b15064b7a511783c8bdec42c94 (patch) | |
tree | fa07032f47aacc5cabd333b7f360a9220edcbeee | |
parent | 4a60c74c61682733d8797df330a3670f82d26e98 (diff) |
Gradle: Make Yarn and Snowpack builds incremental.
Change-Id: I547d2580faf4c768045361ce73b7a079a1e0d3f5
-rw-r--r-- | build.gradle | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/build.gradle b/build.gradle index 3986100..7302b0d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,6 @@ +import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage +import com.bmuschko.gradle.docker.tasks.image.DockerPushImage + plugins { id 'java' id 'io.quarkus' @@ -94,14 +97,27 @@ group "eu.mulk" version "${projectVersion}" task yarnInstall(type:Exec) { - workingDir "src/main/resources/META-INF/resources" + def resourceDir = "src/main/resources/META-INF/resources" + + inputs.file "${resourceDir}/package.json" + outputs.dir "${resourceDir}/node_modules" + outputs.file "${resourceDir}/yarn.lock" + + workingDir resourceDir commandLine "yarn", "install" } task snowpack(type:Exec) { + def resourceDir = "src/main/resources/META-INF/resources" + dependsOn yarnInstall - workingDir "src/main/resources/META-INF/resources" + inputs.dir "${resourceDir}/node_modules" + inputs.file "${resourceDir}/yarn.lock" + inputs.file "${resourceDir}/package.json" + outputs.dir "${resourceDir}/web_modules" + + workingDir resourceDir commandLine "yarn", "run", "snowpack" } @@ -119,7 +135,7 @@ processResources { quarkusBuild.dependsOn compileWeb -task buildDocker(type: com.bmuschko.gradle.docker.tasks.image.DockerBuildImage) { +task buildDocker(type: DockerBuildImage) { inputDir = file(".") dockerFile = file("src/main/docker/Dockerfile.jvm") images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}") @@ -128,7 +144,7 @@ task buildDocker(type: com.bmuschko.gradle.docker.tasks.image.DockerBuildImage) buildDocker.dependsOn quarkusBuild assemble.dependsOn buildDocker -task pushDocker(type: com.bmuschko.gradle.docker.tasks.image.DockerPushImage) { +task pushDocker(type: DockerPushImage) { images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}") } |