Skip to content

Commit

Permalink
Pr/jaredsburrows/update error messages (#422)
Browse files Browse the repository at this point in the history
* update error messages
  • Loading branch information
jaredsburrows authored Jan 30, 2024
1 parent 915e67a commit bda2dfa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LicensePlugin : Plugin<Project> {
project.isAndroidProject() -> project.configureAndroidProject()
project.isJavaProject() -> project.configureJavaProject()
else -> throw UnsupportedOperationException(
"'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle Plugins.",
"'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle based plugins.",
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ final class LicensePluginJavaSpec extends Specification {
buildFile <<
"""
plugins {
id 'java'
id 'java-library'
id 'com.jaredsburrows.license'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import spock.lang.Specification
import spock.lang.Unroll

import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
import static org.gradle.testkit.runner.TaskOutcome.FAILED
import static test.TestUtils.gradleWithCommand
import static test.TestUtils.gradleWithCommandWithFail

Expand Down Expand Up @@ -49,7 +48,7 @@ final class LicensePluginSpec extends Specification {
}
}
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'com.jaredsburrows.license'
"""

Expand Down Expand Up @@ -82,15 +81,15 @@ final class LicensePluginSpec extends Specification {
def result = gradleWithCommandWithFail(testProjectDir.root, 'licenseReport', '-s')

then:
result.output.contains("'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle Plugins.")
result.output.contains("'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle based plugins.")
}

def 'apply plugin with plugins dsl'() {
given:
buildFile <<
"""
plugins {
id 'java'
id 'java-library'
id 'com.jaredsburrows.license'
}
"""
Expand All @@ -115,7 +114,7 @@ final class LicensePluginSpec extends Specification {
def result = gradleWithCommandWithFail(testProjectDir.root, 'licenseReport', '-s')

then:
result.output.contains("'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle Plugins.")
result.output.contains("'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle based plugins.")
}

@Unroll
Expand All @@ -133,7 +132,7 @@ final class LicensePluginSpec extends Specification {
def result = gradleWithCommandWithFail(testProjectDir.root, 'licenseReport', '-s')

then:
result.output.contains("'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle Plugins.")
result.output.contains("'com.jaredsburrows.license' requires Java, Kotlin or Android Gradle based plugins.")

where:
// https://github.com/gradle/gradle/find/master, search for "gradle-plugins"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class LicensePluginVersionSpec extends Specification {
buildFile <<
"""
plugins {
id 'java'
id 'java-library'
id 'com.jaredsburrows.license'
}
"""
Expand Down

0 comments on commit bda2dfa

Please sign in to comment.