Skip to content

Commit 21404ca

Browse files
committed
Fix log messages having insane indentations
1 parent 78a104e commit 21404ca

File tree

5 files changed

+33
-45
lines changed

5 files changed

+33
-45
lines changed

src/main/groovy/net/minecraftforge/gradleutils/ConfigureTeamCity.groovy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ abstract class ConfigureTeamCity extends DefaultTask {
4949

5050
@TaskAction
5151
void exec() {
52-
this.logger.warn """
53-
WARNING: Usage of TeamCity is deprecated within Minecraft Forge
54-
Minecraft Forge has been gradually moving off of TeamCity and into GitHub Actions.
55-
When the migration is fully complete, this task along with its automatic setup will be removed."""
52+
this.logger.warn '''WARNING: Usage of TeamCity is deprecated within Minecraft Forge
53+
Minecraft Forge has been gradually moving off of TeamCity and into GitHub Actions.
54+
When the migration is fully complete, this task along with its automatic setup will be removed.'''
5655

5756
this.logger.lifecycle 'Setting project variables and parameters.'
5857
println "##teamcity[buildNumber '${this.version.get()}']"

src/main/groovy/net/minecraftforge/gradleutils/GradleUtilsExtension.groovy

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,17 @@ class GradleUtilsExtension {
3434

3535
/** @deprecated Use {@link net.minecraftforge.gitver.api.GitVersion#getRoot() GitVersion.getRoot()} via {@link GitVersionExtension#getVersion()} instead. */
3636
@Deprecated(forRemoval = true, since = '2.4') @Lazy DirectoryProperty gitRoot = {
37-
this.project.logger.warn """
38-
WARNING: This project is still using 'gradleutils.gitRoot'.
39-
It has been deprecated and will be removed in GradleUtils 3.0.
40-
Consider using 'gitversion.version.root' instead."""
37+
this.project.logger.warn '''WARNING: This project is still using 'gradleutils.gitRoot'.
38+
It has been deprecated and will be removed in GradleUtils 3.0.
39+
Consider using 'gitversion.version.root' instead.'''
4140

4241
objects.directoryProperty().fileProvider providers.provider { this.gitversion.version.root }
4342
}()
4443
/** @deprecated Use {@link net.minecraftforge.gitver.api.GitVersion#getInfo() GitVersion.getInfo()} via {@link GitVersionExtension#getVersion()} instead. */
4544
@Deprecated(forRemoval = true, since = '2.4') @Lazy Map<String, String> gitInfo = {
46-
this.project.logger.warn """
47-
WARNING: This project is still using 'gradleutils.gitInfo'.
48-
It has been deprecated and will be removed in GradleUtils 3.0.
49-
Consider using 'gitversion.version.info' instead."""
45+
this.project.logger.warn '''WARNING: This project is still using 'gradleutils.gitInfo'.
46+
It has been deprecated and will be removed in GradleUtils 3.0.
47+
Consider using 'gitversion.version.info' instead.'''
5048

5149
var version = this.project.extensions.getByType(GitVersionExtension).version
5250
[
@@ -202,10 +200,9 @@ class GradleUtilsExtension {
202200
}
203201

204202
private void logDeprecation(String name, String fullName) {
205-
this.project.logger.warn """
206-
WARNING: This project is still using 'gradleutils.$name'.
207-
It has been deprecated and will be removed in GradleUtils 3.0.
208-
Consider using 'gitversion.version.$fullName' instead."""
203+
this.project.logger.warn """WARNING: This project is still using 'gradleutils.$name'.
204+
It has been deprecated and will be removed in GradleUtils 3.0.
205+
Consider using 'gitversion.version.$fullName' instead."""
209206
}
210207

211208
/** @see GradleUtils#getPublishingForgeMaven(Project, File) */

src/main/groovy/net/minecraftforge/gradleutils/PomUtils.groovy

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,34 +125,30 @@ final class PomUtils {
125125
url = "github.com/${organization}/${repo}".toString()
126126

127127
if (url && url == remoteUrl) {
128-
this.logger.warn """
129-
WARNING: The repository name was specified in the 'setGitHubDetails' method, but it was already present in the Git remote URL.
130-
This is redundant and may cause issues if the remote repository URL changes in the future."""
128+
this.logger.warn '''WARNING: The repository name was specified in the 'setGitHubDetails' method, but it was already present in the Git remote URL.
129+
This is redundant and may cause issues if the remote repository URL changes in the future.'''
131130
}
132131
}
133132

134133
if (!url) {
135-
this.logger.warn """
136-
WARNING: The GitHub URL for this repo could not be automatically determined by GitVersion.
137-
This is likely due to the repository not having any remotes, or not having one set."""
134+
this.logger.warn '''WARNING: The GitHub URL for this repo could not be automatically determined by Git Version.
135+
This is likely due to the repository not having any remotes, not having one set, or some other issue with Git Version.'''
138136
if (inCI)
139137
throw new IllegalStateException('GitHub URL could not be determined, which is required in CI')
140138

141139
return
142140
}
143141

144142
if (!url.contains('github.com')) {
145-
this.logger.warn """
146-
WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com'
147-
This is problematic since all Minecraft Forge projects are hosted on GitHub.
148-
Found url: ${url}"""
143+
this.logger.warn """WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com'
144+
This is problematic since all Minecraft Forge projects are hosted on GitHub.
145+
Found url: $url"""
149146
}
150147

151148
if (!url.contains('github.com/MinecraftForge')) {
152-
this.logger.warn """
153-
WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com/MinecraftForge'
154-
This is problematic if you are attempting to publish this project, especially from GitHub Actions.
155-
Found url: ${url}"""
149+
this.logger.warn """WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com/MinecraftForge'
150+
This is problematic if you are attempting to publish this project, especially from GitHub Actions.
151+
Found url: $url"""
156152
}
157153

158154
var fullURL = "https://${url}".toString()

src/main/groovy/net/minecraftforge/gradleutils/changelog/GenerateChangelog.groovy

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,13 @@ abstract class GenerateChangelog extends DefaultTask {
9191

9292
file.setText(changelog, 'UTF8')
9393
} catch (GitVersionException e) {
94-
this.logger.error """
95-
ERROR: Failed to generate the changelog for this project, likely due to a misconfiguration.
96-
GitVersion has caught the exception, the details of which are attached to this error.
97-
Check that the correct tags are being used, or updating the tag prefix accordingly."""
94+
this.logger.error '''ERROR: Failed to generate the changelog for this project, likely due to a misconfiguration.
95+
GitVersion has caught the exception, the details of which are attached to this error.
96+
Check that the correct tags are being used, or updating the tag prefix accordingly.'''
9897
throw e
9998
} catch (IOException e) {
100-
this.logger.error """
101-
ERROR: Changelog was generated successfully, but could not be written to the disk.
102-
Ensure that you have write permissions to the output directory."""
99+
this.logger.error '''ERROR: Changelog was generated successfully, but could not be written to the disk.
100+
Ensure that you have write permissions to the output directory.'''
103101
throw new RuntimeException(e)
104102
}
105103
}

src/main/groovy/net/minecraftforge/gradleutils/gitversion/GitVersionExtension.groovy

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ class GitVersionExtension {
3737
try {
3838
return builder.build().tap { it.info }
3939
} catch (GitVersionException ignored) {
40-
this.project.logger.warn """
41-
WARNING: Git Version failed to get version numbers! Attempting to use default version 0.0.0.
42-
Check your GitVersion config file and make sure the correct tag prefix and filters are in use.
43-
Ensure that the tags you are attempting to use exist in the repository."""
40+
this.project.logger.warn '''WARNING: Git Version failed to get version numbers! Attempting to use default version 0.0.0.
41+
Check your GitVersion config file and make sure the correct tag prefix and filters are in use.
42+
Ensure that the tags you are attempting to use exist in the repository.'''
4443
return builder.strict(false).build()
4544
} catch (IllegalArgumentException e) {
46-
this.project.logger.error """
47-
ERROR: Git Version is misconfigured and cannot be used, likely due to incorrect paths being set.
48-
This is an unrecoverable problem and needs to be addressed in the config file.
49-
Ensure that the correct subprojects and paths are declared in the config file"""
45+
this.project.logger.error '''ERROR: Git Version is misconfigured and cannot be used, likely due to incorrect paths being set.
46+
This is an unrecoverable problem and needs to be addressed in the config file.
47+
Ensure that the correct subprojects and paths are declared in the config file'''
5048
throw e
5149
}
5250
}()

0 commit comments

Comments
 (0)