Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit a4fdcb4

Browse files
Replaced Bintray publish plugin with a Nexus publish plugin
1 parent aa88755 commit a4fdcb4

File tree

3 files changed

+38
-58
lines changed

3 files changed

+38
-58
lines changed

build.gradle

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ buildscript {
22
ext.kotlin_version = '1.3.50'
33
ext.kotlintest_version = '3.3.2'
44
ext.junit_jupiter_version = '5.3.1'
5+
ext.nexus_plugin_version = '1.1.0'
56

67
repositories {
78
mavenCentral()
@@ -10,14 +11,29 @@ buildscript {
1011

1112
dependencies {
1213
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+'
1414
}
1515
}
1616

17-
/*
17+
plugins {
18+
id 'signing'
19+
id "org.jetbrains.dokka" version "1.4.20"
20+
id 'maven-publish'
21+
id 'io.github.gradle-nexus.publish-plugin' version "$nexus_plugin_version"
22+
}
23+
/**
1824
* to publish:
19-
* gradle clean publish bintrayUpload
25+
* ./gradlew clean publish
2026
*/
27+
/* see: https://github.com/gradle-nexus/publish-plugin, https://h4pehl.medium.com/publish-your-gradle-artifacts-to-maven-central-f74a0af085b1 */
28+
nexusPublishing {
29+
repositories {
30+
sonatype {
31+
username = System.getenv('SONATYPE_USER')
32+
password = System.getenv('SONATYPE_PASSWORD')
33+
}
34+
}
35+
}
36+
2137

2238
allprojects {
2339
group = 'com.thinkinglogic.builder'

kotlin-builder-annotation/build.gradle

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
apply plugin: 'com.jfrog.bintray'
2-
apply plugin: 'maven-publish'
31

42
dependencies {
53
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
@@ -17,7 +15,7 @@ task javadocJar(type: Jar) {
1715

1816
publishing {
1917
publications {
20-
MyPublication(MavenPublication) {
18+
BuilderAnnotation(MavenPublication) {
2119
groupId 'com.thinkinglogic.builder'
2220
artifactId 'kotlin-builder-annotation'
2321
from components.java
@@ -57,32 +55,15 @@ publishing {
5755
}
5856
}
5957

58+
signing {
59+
def signingKey = System.getenv('SONATYPE_GPG_SECRET_KEY')
60+
def signingPassword = System.getenv('SONATYPE_GPG_PASSPHRASE')
61+
useInMemoryPgpKeys(signingKey, signingPassword)
62+
sign publishing.publications.BuilderAnnotation
63+
}
64+
6065
javadoc {
6166
if(JavaVersion.current().isJava9Compatible()) {
6267
options.addBooleanOption('html4', true)
6368
}
6469
}
65-
/* see: https://github.com/bintray/gradle-bintray-plugin */
66-
bintray {
67-
user = System.getenv('BINTRAY_USER')
68-
key = System.getenv('BINTRAY_API_KEY')
69-
publications = ['MyPublication']
70-
pkg {
71-
repo = 'maven'
72-
name = 'kotlin-builder-annotation'
73-
userOrg = 'thinkinglogic'
74-
licenses = ['MIT']
75-
labels = ['kotlin', 'builder', 'annotation']
76-
vcsUrl = 'https://github.com/ThinkingLogic/kotlin-builder-annotation.git'
77-
version {
78-
name = project.version
79-
desc = '@Builder annotation for Kotlin'
80-
released = new Date()
81-
vcsTag = project.version
82-
attributes = ['kotlin-builder-annotation': 'com.thinkinglogic:com.thinkinglogic.builder:kotlin-builder-annotation']
83-
gpg {
84-
sign = true
85-
}
86-
}
87-
}
88-
}

kotlin-builder-processor/build.gradle

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
apply plugin: 'kotlin-kapt'
2-
apply plugin: 'com.jfrog.bintray'
3-
apply plugin: 'maven-publish'
1+
plugins {
2+
id 'kotlin-kapt'
3+
}
44

55
dependencies {
66
implementation project(':kotlin-builder-annotation')
@@ -24,7 +24,7 @@ task javadocJar(type: Jar) {
2424

2525
publishing {
2626
publications {
27-
MyPublication(MavenPublication) {
27+
BuilderProcessor(MavenPublication) {
2828
groupId 'com.thinkinglogic.builder'
2929
artifactId 'kotlin-builder-processor'
3030
from components.java
@@ -64,32 +64,15 @@ publishing {
6464
}
6565
}
6666

67+
signing {
68+
def signingKey = System.getenv('SONATYPE_GPG_SECRET_KEY')
69+
def signingPassword = System.getenv('SONATYPE_GPG_PASSPHRASE')
70+
useInMemoryPgpKeys(signingKey, signingPassword)
71+
sign publishing.publications.BuilderProcessor
72+
}
73+
6774
javadoc {
6875
if(JavaVersion.current().isJava9Compatible()) {
6976
options.addBooleanOption('html4', true)
7077
}
7178
}
72-
/* see: https://github.com/bintray/gradle-bintray-plugin */
73-
bintray {
74-
user = System.getenv('BINTRAY_USER')
75-
key = System.getenv('BINTRAY_API_KEY')
76-
publications = ['MyPublication']
77-
pkg {
78-
repo = 'maven'
79-
name = 'kotlin-builder-processor'
80-
userOrg = 'thinkinglogic'
81-
licenses = ['MIT']
82-
labels = ['kotlin', 'builder', 'annotation', 'processor']
83-
vcsUrl = 'https://github.com/ThinkingLogic/kotlin-builder-annotation.git'
84-
version {
85-
name = project.version
86-
desc = '@Builder annotation processor for Kotlin'
87-
released = new Date()
88-
vcsTag = project.version
89-
attributes = ['kotlin-builder-processor': 'com.thinkinglogic:com.thinkinglogic.builder:kotlin-builder-processor']
90-
gpg {
91-
sign = true
92-
}
93-
}
94-
}
95-
}

0 commit comments

Comments
 (0)