Fix WebAssetVersion.yml not being written with 'clean shadowJar'

This commit is contained in:
Risto Lahtela 2021-07-24 09:09:05 +03:00
parent a90f003462
commit 750428a033
2 changed files with 34 additions and 32 deletions

View File

@ -30,8 +30,9 @@ task updateVersion(type: Copy) {
} }
task determineWebAssetModifications { task determineWebAssetModifications {
doLast {
mkdir "build/resources/main/assets/plan"
def versionFile = file("build/resources/main/assets/plan/WebAssetVersion.yml") def versionFile = file("build/resources/main/assets/plan/WebAssetVersion.yml")
versionFile.parentFile.mkdirs()
versionFile.text = "" // Clear previous build versionFile.text = "" // Clear previous build
ConfigurableFileTree tree = fileTree(dir: 'src/main/resources/assets/plan/web') ConfigurableFileTree tree = fileTree(dir: 'src/main/resources/assets/plan/web')
tree.forEach { File f -> tree.forEach { File f ->
@ -47,16 +48,17 @@ task determineWebAssetModifications {
"%s: %s\n", relativePath.toString().replace('.', ','), modified "%s: %s\n", relativePath.toString().replace('.', ','), modified
) )
} }
}
} }
processResources { processResources {
dependsOn determineWebAssetModifications
duplicatesStrategy = DuplicatesStrategy.INCLUDE duplicatesStrategy = DuplicatesStrategy.INCLUDE
dependsOn updateVersion dependsOn updateVersion
from 'build/sources/resources' from 'build/sources/resources'
} }
shadowJar { shadowJar {
dependsOn determineWebAssetModifications
dependsOn processResources dependsOn processResources
// Exclude these files // Exclude these files

View File

@ -72,7 +72,7 @@ public class WebAssetVersionCheckTask extends TaskSystem.Task {
try { try {
webAssetVersions.prepare(); webAssetVersions.prepare();
} catch (IOException e) { } catch (IOException e) {
logger.warn("Could not read web asset versions, ", e); logger.warn(String.format("Could not read web asset versions, %s", e.toString()));
logger.warn("Web asset version check will be skipped!"); logger.warn("Web asset version check will be skipped!");
return; return;
} }