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

Commit 94b5eb2

Browse files
Added maven publish and bintrayUpload targets
1 parent fba7675 commit 94b5eb2

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ buildscript {
1212
}
1313
}
1414

15+
allprojects {
16+
group = 'com.thinkinglogic'
17+
version = '1.0.0'
18+
}
19+
1520

1621
allprojects {
1722
apply plugin: "kotlin"
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,83 @@
1+
apply plugin: 'com.jfrog.bintray'
2+
apply plugin: 'maven-publish'
13

24
dependencies {
35
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
46
}
7+
8+
task sourcesJar(type: Jar) {
9+
from sourceSets.main.allSource
10+
classifier = 'sources'
11+
}
12+
13+
task javadocJar(type: Jar) {
14+
from javadoc
15+
classifier = 'javadoc'
16+
}
17+
18+
publishing {
19+
publications {
20+
MyPublication(MavenPublication) {
21+
artifactId = 'kotlin-builder-annotation'
22+
from components.java
23+
artifact sourcesJar
24+
artifact javadocJar
25+
pom {
26+
name = 'Kotlin Builder Annotation'
27+
description = 'A replacement for the Lombok @Builder annotation for Kotlin'
28+
url = 'https://github.com/ThinkingLogic/kotlin-builder-annotation'
29+
licenses {
30+
license {
31+
name = 'MIT License'
32+
url = 'https://opensource.org/licenses/MIT'
33+
}
34+
}
35+
developers {
36+
developer {
37+
id = 'yetanothermatt'
38+
name = 'Matthew Smith'
39+
}
40+
}
41+
scm {
42+
connection = 'scm:git:git://github.com/ThinkingLogic/kotlin-builder-annotation.git'
43+
developerConnection = 'scm:git:ssh:git@github.com:ThinkingLogic/kotlin-builder-annotation.git'
44+
url = 'https://github.com/ThinkingLogic/kotlin-builder-annotation'
45+
}
46+
}
47+
}
48+
}
49+
repositories {
50+
maven {
51+
// change URLs to point to your repos, e.g. http://my.org/repo
52+
def releasesRepoUrl = "$buildDir/repos/releases"
53+
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
54+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
55+
}
56+
}
57+
}
58+
59+
javadoc {
60+
if(JavaVersion.current().isJava9Compatible()) {
61+
options.addBooleanOption('html4', true)
62+
}
63+
}
64+
bintray {
65+
user = System.getenv('BINTRAY_USER')
66+
key = System.getenv('BINTRAY_API_KEY')
67+
publications = ['MyPublication']
68+
pkg {
69+
repo = 'maven'
70+
name = 'kotlin-builder-annotation'
71+
userOrg = 'thinkinglogic'
72+
licenses = ['MIT']
73+
labels = ['kotlin', 'builder', 'annotation']
74+
vcsUrl = 'https://github.com/ThinkingLogic/kotlin-builder-annotation.git'
75+
version {
76+
name = project.version
77+
desc = '@Builder annotation for Kotlin'
78+
released = new Date()
79+
vcsTag = project.version
80+
attributes = ['kotlin-builder-annotation': 'com.thinkinglogic:com.thinkinglogic.builder:kotlin-builder-annotation']
81+
}
82+
}
83+
}

kotlin-builder-processor/build.gradle

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
apply plugin: 'kotlin-kapt'
2+
apply plugin: 'com.jfrog.bintray'
3+
apply plugin: 'maven-publish'
24

35
dependencies {
46
implementation project(':kotlin-builder-annotation')
@@ -7,3 +9,82 @@ dependencies {
79
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
810
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
911
}
12+
13+
14+
task sourcesJar(type: Jar) {
15+
from sourceSets.main.allSource
16+
classifier = 'sources'
17+
}
18+
19+
task javadocJar(type: Jar) {
20+
from javadoc
21+
classifier = 'javadoc'
22+
}
23+
24+
publishing {
25+
publications {
26+
MyPublication(MavenPublication) {
27+
artifactId = 'kotlin-builder-processor'
28+
from components.java
29+
artifact sourcesJar
30+
artifact javadocJar
31+
pom {
32+
name = 'Kotlin Builder Annotation Processor'
33+
description = 'A Kapt processor for kotlin-builder-annotation - replacement for the Lombok @Builder annotation for Kotlin'
34+
url = 'https://github.com/ThinkingLogic/kotlin-builder-annotation'
35+
licenses {
36+
license {
37+
name = 'MIT License'
38+
url = 'https://opensource.org/licenses/MIT'
39+
}
40+
}
41+
developers {
42+
developer {
43+
id = 'yetanothermatt'
44+
name = 'Matthew Smith'
45+
}
46+
}
47+
scm {
48+
connection = 'scm:git:git://github.com/ThinkingLogic/kotlin-builder-annotation.git'
49+
developerConnection = 'scm:git:ssh:git@github.com:ThinkingLogic/kotlin-builder-annotation.git'
50+
url = 'https://github.com/ThinkingLogic/kotlin-builder-annotation'
51+
}
52+
}
53+
}
54+
}
55+
repositories {
56+
maven {
57+
// change URLs to point to your repos, e.g. http://my.org/repo
58+
def releasesRepoUrl = "$buildDir/repos/releases"
59+
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
60+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
61+
}
62+
}
63+
}
64+
65+
javadoc {
66+
if(JavaVersion.current().isJava9Compatible()) {
67+
options.addBooleanOption('html4', true)
68+
}
69+
}
70+
71+
bintray {
72+
user = System.getenv('BINTRAY_USER')
73+
key = System.getenv('BINTRAY_API_KEY')
74+
publications = ['MyPublication']
75+
pkg {
76+
repo = 'maven'
77+
name = 'kotlin-builder-processor'
78+
userOrg = 'thinkinglogic'
79+
licenses = ['MIT']
80+
labels = ['kotlin', 'builder', 'annotation', 'processor']
81+
vcsUrl = 'https://github.com/ThinkingLogic/kotlin-builder-annotation.git'
82+
version {
83+
name = project.version
84+
desc = '@Builder annotation processor for Kotlin'
85+
released = new Date()
86+
vcsTag = project.version
87+
attributes = ['kotlin-builder-processor': 'com.thinkinglogic:com.thinkinglogic.builder:kotlin-builder-processor']
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)