forked from StarOpenSource/Engine
Rename git and gradle properties files
Useful in case the application bundles it's own files to avoid engine crashes and file name conflicts
This commit is contained in:
parent
34f61211d3
commit
747d08d354
3 changed files with 4 additions and 5 deletions
|
@ -69,7 +69,7 @@ delombok.doLast {
|
||||||
// for inclusion in final build
|
// for inclusion in final build
|
||||||
tasks.register("copyGradleProperties") {
|
tasks.register("copyGradleProperties") {
|
||||||
doFirst {
|
doFirst {
|
||||||
File target = file("${project.projectDir}/src/main/resources/gradle.properties")
|
File target = file("${project.projectDir}/src/main/resources/sosengine-gradle.properties")
|
||||||
File source = file(project(":").projectDir.getPath() + "/gradle.properties")
|
File source = file(project(":").projectDir.getPath() + "/gradle.properties")
|
||||||
target.delete()
|
target.delete()
|
||||||
Files.copy(source.toPath(), target.toPath())
|
Files.copy(source.toPath(), target.toPath())
|
||||||
|
@ -92,7 +92,7 @@ gitProperties {
|
||||||
|
|
||||||
tasks.register("writeGitProperties") { // This task's only purpose is to copy the git.properties from our git properties plugin to the resources directory so it's included in the final build
|
tasks.register("writeGitProperties") { // This task's only purpose is to copy the git.properties from our git properties plugin to the resources directory so it's included in the final build
|
||||||
doLast {
|
doLast {
|
||||||
File target = file("${project.projectDir}/src/main/resources/git.properties")
|
File target = file("${project.projectDir}/src/main/resources/sosengine-git.properties")
|
||||||
File source = file("${project.projectDir}/build/resources/main/git.properties")
|
File source = file("${project.projectDir}/build/resources/main/git.properties")
|
||||||
|
|
||||||
target.delete()
|
target.delete()
|
||||||
|
|
|
@ -156,7 +156,6 @@ public final class Engine extends SubsystemClass {
|
||||||
* @since v1-alpha0
|
* @since v1-alpha0
|
||||||
*/
|
*/
|
||||||
public Engine() {
|
public Engine() {
|
||||||
// Only allow one instance
|
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
instance = this;
|
instance = this;
|
||||||
else
|
else
|
||||||
|
|
|
@ -322,7 +322,7 @@ public final class EngineInformation {
|
||||||
public static synchronized void updateVariables() {
|
public static synchronized void updateVariables() {
|
||||||
// Load properties from bundled gradle.properties
|
// Load properties from bundled gradle.properties
|
||||||
Properties gradleProperties = new Properties();
|
Properties gradleProperties = new Properties();
|
||||||
InputStream gradleStream = EngineInformation.class.getClassLoader().getResourceAsStream("gradle.properties");
|
InputStream gradleStream = EngineInformation.class.getClassLoader().getResourceAsStream("sosengine-gradle.properties");
|
||||||
|
|
||||||
if (gradleStream == null) {
|
if (gradleStream == null) {
|
||||||
System.out.println("Unable to load build information: The bundled gradle.properties file could not be found.");
|
System.out.println("Unable to load build information: The bundled gradle.properties file could not be found.");
|
||||||
|
@ -344,7 +344,7 @@ public final class EngineInformation {
|
||||||
// Load properties from bundled git.properties
|
// Load properties from bundled git.properties
|
||||||
// or fill in blank information if file missing
|
// or fill in blank information if file missing
|
||||||
Properties gitProperties = new Properties();
|
Properties gitProperties = new Properties();
|
||||||
InputStream gitStream = EngineInformation.class.getClassLoader().getResourceAsStream("git.properties");
|
InputStream gitStream = EngineInformation.class.getClassLoader().getResourceAsStream("sosengine-git.properties");
|
||||||
if (gitStream == null) {
|
if (gitStream == null) {
|
||||||
logger.error("Unable to load build information: The bundled git.properties file could not be found. Did you download a tarball?");
|
logger.error("Unable to load build information: The bundled git.properties file could not be found. Did you download a tarball?");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue