Skip to content

Commit 696f558

Browse files
committed
track settings.gradle with script updater
1 parent 1a91174 commit 696f558

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

.github/workflows/buildscript-maintenance.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches: [ master, main ]
88
paths:
99
- build.gradle
10+
- settings.gradle
1011
workflow_dispatch: { }
1112

1213
jobs:

build.gradle

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ plugins {
3232
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
3333
}
3434

35-
if (verifySettingsGradle()) {
36-
throw new GradleException("Settings has been updated, please re-run task.")
37-
}
38-
3935
def out = services.get(StyledTextOutputFactory).create('an-output')
4036

4137

@@ -1022,29 +1018,18 @@ static URL availableBuildScriptUrl() {
10221018
new URL("https://raw.githubusercontent.com/GregTechCEu/Buildscripts/master/build.gradle")
10231019
}
10241020

1025-
static URL exampleSettingsGradleUrl() {
1021+
static URL availableSettingsGradleUrl() {
10261022
new URL("https://raw.githubusercontent.com/GregTechCEu/Buildscripts/master/settings.gradle")
10271023
}
10281024

1029-
boolean verifySettingsGradle() {
1030-
def settingsFile = getFile("settings.gradle")
1031-
if (!settingsFile.exists()) {
1032-
println("Downloading default settings.gradle")
1033-
exampleSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } }
1034-
return true
1035-
}
1036-
return false
1037-
}
1038-
10391025
boolean performBuildScriptUpdate() {
10401026
if (isNewBuildScriptVersionAvailable()) {
10411027
def buildscriptFile = getFile("build.gradle")
1028+
def settingsFile = getFile("settings.gradle")
10421029
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
1030+
availableSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } }
10431031
def out = services.get(StyledTextOutputFactory).create('buildscript-update-output')
10441032
out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
1045-
if (verifySettingsGradle()) {
1046-
throw new GradleException("Settings has been updated, please re-run task.")
1047-
}
10481033
return true
10491034
}
10501035
return false

settings.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ plugins {
2727
blowdryerSetup {
2828
repoSubfolder 'spotless'
2929
github 'GregTechCEu/Buildscripts', 'tag', 'v1.0.0'
30-
//devLocal '.' // Use this when testing config updated locally
3130
}
3231

3332
rootProject.name = rootProject.projectDir.getName()

0 commit comments

Comments
 (0)