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 authored and rholshausen committed Nov 24, 2022
1 parent 78a6dc8 commit e924d80
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 62 deletions.
92 changes: 50 additions & 42 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ subprojects {
apply plugin: 'jacoco'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'io.gitlab.arturbosch.detekt'
if (System.env.TRAVIS != 'true') {
if (System.env.CI != 'true') {
apply plugin: 'org.jetbrains.dokka'
}
//apply plugin: "org.javamodularity.moduleplugin"

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
}

compileTestGroovy {
classpath = classpath.plus(files(compileTestKotlin.destinationDir))
dependsOn compileTestKotlin
Expand Down Expand Up @@ -101,11 +106,13 @@ subprojects {
if (System.env.CI != 'true') {
task javadocJar(type: Jar, dependsOn: [javadoc, groovydoc, dokkaJavadoc]) {
archiveClassifier = 'javadoc'
duplicatesStrategy = 'exclude'
from javadoc.destinationDir, groovydoc.destinationDir, dokkaJavadoc.outputDirectory
}
} else {
task javadocJar(type: Jar, dependsOn: [javadoc, groovydoc]) {
archiveClassifier = 'javadoc'
duplicatesStrategy = 'exclude'
from javadoc.destinationDir, groovydoc.destinationDir
}
}
Expand All @@ -125,7 +132,7 @@ subprojects {
showExceptions true
showStackTraces true
showStandardStreams false
events "passed", "skipped", "failed" //, "standardOut", "standardError"
events "passed", "skipped", "failed"
}
} else {
// Show test results.
Expand All @@ -138,60 +145,61 @@ 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/DiUS/pact-jvm'
connection = 'https://github.com/DiUS/pact-jvm.git'
}

developers {
developer {
id = 'thetrav'
name = 'Travis Dixon'
email = '[email protected]'
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'
}
}
developer {
id = 'rholshausen'
name = 'Ronald Holshausen'
email = '[email protected]'
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 = '[email protected]'
}
developer {
id = 'rholshausen'
name = 'Ronald Holshausen'
email = '[email protected]'
}
}
}
}
}
}
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
}
}
}
}
}
}

if (System.env.CI != 'true') {
signing {
required { project.hasProperty('isRelease') }
sign publishing.publications.mavenPublication
}
}
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 e924d80

Please sign in to comment.