From cfb953e8dc63a3069ddea436cf61e7e4b03f5822 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Tue, 13 Jun 2023 21:02:46 +0200 Subject: [PATCH] Remove secret from gradle.properties, moved it to ENV variables or local.properties --- .gitignore | 1 + build.gradle | 7 +++++-- gradle.properties | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a4bcb99..71baab6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ +local.properties run/* **/run diff --git a/build.gradle b/build.gradle index f291487..1a47000 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,9 @@ plugins { id 'fabric-loom' version '1.2-SNAPSHOT' apply false } +Properties local = new Properties() +local.load(project.rootProject.file('local.properties').newDataInputStream()) + allprojects { apply plugin: 'maven-publish' apply plugin: 'fabric-loom' @@ -39,8 +42,8 @@ allprojects { name 'altarik' url 'https://repo.altarik.fr/'.concat(project.version.endsWith('SNAPSHOT') ? 'snapshots/' : 'releases/') credentials { - username = project.repo_username - password = project.repo_password + username = Objects.requireNonNull(System.getProperty("REPO_USERNAME", local.getProperty("repo_username"))) + password = Objects.requireNonNull(System.getProperty("REPO_PASSWORD", local.getProperty("repo_password"))) } } } diff --git a/gradle.properties b/gradle.properties index bdf0a21..edaf432 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,3 @@ fabric_version=0.75.1+1.19.3 maven_group=fr.altarik.toolbox maven_version=4.1.0-SNAPSHOT repo_username=Altarik -repo_password=REPO_PASSWORD