Delete css if bss is generated

This commit is contained in:
yushijinhun 2018-11-23 17:08:17 +08:00
parent a38a1775a0
commit 875b0c27ef
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
2 changed files with 12 additions and 6 deletions

3
.gitignore vendored
View File

@ -1,5 +1,4 @@
*.class *.class
*.bss
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
@ -34,4 +33,4 @@ NVIDIA
.settings .settings
# netbeans # netbeans
.nb-gradle .nb-gradle

View File

@ -111,12 +111,19 @@ def createExecutable(String suffix, String header) {
} }
processResources { processResources {
doLast { ext.convertToBSS = { resource ->
exec { exclude resource
workingDir new File(this.projectDir, 'src/main/resources/assets/css') doFirst {
commandLine 'javapackager', '-createbss', '-outdir', '.', '-srcdir', '.' def cssFile = new File(this.projectDir, "src/main/resources/" + resource)
def bssFile = new File(this.projectDir, "build/compiled-resources/" + resource[0..-4] + "bss")
bssFile.parentFile.mkdirs()
javafx.css.Stylesheet.convertToBinary cssFile, bssFile
} }
} }
from "build/compiled-resources"
convertToBSS "assets/css/root.css"
convertToBSS "assets/css/blue.css"
} }
task makePack(dependsOn: jar) { task makePack(dependsOn: jar) {