Skip to content

Commit 991e243

Browse files
committed
Make all log messages single-line
1 parent 72b9436 commit 991e243

File tree

5 files changed

+12
-33
lines changed

5 files changed

+12
-33
lines changed

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

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

5050
@TaskAction
5151
void exec() {
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.'''
52+
this.logger.warn 'WARNING: Usage of TeamCity is deprecated within Minecraft Forge Minecraft Forge has been gradually moving off of TeamCity and into GitHub Actions. When the migration is fully complete, this task along with its automatic setup will be removed.'
5553

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

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ 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 '''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.'''
37+
this.project.logger.warn "WARNING: This project is still using 'gradleutils.gitRoot'. It has been deprecated and will be removed in GradleUtils 3.0. Consider using 'gitversion.version.root' instead."
4038

4139
objects.directoryProperty().fileProvider providers.provider { this.gitversion.version.root }
4240
}()
4341
/** @deprecated Use {@link net.minecraftforge.gitver.api.GitVersion#getInfo() GitVersion.getInfo()} via {@link GitVersionExtension#getVersion()} instead. */
4442
@Deprecated(forRemoval = true, since = '2.4') @Lazy Map<String, String> gitInfo = {
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.'''
43+
this.project.logger.warn "WARNING: This project is still using 'gradleutils.gitInfo'. It has been deprecated and will be removed in GradleUtils 3.0. Consider using 'gitversion.version.info' instead."
4844

4945
var version = this.project.extensions.getByType(GitVersionExtension).version
5046
[
@@ -200,9 +196,7 @@ Consider using 'gitversion.version.info' instead.'''
200196
}
201197

202198
private void logDeprecation(String name, String fullName) {
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."""
199+
this.project.logger.warn "WARNING: This project is still using 'gradleutils.$name'. It has been deprecated and will be removed in GradleUtils 3.0. Consider using 'gitversion.version.$fullName' instead."
206200
}
207201

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

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,30 +146,24 @@ final class PomUtils {
146146
url = "github.com/${organization}/${repo}".toString()
147147

148148
if (url && url == remoteUrl) {
149-
this.logger.warn '''WARNING: The repository name was specified in the 'setGitHubDetails' method, but it was already present in the Git remote URL.
150-
This is redundant and may cause issues if the remote repository URL changes in the future.'''
149+
this.logger.warn "WARNING: The repository name was specified in the 'setGitHubDetails' method, but it was already present in the Git remote URL. This is redundant and may cause issues if the remote repository URL changes in the future."
151150
}
152151
}
153152

154153
if (!url) {
155-
this.logger.warn '''WARNING: The GitHub URL for this repo could not be automatically determined by Git Version.
156-
This is likely due to the repository not having any remotes, not having one set, or some other issue with Git Version.'''
154+
this.logger.warn 'WARNING: The GitHub URL for this repo could not be automatically determined by Git Version. This is likely due to the repository not having any remotes, not having one set, or some other issue with Git Version.'
157155
if (inCI)
158156
throw new IllegalStateException('GitHub URL could not be determined, which is required in CI')
159157

160158
return
161159
}
162160

163161
if (!url.contains('github.com')) {
164-
this.logger.warn """WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com'
165-
This is problematic since all Minecraft Forge projects are hosted on GitHub.
166-
Found url: $url"""
162+
this.logger.warn "WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com' This is problematic since all Minecraft Forge projects are hosted on GitHub. Found url: $url"
167163
}
168164

169165
if (!url.contains('github.com/MinecraftForge')) {
170-
this.logger.warn """WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com/MinecraftForge'
171-
This is problematic if you are attempting to publish this project, especially from GitHub Actions.
172-
Found url: $url"""
166+
this.logger.warn "WARNING: The repository URL found or created in 'setGitHubDetails' does not include 'github.com/MinecraftForge' This is problematic if you are attempting to publish this project, especially from GitHub Actions. Found url: $url"
173167
}
174168

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

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

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

9292
file.setText(changelog, 'UTF8')
9393
} catch (GitVersionException e) {
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.'''
94+
this.logger.error 'ERROR: Failed to generate the changelog for this project, likely due to a misconfiguration. GitVersion has caught the exception, the details of which are attached to this error. Check that the correct tags are being used, or updating the tag prefix accordingly.'
9795
throw e
9896
} catch (IOException e) {
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.'''
97+
this.logger.error 'ERROR: Changelog was generated successfully, but could not be written to the disk. Ensure that you have write permissions to the output directory.'
10198
throw new RuntimeException(e)
10299
}
103100
}

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ class GitVersionExtension {
3737
try {
3838
return builder.build().tap { it.info }
3939
} catch (GitVersionException ignored) {
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.'''
40+
this.project.logger.warn 'WARNING: Git Version failed to get version numbers! Attempting to use default version 0.0.0. Check your GitVersion config file and make sure the correct tag prefix and filters are in use. Ensure that the tags you are attempting to use exist in the repository.'
4341
return builder.strict(false).build()
4442
} catch (IllegalArgumentException e) {
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'''
43+
this.project.logger.error 'ERROR: Git Version is misconfigured and cannot be used, likely due to incorrect paths being set. This is an unrecoverable problem and needs to be addressed in the config file. Ensure that the correct subprojects and paths are declared in the config file'
4844
throw e
4945
}
5046
}()

0 commit comments

Comments
 (0)