From e15bd9f7410f5f77e6f8bab8063cb8adfe79b902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Sat, 1 Apr 2023 15:29:46 +0200 Subject: [PATCH 1/3] build(gradle): Enable the Gradle Build Cache --- settings.gradle.kts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index fe08593..2af5fbc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,3 +22,23 @@ include( ) enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +buildCache { + val username = System.getenv("GRADLE_BUILD_CACHE_CREDENTIALS")?.split(':')?.get(0) + val password = System.getenv("GRADLE_BUILD_CACHE_CREDENTIALS")?.split(':')?.get(1) + + val mainBranch: String? = System.getenv("CI_DEFAULT_BRANCH") + val currentBranch: String? = System.getenv("CI_COMMIT_REF_NAME") + val runningForTag = System.getenv().containsKey("CI_COMMIT_TAG") + + remote { + url = uri("https://gradle.opensavvy.dev/cache/") + + if (username != null && password != null) credentials { + this.username = username + this.password = password + } + + isPush = (mainBranch != null && currentBranch != null && mainBranch == currentBranch) || runningForTag + } +} -- 2.51.2 From 656a5bfb5b26a83d575a0c03a3940184adceda00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Sat, 1 Apr 2023 15:30:35 +0200 Subject: [PATCH 2/3] build(idea): Do not open the test tool window if the tests are successful --- .idea/runConfigurations/All_tests.xml | 3 ++- .idea/runConfigurations/All_tests__Browser_.xml | 3 ++- .idea/runConfigurations/All_tests__JVM_.xml | 3 ++- .idea/runConfigurations/All_tests__NodeJS_.xml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.idea/runConfigurations/All_tests.xml b/.idea/runConfigurations/All_tests.xml index e7f139a..af8c191 100644 --- a/.idea/runConfigurations/All_tests.xml +++ b/.idea/runConfigurations/All_tests.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/.idea/runConfigurations/All_tests__Browser_.xml b/.idea/runConfigurations/All_tests__Browser_.xml index da6e624..c77ebb3 100644 --- a/.idea/runConfigurations/All_tests__Browser_.xml +++ b/.idea/runConfigurations/All_tests__Browser_.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/.idea/runConfigurations/All_tests__JVM_.xml b/.idea/runConfigurations/All_tests__JVM_.xml index bbbe413..5f1e44f 100644 --- a/.idea/runConfigurations/All_tests__JVM_.xml +++ b/.idea/runConfigurations/All_tests__JVM_.xml @@ -1,5 +1,5 @@ - + diff --git a/.idea/runConfigurations/All_tests__NodeJS_.xml b/.idea/runConfigurations/All_tests__NodeJS_.xml index 34e445f..ac1a547 100644 --- a/.idea/runConfigurations/All_tests__NodeJS_.xml +++ b/.idea/runConfigurations/All_tests__NodeJS_.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file -- 2.51.2 From c8ade64ea74b2ad797f8d04eceb088a4da6a2656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Sat, 1 Apr 2023 15:35:07 +0200 Subject: [PATCH 3/3] build(gradle): Enable the Gradle Build Cache for the convention plugins --- gradle/conventions/settings.gradle.kts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gradle/conventions/settings.gradle.kts b/gradle/conventions/settings.gradle.kts index f2f310f..89fcd1d 100644 --- a/gradle/conventions/settings.gradle.kts +++ b/gradle/conventions/settings.gradle.kts @@ -14,3 +14,23 @@ include( "structure", "library", ) + +buildCache { + val username = System.getenv("GRADLE_BUILD_CACHE_CREDENTIALS")?.split(':')?.get(0) + val password = System.getenv("GRADLE_BUILD_CACHE_CREDENTIALS")?.split(':')?.get(1) + + val mainBranch: String? = System.getenv("CI_DEFAULT_BRANCH") + val currentBranch: String? = System.getenv("CI_COMMIT_REF_NAME") + val runningForTag = System.getenv().containsKey("CI_COMMIT_TAG") + + remote { + url = uri("https://gradle.opensavvy.dev/cache/") + + if (username != null && password != null) credentials { + this.username = username + this.password = password + } + + isPush = (mainBranch != null && currentBranch != null && mainBranch == currentBranch) || runningForTag + } +} -- 2.51.2