1+ import com.jfrog.bintray.gradle.BintrayExtension.PackageConfig
2+
13plugins {
24 kotlin(" jvm" ) version " 1.3.70"
3- id(" maven-publish" )
4- jacoco
55 id(" org.jlleitschuh.gradle.ktlint" ) version " 9.2.1"
6+ jacoco
7+ `maven- publish`
8+ signing
9+ id(" com.jfrog.bintray" ) version " 1.8.5"
610}
711
812group = " me.sargunvohra.lib"
913version = " 2.3.1"
1014
1115repositories {
12- mavenCentral ()
16+ jcenter ()
1317}
1418
1519dependencies {
@@ -25,39 +29,93 @@ dependencies {
2529 testImplementation(" com.squareup.okhttp3:mockwebserver:3.14.8" )
2630}
2731
32+ java {
33+ withSourcesJar()
34+ withJavadocJar()
35+ }
36+
37+ jacoco {
38+ toolVersion = " 0.8.5"
39+ }
40+
41+ tasks.test {
42+ finalizedBy(tasks.jacocoTestReport)
43+ }
44+
45+ tasks.jacocoTestReport {
46+ reports {
47+ xml.isEnabled = true
48+ csv.isEnabled = true
49+ html.isEnabled = true
50+ }
51+ }
52+
2853publishing {
2954 repositories {
3055 mavenLocal()
3156 maven {
32- name = " GitHubPackages "
57+ name = " GithubPackages "
3358 url = uri(" https://maven.pkg.github.com/pokeapi/pokekotlin" )
3459 credentials {
3560 username = project.findProperty(" gpr.user" ) as String?
36- ? : System .getenv(" GH_USERNAME " )
61+ ? : System .getenv(" GITHUB_USER " )
3762 password = project.findProperty(" gpr.key" ) as String?
38- ? : System .getenv(" GH_TOKEN " )
63+ ? : System .getenv(" GITHUB_KEY " )
3964 }
4065 }
4166 }
4267 publications {
43- register( " gpr " , MavenPublication :: class ) {
68+ create< MavenPublication >( " maven " ) {
4469 from(components[" java" ])
70+ pom {
71+ name.set(" PokeKotlin" )
72+ description.set(" A Kotlin (or Java, Scala, etc) client for PokeAPI." )
73+ url.set(" https://github.com/PokeAPI/pokekotlin/wiki" )
74+ licenses {
75+ license {
76+ name.set(" The Apache License, Version 2.0" )
77+ url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
78+ }
79+ }
80+ developers {
81+ developer {
82+ id.set(" sargunv" )
83+ name.set(" Sargun Vohra" )
84+ 85+ }
86+ }
87+ scm {
88+ connection.set(" scm:git:git://github.com/PokeAPI/pokekotlin.git" )
89+ developerConnection.set(" scm:git:git://github.com/PokeAPI/pokekotlin.git" )
90+ url.set(" https://github.com/PokeAPI/pokekotlin" )
91+ }
92+ }
4593 }
4694 }
4795}
4896
49- jacoco {
50- toolVersion = " 0.8.5"
97+ signing {
98+ val signingKey: String? = project.findProperty(" signing.key" ) as String?
99+ ? : System .getenv(" SIGNING_KEY" )
100+ val signingPassword: String? = project.findProperty(" signing.password" ) as String?
101+ ? : System .getenv(" SIGNING_PASSWORD" )
102+ useInMemoryPgpKeys(signingKey, signingPassword)
103+ sign(publishing.publications[" maven" ])
51104}
52105
53- tasks.test {
54- finalizedBy(tasks.jacocoTestReport)
106+ bintray {
107+ user = project.findProperty(" bintray.user" ) as String?
108+ ? : System .getenv(" BINTRAY_USER" )
109+ key = project.findProperty(" bintray.key" ) as String?
110+ ? : System .getenv(" BINTRAY_KEY" )
111+ setPublications(" maven" )
112+ publish = true
113+ pkg(delegateClosureOf<PackageConfig > {
114+ repo = " maven"
115+ name = " pokekotlin"
116+ })
55117}
56118
57- tasks.jacocoTestReport {
58- reports {
59- xml.isEnabled = true
60- csv.isEnabled = true
61- html.isEnabled = true
62- }
119+ tasks.publish {
120+ dependsOn(tasks.bintrayUpload)
63121}
0 commit comments