Respect quiet mode in version printout
This commit is contained in:
parent
5389e61eee
commit
2b1404179e
3 changed files with 8 additions and 3 deletions
|
@ -44,7 +44,7 @@ class PaperweightCore : Plugin<Project> {
|
|||
override fun apply(target: Project) {
|
||||
checkJavaVersion()
|
||||
Git.checkForGit()
|
||||
printId<PaperweightCore>("paperweight-core")
|
||||
printId<PaperweightCore>("paperweight-core", target.gradle)
|
||||
|
||||
val ext = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightCoreExtension::class, target)
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ import org.gradle.api.file.FileSystemLocation
|
|||
import org.gradle.api.file.ProjectLayout
|
||||
import org.gradle.api.file.RegularFile
|
||||
import org.gradle.api.file.RegularFileProperty
|
||||
import org.gradle.api.invocation.Gradle
|
||||
import org.gradle.api.logging.LogLevel
|
||||
import org.gradle.api.plugins.JavaPluginExtension
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.provider.Provider
|
||||
|
@ -352,6 +354,9 @@ fun checkJavaVersion() {
|
|||
}
|
||||
}
|
||||
|
||||
inline fun <reified P> printId(pluginId: String) {
|
||||
inline fun <reified P> printId(pluginId: String, gradle: Gradle) {
|
||||
if (gradle.startParameter.logLevel == LogLevel.QUIET) {
|
||||
return
|
||||
}
|
||||
println("$pluginId v${P::class.java.`package`.implementationVersion} (running on '${System.getProperty("os.name")}')")
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class PaperweightPatcher : Plugin<Project> {
|
|||
override fun apply(target: Project) {
|
||||
checkJavaVersion()
|
||||
Git.checkForGit()
|
||||
printId<PaperweightPatcher>("paperweight-patcher")
|
||||
printId<PaperweightPatcher>("paperweight-patcher", target.gradle)
|
||||
|
||||
val patcher = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightPatcherExtension::class, target)
|
||||
|
||||
|
|
Loading…
Reference in a new issue