Skip to content

Commit

Permalink
fix: allways apply the plugin-publish plugin to the Gradle plugin pro…
Browse files Browse the repository at this point in the history
…ject #1588
  • Loading branch information
uglyog committed Aug 10, 2022
1 parent 5ef6270 commit 561f042
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 62 deletions.
86 changes: 44 additions & 42 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -142,61 +142,63 @@ subprojects {
systemProperty 'pact_do_not_track', 'true'
}

publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
if (!project.hasProperty('isGradleRelease')) {
// Gradle plugin plugin will automatically add these
if (name != 'gradle') {
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourceJar
artifact javadocJar
}
pom {
name = project.name
description = StringEscapeUtils.escapeXml11(new File(projectDir, 'README.md').text)
url = 'https://github.com/DiUS/pact-jvm'
licenses {
license {
name = 'Apache 2'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/pact-foundation/pact-jvm'
connection = 'https://github.com/pact-foundation/pact-jvm.git'
}

developers {
developer {
id = 'thetrav'
name = 'Travis Dixon'
email = 'the.trav@gmail.com'
pom {
name = project.name
description = StringEscapeUtils.escapeXml11(new File(projectDir, 'README.md').text)
url = 'https://github.com/DiUS/pact-jvm'
licenses {
license {
name = 'Apache 2'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/pact-foundation/pact-jvm'
connection = 'https://github.com/pact-foundation/pact-jvm.git'
}
developer {
id = 'rholshausen'
name = 'Ronald Holshausen'
email = 'rholshausen@dius.com.au'

developers {
developer {
id = 'thetrav'
name = 'Travis Dixon'
email = 'the.trav@gmail.com'
}
developer {
id = 'rholshausen'
name = 'Ronald Holshausen'
email = 'rholshausen@dius.com.au'
}
}
}
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
if (project.hasProperty('sonatypeUsername')) {
credentials {
username sonatypeUsername
password sonatypePassword
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
if (project.hasProperty('sonatypeUsername')) {
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
}
}

signing {
required { project.hasProperty('isRelease') }
sign publishing.publications.mavenPublication
signing {
required { project.hasProperty('isRelease') }
sign publishing.publications.mavenPublication
}
}

// codenarcMain {
Expand Down
34 changes: 14 additions & 20 deletions provider/gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
plugins {
id "com.gradle.plugin-publish" version "1.0.0" apply false
}

if (project.hasProperty('isGradleRelease')) {
apply plugin: 'com.gradle.plugin-publish'
id "com.gradle.plugin-publish" version "1.0.0"
}

dependencies {
Expand All @@ -27,22 +23,20 @@ groovydoc {
enabled = false
}

if (project.hasProperty('isGradleRelease')) {
pluginBundle {
website = 'https://github.com/pact-foundation/pact-jvm/tree/master/provider/gradle'
vcsUrl = 'https://github.com/pact-foundation/pact-jvm'
description = 'Gradle plugin for verifying pacts against a provider.'
tags = ['pact', 'cdc', 'consumerdrivencontracts', 'microservicetesting']
}
pluginBundle {
website = 'https://github.com/pact-foundation/pact-jvm/tree/master/provider/gradle'
vcsUrl = 'https://github.com/pact-foundation/pact-jvm'
description = 'Gradle plugin for verifying pacts against a provider.'
tags = ['pact', 'cdc', 'consumerdrivencontracts', 'microservicetesting']
}

gradlePlugin {
plugins {
pactProviderPlugin {
id = 'au.com.dius.pact'
displayName = 'Gradle Pact Provider plugin'
implementationClass = 'au.com.dius.pact.provider.gradle.PactPlugin'
description = 'Gradle plugin for verifying pacts against a provider.'
}
gradlePlugin {
plugins {
pactProviderPlugin {
id = 'au.com.dius.pact'
displayName = 'Gradle Pact Provider plugin'
implementationClass = 'au.com.dius.pact.provider.gradle.PactPlugin'
description = 'Gradle plugin for verifying pacts against a provider.'
}
}
}
Expand Down

0 comments on commit 561f042

Please sign in to comment.