mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-11 04:46:18 -04: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
|
*.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*
|
||||||
|
@ -110,6 +110,15 @@ def createExecutable(String suffix, String header) {
|
|||||||
createChecksum(output)
|
createChecksum(output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
doLast {
|
||||||
|
exec {
|
||||||
|
workingDir new File(this.projectDir, 'src/main/resources/assets/css')
|
||||||
|
commandLine 'javapackager', '-createbss', '-outdir', '.', '-srcdir', '.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
task makePack(dependsOn: jar) {
|
task makePack(dependsOn: jar) {
|
||||||
ext.outputPath = new File(jar.archivePath.parentFile, jar.archivePath.name[0..-4] + "pack")
|
ext.outputPath = new File(jar.archivePath.parentFile, jar.archivePath.name[0..-4] + "pack")
|
||||||
doLast {
|
doLast {
|
||||||
|
@ -84,12 +84,12 @@ public class Theme {
|
|||||||
css = temp.toURI().toString();
|
css = temp.toURI().toString();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Logging.LOG.log(Level.SEVERE, "Unable to create theme stylesheet. Fallback to blue theme.", 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[]{
|
return new String[]{
|
||||||
css,
|
css,
|
||||||
Theme.class.getResource("/assets/css/root.css").toExternalForm()
|
"/assets/css/root.css"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user