mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-29 05:36:13 +01:00
Allow build scripts to reference a template's source files
This commit is contained in:
parent
dfabbcf4ad
commit
ff709ba314
@ -178,17 +178,13 @@ public class InternalSubCreator extends SubCreator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (template.getBuildOptions().contains("Executable")) {
|
if (template.getBuildOptions().contains("Executable")) {
|
||||||
File cache;
|
File cache = null;
|
||||||
if (template.getBuildOptions().getBoolean("Use-Cache", true)) {
|
if (template.getBuildOptions().getBoolean("Use-Cache", true)) {
|
||||||
cache = new UniversalFile(host.plugin.dir, "SubServers:Cache:Templates:" + template.getName());
|
cache = new UniversalFile(host.plugin.dir, "SubServers:Cache:Templates:" + template.getName());
|
||||||
cache.mkdirs();
|
cache.mkdirs();
|
||||||
String c = cache.toString();
|
var.put("cache", cache.getAbsolutePath());
|
||||||
if (System.getProperty("os.name").toLowerCase().startsWith("windows") &&
|
|
||||||
(template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("bash ") || template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("sh "))) c = c.replace(File.separatorChar, '/');
|
|
||||||
var.put("cache", c);
|
|
||||||
} else {
|
|
||||||
cache = null;
|
|
||||||
}
|
}
|
||||||
|
var.put("source", dir.getAbsolutePath());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Logger.get(prefix).info("Launching Build Script...");
|
Logger.get(prefix).info("Launching Build Script...");
|
||||||
|
@ -378,17 +378,13 @@ public class SubCreatorImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (template.getBuildOptions().contains("Executable")) {
|
if (template.getBuildOptions().contains("Executable")) {
|
||||||
File cache;
|
File cache = null;
|
||||||
if (template.getBuildOptions().getBoolean("Use-Cache", true)) {
|
if (template.getBuildOptions().getBoolean("Use-Cache", true)) {
|
||||||
cache = new UniversalFile(GalaxiEngine.getInstance().getRuntimeDirectory(), "Cache:Templates:" + template.getName());
|
cache = new UniversalFile(GalaxiEngine.getInstance().getRuntimeDirectory(), "Cache:Templates:" + template.getName());
|
||||||
cache.mkdirs();
|
cache.mkdirs();
|
||||||
String c = cache.toString();
|
var.put("cache", cache.getAbsolutePath());
|
||||||
if (System.getProperty("os.name").toLowerCase().startsWith("windows") &&
|
|
||||||
(template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("bash ") || template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("sh "))) c = c.replace(File.separatorChar, '/');
|
|
||||||
var.put("cache", c);
|
|
||||||
} else {
|
|
||||||
cache = null;
|
|
||||||
}
|
}
|
||||||
|
var.put("source", dir.getAbsolutePath());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.logger.info.println("Launching Build Script...");
|
log.logger.info.println("Launching Build Script...");
|
||||||
|
Loading…
Reference in New Issue
Block a user