From 637e8e185a38ccb3ac70559f19f4868846190f34 Mon Sep 17 00:00:00 2001 From: tmohay Date: Fri, 13 Sep 2019 21:31:19 +1000 Subject: [PATCH 1/2] made it work --- build.gradle | 73 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index ae356f73aa..d7e9c697b2 100644 --- a/build.gradle +++ b/build.gradle @@ -300,7 +300,6 @@ subprojects { task testSupportJar(type: Jar) { baseName = "${project.name}-support-test" - classifier = 'test-support' from sourceSets.testSupport.output } @@ -310,52 +309,72 @@ subprojects { return result } + def pomData = { + name = "Pantheon - ${project.name}" + url = 'http://github.com/PegaSysEng/pantheon' + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + scm { + connection = 'scm:git:git://github.com/PegaSysEng/pantheon.git' + developerConnection = 'scm:git:ssh://github.com/PegaSysEng/pantheon.git' + url = 'https://github.com/PegaSysEng/pantheon' + } + } + + def versionMappingData = { + usage('java-api') { fromResolutionOf('runtimeClasspath') } + usage('java-runtime') { fromResolutionResult() } + } + + def projectPublications = [] + if(sourceSetIsPopulated("main") || sourceSetIsPopulated("testSupport")) { apply plugin: 'com.jfrog.bintray' apply plugin: 'maven-publish' publishing { publications { - mavenJava(MavenPublication) { - groupId "tech.pegasys.pantheon.internal" - version "${project.version}" - if(sourceSetIsPopulated("main")) { + if(sourceSetIsPopulated("main")) { + mavenJava(MavenPublication) { + groupId "tech.pegasys.pantheon.internal" + version "${project.version}" from components.java artifact sourcesJar artifact javadocJar + versionMapping versionMappingData + pom pomData } - - if(sourceSetIsPopulated("testSupport")) { + projectPublications.add("mavenJava") + } + if(sourceSetIsPopulated("testSupport")) { + testSupport(MavenPublication) { + groupId "tech.pegasys.pantheon.internal.testsupport" + version "${project.version}" artifact testSupportJar + versionMapping versionMappingData + pom pomData } - versionMapping { - usage('java-api') { fromResolutionOf('runtimeClasspath') } - usage('java-runtime') { fromResolutionResult() } - } - pom { - name = "Pantheon - ${project.name}" - url = 'http://github.com/PegaSysEng/pantheon' - licenses { - license { - name = 'The Apache License, Version 2.0' - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - scm { - connection = 'scm:git:git://github.com/PegaSysEng/pantheon.git' - developerConnection = 'scm:git:ssh://github.com/PegaSysEng/pantheon.git' - url = 'https://github.com/PegaSysEng/pantheon' - } - } + projectPublications.add("testSupport") } } + repositories { + maven { + // change to point to your repo, e.g. http://my.org/repo + url = "/Users/tmm/project/repo" + } + } + } bintray { user = bintrayUser key = bintrayKey - publications = ['mavenJava'] + publications = projectPublications override = version.endsWith('SNAPSHOT') publish = true From aed0e16252ff7f83c65d047c568bb475d3ccf260 Mon Sep 17 00:00:00 2001 From: tmohay Date: Fri, 13 Sep 2019 21:43:59 +1000 Subject: [PATCH 2/2] remove repo --- build.gradle | 7 ------- 1 file changed, 7 deletions(-) diff --git a/build.gradle b/build.gradle index d7e9c697b2..f14d9a8cad 100644 --- a/build.gradle +++ b/build.gradle @@ -361,13 +361,6 @@ subprojects { projectPublications.add("testSupport") } } - repositories { - maven { - // change to point to your repo, e.g. http://my.org/repo - url = "/Users/tmm/project/repo" - } - } - } bintray {