Skip to content

Commit 4b379fe

Browse files
committed
Publish to mavenCentral() with Vannik plugin
1 parent 2a281ac commit 4b379fe

File tree

3 files changed

+53
-26
lines changed

3 files changed

+53
-26
lines changed

MPChartLib/build.gradle

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.library'
33
id 'maven-publish'
4+
id "com.vanniktech.maven.publish" version "0.22.0"
45
}
56

67
ext {
@@ -46,36 +47,47 @@ task androidSourcesJar(type: Jar) {
4647
from android.sourceSets.main.java.srcDirs
4748
}
4849

49-
project.afterEvaluate {
50-
publishing {
51-
publications {
52-
maven(MavenPublication) {
53-
groupId mGroupId
54-
artifactId mArtifactId
55-
version mVersionName
50+
group = "info.mxtracks"
51+
version = "${getTag()}-SNAPSHOT"
52+
println "Build version $version"
5653

57-
from components.release
58-
59-
// artifact androidSourcesJar
60-
// artifact("$buildDir/outputs/aar/MPChartLib-release.aar")
61-
62-
pom {
63-
name = mLibraryName
64-
description = mLibraryDescription
65-
}
54+
mavenPublishing {
55+
pom {
56+
name = "Android Chart"
57+
description = "A powerful Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, dragging and animations"
58+
inceptionYear = "2022"
59+
url = "https://github.com/AppDevNext/AndroidChart/"
60+
licenses {
61+
license {
62+
name = "The Apache License, Version 2.0"
63+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
64+
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
65+
}
66+
}
67+
developers {
68+
developer {
69+
id = "AppDevNext"
70+
name = "AppDevNext"
71+
url = "https://github.com/AppDevNext/"
6672
}
6773
}
74+
scm {
75+
url = "https://github.com/AppDevNext/AndroidChart/"
76+
connection = "scm:git:git://github.com/AppDevNext/AndroidChart.git"
77+
developerConnection = "scm:git:ssh://[email protected]/AppDevNext/AndroidChart.git"
78+
}
79+
}
6880

69-
repositories {
70-
maven {
71-
version = getTag()
72-
name = "GitHubPackages"
73-
url = "https://maven.pkg.github.com/AppDevNext/AndroidChart"
74-
credentials {
75-
username = System.getenv("GITHUBACTOR")
76-
password = System.getenv("GITHUBTOKEN")
77-
}
81+
// Github packages
82+
repositories {
83+
maven {
84+
version = version
85+
name = "GitHubPackages"
86+
url = "https://maven.pkg.github.com/AppDevNext/AndroidChart"
87+
credentials {
88+
username = System.getenv("GITHUBACTOR")
89+
password = System.getenv("GITHUBTOKEN")
7890
}
7991
}
8092
}
81-
}
93+
}

gradle.properties

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
android.enableJetifier=true
22
android.useAndroidX=true
33
org.gradle.jvmargs=-Xmx2048M
4+
5+
#SONATYPE_HOST=DEFAULT
6+
# or when publishing to https://s01.oss.sonatype.org
7+
SONATYPE_HOST=S01
8+
RELEASE_SIGNING_ENABLED=true
9+
POM_ARTIFACT_ID=chart
10+
11+
mavenCentralUsername=username
12+
mavenCentralPassword=the_password
13+
14+
# to see it: gpg -K
15+
# No worries, I will change it later
16+
signing.keyId=97A34AAE
17+
signing.password=1234567890
18+
signing.secretKeyRingFile=../signing/secring.gpg

signing/secring.gpg

8.39 KB
Binary file not shown.

0 commit comments

Comments
 (0)