-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
...and use gradle-nexus publish-plugin.
- Loading branch information
Showing
5 changed files
with
95 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5' | ||
} | ||
plugins { | ||
id("io.github.gradle-nexus.publish-plugin") version "1.3.0" | ||
id "signing" | ||
id "groovy" | ||
id "eclipse" | ||
id "maven-publish" | ||
} | ||
|
||
apply plugin: 'groovy' | ||
apply plugin: 'signing' | ||
apply plugin: 'eclipse' | ||
apply plugin: 'com.jfrog.bintray' | ||
apply plugin: 'maven-publish' | ||
|
||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = 'org.standardout' | ||
version = '1.9.0-SNAPSHOT' | ||
version = '2.0.0-SNAPSHOT' | ||
|
||
sourceCompatibility = '1.8' | ||
targetCompatibility = '1.8' | ||
|
@@ -37,75 +28,25 @@ dependencies { | |
implementation 'biz.aQute.bnd:biz.aQute.bndlib:5.2.0' | ||
implementation 'org.osgi:osgi.core:6.0.0' | ||
implementation 'commons-io:commons-io:2.4' | ||
implementation 'de.undercouch:gradle-download-task:3.1.1' | ||
implementation 'de.undercouch:gradle-download-task:5.5.0' | ||
implementation localGroovy() | ||
} | ||
|
||
wrapper { | ||
gradleVersion = '5.3' | ||
tasks.wrapper { | ||
distributionType = Wrapper.DistributionType.ALL | ||
gradleVersion = '8.4' | ||
} | ||
|
||
// package groovydoc into a jar file | ||
task packageJavadoc(type: Jar, dependsOn: 'groovydoc') { | ||
from groovydoc.destinationDir | ||
classifier = 'javadoc' | ||
archiveClassifier = 'javadoc' | ||
} | ||
|
||
// package source into a jar file | ||
task packageSources(type: Jar) { | ||
from sourceSets.main.allSource | ||
classifier = 'sources' | ||
} | ||
|
||
// define artifacts for upload | ||
artifacts { | ||
archives jar | ||
archives packageJavadoc | ||
archives packageSources | ||
} | ||
|
||
def configurePom(def pom) { | ||
// ensure correct artifact ID | ||
pom.artifactId = 'bnd-platform' | ||
|
||
// pom file details | ||
pom.project { | ||
name 'bnd-platform' | ||
packaging 'jar' | ||
description 'Build OSGi bundles and Eclipse Update Sites from existing JARs, e.g. from Maven repositories (Plugin for Gradle)' | ||
url 'https://github.com/stempler/bnd-platform' | ||
|
||
scm { | ||
url 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
connection 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
developerConnection 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'The Apache Software License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
distribution 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'stempler' | ||
name 'Simon Templer' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
|
||
// sign all artifacts | ||
signing { | ||
required { | ||
// NOTE: skipping does only work if no gradle properties specifying the key are present | ||
gradle.taskGraph.hasTask('uploadArchives') | ||
} | ||
sign configurations.archives | ||
archiveClassifier = 'sources' | ||
} | ||
|
||
// groovydoc task work-around | ||
|
@@ -120,85 +61,56 @@ dependencies { | |
jansi 'org.fusesource.jansi:jansi:1.11' | ||
} | ||
|
||
// bintray | ||
|
||
bintray { // task bintrayUpload | ||
user = project.getProperty('bintrayUser') | ||
key = project.getProperty('bintrayApiKey') | ||
|
||
configurations = ['archives'] | ||
|
||
dryRun = false | ||
publish = !project.version.endsWith('-SNAPSHOT') | ||
pkg { | ||
def githubUrl = 'https://github.com/stempler/bnd-platform' | ||
repo = 'gradle-plugins' | ||
name = 'bnd-platform' | ||
desc = 'Build OSGi bundles and p2 repositories / Eclipse Update Sites from existing libraries and their dependencies, e.g. from Maven repositories. Useful for instance for creating a target platform for Eclipse/Equinox or Maven Tycho build from third party dependencies.' | ||
websiteUrl = githubUrl | ||
issueTrackerUrl = "$githubUrl/issues" | ||
vcsUrl = "${githubUrl}.git" | ||
licenses = ['Apache-2.0'] | ||
labels = ['gradle', 'bnd', 'osgi', 'p2', 'eclipse', 'tycho'] | ||
publicDownloadNumbers = true | ||
// version descriptor | ||
version { | ||
name = project.version | ||
attributes = ['gradle-plugin': "org.standardout.bnd-platform:${project.group}:bnd-platform"] | ||
} | ||
nexusPublishing { | ||
repositories { | ||
sonatype() | ||
} | ||
|
||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
url = this.version.endsWith('-SNAPSHOT') ? 'https://oss.sonatype.org/content/repositories/snapshots' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2' | ||
credentials { | ||
username = this.hasProperty('sonatypeUsername') ? sonatypeUsername : '' | ||
password = this.hasProperty('sonatypePassword') ? sonatypePassword : '' | ||
} | ||
} | ||
} | ||
publications { | ||
MyPublication(MavenPublication) { | ||
from components.java | ||
groupId "${group}" | ||
artifactId 'bnd-platform' | ||
version "${version}" | ||
|
||
artifact packageSources | ||
artifact packageJavadoc | ||
|
||
pom { | ||
name = 'bnd-platform' | ||
packaging = 'jar' | ||
description = 'Build OSGi bundles and Eclipse Update Sites from existing JARs, e.g. from Maven repositories (Plugin for Gradle)' | ||
url = 'https://github.com/stempler/bnd-platform' | ||
|
||
scm { | ||
url = 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
connection = 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
developerConnection = 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name = 'The Apache Software License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
distribution = 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'stempler' | ||
name = 'Simon Templer' | ||
email = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
groupId "${group}" | ||
artifactId 'bnd-platform' | ||
version "${version}" | ||
|
||
artifact packageSources | ||
artifact packageJavadoc | ||
|
||
pom { | ||
name = 'bnd-platform' | ||
packaging = 'jar' | ||
description = 'Build OSGi bundles and Eclipse Update Sites from existing JARs, e.g. from Maven repositories (Plugin for Gradle)' | ||
url = 'https://github.com/stempler/bnd-platform' | ||
|
||
scm { | ||
url = 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
connection = 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
developerConnection = 'scm:git:https://github.com/stempler/bnd-platform.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name = 'The Apache Software License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
distribution = 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'stempler' | ||
name = 'Simon Templer' | ||
email = '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
// sign all artifacts | ||
signing { | ||
sign publishing.publications.mavenJava | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters