mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Fix publishing to maven
This commit is contained in:
parent
6f6072dbd0
commit
e431324f98
2 changed files with 50 additions and 1 deletions
|
@ -11,7 +11,8 @@ plugins {
|
||||||
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.8" // https://github.com/JetBrains/gradle-idea-ext-plugin
|
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.8" // https://github.com/JetBrains/gradle-idea-ext-plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: './gradle/java.gradle'
|
apply from: "./gradle/java.gradle"
|
||||||
|
apply from: "gradle/property_loader.gradle"
|
||||||
|
|
||||||
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false')
|
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false')
|
||||||
ext.buildNumber = System.getenv('BUILD_NUMBER')
|
ext.buildNumber = System.getenv('BUILD_NUMBER')
|
||||||
|
|
48
gradle/property_loader.gradle
Normal file
48
gradle/property_loader.gradle
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
This module can inject build properties from a JSON file. Each property in the
|
||||||
|
JSON file will be mapped to a build property using the key of that property.
|
||||||
|
Property keys ending with _comment will be skipped.
|
||||||
|
|
||||||
|
If a secretFile property exists and points to a valid JSON file that file will
|
||||||
|
be automatically loaded. You can manually load a file using the loadProperties
|
||||||
|
method.
|
||||||
|
*/
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
|
// Auto detects a secret file and injects it.
|
||||||
|
if (project.rootProject.hasProperty("secretFile")) {
|
||||||
|
project.logger.lifecycle("Automatically loading properties from the secretFile")
|
||||||
|
final def secretsFile = project.rootProject.file(project.rootProject.getProperty("secretFile"))
|
||||||
|
|
||||||
|
if (secretsFile.exists() && secretsFile.name.endsWith(".json")) {
|
||||||
|
loadProperties(secretsFile)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loads properties using a specified json file.
|
||||||
|
def loadProperties(propertyFile) {
|
||||||
|
if (propertyFile.exists()) {
|
||||||
|
propertyFile.withReader {
|
||||||
|
Map propMap = new JsonSlurper().parse it
|
||||||
|
|
||||||
|
for (entry in propMap) {
|
||||||
|
|
||||||
|
// Filter entries that use _comment in the key.
|
||||||
|
if (!entry.key.endsWith("_comment")) {
|
||||||
|
|
||||||
|
project.ext.set(entry.key, entry.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project.logger.lifecycle("Successfully loaded " + propMap.size() + " properties")
|
||||||
|
propMap.clear()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
project.logger.warn("The property file " + propertyFile.getName() + " could not be loaded. It does not exist.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allows other scripts to use these methods.
|
||||||
|
ext {
|
||||||
|
loadProperties = this.&loadProperties
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue