Skip to content

Commit

Permalink
fix: pactverify check in Gradle plugin does not work with multi-projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Sep 17, 2020
1 parent 8bf4b68 commit 7841232
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.gradle.api.invocation.Gradle
class PactPlugin implements Plugin<Project> {

private static final GROUP = 'Pact'
private static final String PACT_VERIFY = 'pactverify'
private static final String PACT_VERIFY = 'pactVerify'
private static final String TEST_CLASSES = 'testClasses'

@Override
Expand All @@ -36,7 +36,7 @@ class PactPlugin implements Plugin<Project> {
"in the build, but got a ${it.pact.class.simpleName} with value '${it.pact}' instead. " +
'Make sure there is no property that is overriding \'pact\'.', null)
} else if (it.pact.serviceProviders.empty
&& it.gradle.startParameter.taskNames.any { it.equalsIgnoreCase(PACT_VERIFY) }) {
&& it.gradle.startParameter.taskNames.any { it.toLowerCase().contains(PACT_VERIFY.toLowerCase()) }) {
throw new GradleScriptException('No service providers are configured', null)
}

Expand Down Expand Up @@ -90,7 +90,8 @@ class PactPlugin implements Plugin<Project> {

@SuppressWarnings('CatchRuntimeException')
private void setupPactConsumersFromBroker(ProviderInfo provider, Project project, PactPluginExtension ext) {
if (provider.brokerConfig && project.gradle.startParameter.taskNames.any { it.toLowerCase().contains(PACT_VERIFY) }) {
if (provider.brokerConfig && project.gradle.startParameter.taskNames.any {
it.toLowerCase().contains(PACT_VERIFY.toLowerCase()) }) {
def options = [:]
if (ext.broker.pactBrokerUsername) {
options.authentication = ['basic', ext.broker.pactBrokerUsername, ext.broker.pactBrokerPassword]
Expand Down

0 comments on commit 7841232

Please sign in to comment.