mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-11-21 03:10:58 +08:00
Compile css to bss to speed up launching
This commit is contained in:
parent
a285d2c27d
commit
74a87e65c8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
*.class
|
||||
*.bss
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
@ -110,6 +110,15 @@ def createExecutable(String suffix, String header) {
|
||||
createChecksum(output)
|
||||
}
|
||||
|
||||
processResources {
|
||||
doLast {
|
||||
exec {
|
||||
workingDir new File(this.projectDir, 'src/main/resources/assets/css')
|
||||
commandLine 'javapackager', '-createbss', '-outdir', '.', '-srcdir', '.'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task makePack(dependsOn: jar) {
|
||||
ext.outputPath = new File(jar.archivePath.parentFile, jar.archivePath.name[0..-4] + "pack")
|
||||
doLast {
|
||||
|
@ -84,12 +84,12 @@ public class Theme {
|
||||
css = temp.toURI().toString();
|
||||
} catch (IOException e) {
|
||||
Logging.LOG.log(Level.SEVERE, "Unable to create theme stylesheet. Fallback to blue theme.", e);
|
||||
css = Theme.class.getResource("/assets/css/blue.css").toExternalForm();
|
||||
css = "/assets/css/blue.css";
|
||||
}
|
||||
|
||||
return new String[]{
|
||||
css,
|
||||
Theme.class.getResource("/assets/css/root.css").toExternalForm()
|
||||
"/assets/css/root.css"
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user