diff --git a/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectExtension.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectExtension.kt index 94a67712f..338390998 100644 --- a/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectExtension.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectExtension.kt @@ -163,6 +163,8 @@ open class SubprojectExtension(val project: Project) { // Sets maven credentials if they are provided. This is generally // only used for external/remote uploads. if (project.hasProperty("mavenUsername") && project.hasProperty("mavenPassword") && project.hasProperty("mavenURL")) { + project.logger.lifecycle("Adding maven from secrets") + maven { credentials { username = project.property("mavenUsername") as String @@ -177,10 +179,11 @@ open class SubprojectExtension(val project: Project) { private fun loadSecrets() { // Detects the secrets file provided by CI and loads it into the project properties if (project.rootProject.hasProperty("secretFile")) { - project.logger.lifecycle("Automatically loading properties from the secretFile") val secretsFile = project.rootProject.file(project.rootProject.property("secretFile") as String) if (secretsFile.exists() && secretsFile.name.endsWith(".properties")) { + project.logger.lifecycle("Loading secrets") + loadProperties(secretsFile) } } @@ -193,14 +196,14 @@ open class SubprojectExtension(val project: Project) { var count = 0 for (entry in properties.entries) { if (entry.key is String) { - project.setProperty(entry.key as String, entry.value) + project.extra[entry.key as String] = entry.value as String count++ } } - project.logger.lifecycle("Successfully loaded $count properties") + project.logger.lifecycle("Loaded $count properties") } else { - project.logger.warn("The property file ${propertyFile.getName()} could not be loaded. It does not exist.") + project.logger.warn("The property file ${propertyFile.getName()} does not exist") } } }