Skip to content

Commit 7affe09

Browse files
committed
Integrated publish task.
1 parent ef08553 commit 7affe09

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

Diff for: build.gradle.kts

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ buildscript {
33
mavenCentral()
44
google()
55
gradlePluginPortal()
6+
maven {
7+
url = uri("https://plugins.gradle.org/m2/")
8+
}
69
}
710
dependencies {
811
classpath(versionCatalogLibs.android.gradle.plugin)

Diff for: core/ui/build.gradle.kts

+95
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,108 @@ plugins {
33
id("co.yml.ytag.library.compose")
44
id("co.yml.ytag.library")
55
id("co.yml.ytag.library.jacoco")
6+
id("maven-publish")
7+
id("signing")
8+
id("org.jetbrains.dokka")
69
}
710

811
android {
912
namespace = "co.yml.ytag.ui"
13+
buildTypes {
14+
release {
15+
isMinifyEnabled = false
16+
proguardFiles(
17+
getDefaultProguardFile("proguard-android-optimize.txt"),
18+
"proguard-rules.pro"
19+
)
20+
}
21+
}
1022
}
1123

1224
dependencies {
1325
testImplementation(project(mapOf("path" to ":core:test")))
1426
androidTestImplementation(project(mapOf("path" to ":core:test")))
1527
}
28+
val dokkaOutputDir = "$buildDir/dokka"
29+
30+
tasks.dokkaHtml {
31+
outputDirectory.set(file(dokkaOutputDir))
32+
}
33+
34+
val deleteDokkaOutputDir by tasks.register<Delete>("deleteDokkaOutputDirectory") {
35+
delete(dokkaOutputDir)
36+
}
37+
val javadocJar = tasks.register<Jar>("javadocJar") {
38+
dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml)
39+
archiveClassifier.set("javadoc")
40+
from(dokkaOutputDir)
41+
}
42+
43+
publishing {
44+
repositories {
45+
maven {
46+
name = "YTag"
47+
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
48+
credentials {
49+
username = project.findProperty("mavenCentralUsername")?.toString() ?: System.getenv("MAVEN_USERNAME")
50+
password = project.findProperty("mavenCentralPassword")?.toString() ?: System.getenv("MAVEN_PASSWORD")
51+
}
52+
}
53+
}
54+
publications {
55+
register<MavenPublication>("release") {
56+
groupId = "co.yml"
57+
artifactId = "ytag"
58+
version = "1.0.0"
59+
afterEvaluate {
60+
println("Components:${components.names}")
61+
from(components["productionRelease"])
62+
}
63+
artifact(javadocJar)
64+
pom {
65+
name.set("YTag")
66+
description.set("Y Tag is a UI element in Android (some times referred to as chips) which displays a piece of information. It consist of a leading icon(optional), Text and a trailing icon (optional).")
67+
url.set("https://github.com/yml-org/YTag-android")
68+
licenses {
69+
license {
70+
name.set("The Apache License, Version 2.0")
71+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
72+
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
73+
}
74+
}
75+
developers {
76+
developer {
77+
id.set("sreekuttancj")
78+
name.set("Sreekuttan C J")
79+
url.set("https://github.com/sreekuttancj")
80+
}
81+
developer {
82+
id.set("dkk009")
83+
name.set("Deepak KK")
84+
url.set("https://github.com/dkk009")
85+
}
86+
developer {
87+
id.set("kikoso")
88+
name.set("Enrique López Mañas")
89+
url.set("https://github.com/kikoso")
90+
}
91+
}
92+
scm {
93+
url.set("https://github.com/yml-org/YTag-android")
94+
connection.set("scm:git:git://github.com/yml-org/YTag-android.git")
95+
developerConnection.set("scm:git:ssh://[email protected]:yml-org/YTag-android.git")
96+
}
97+
}
98+
}
99+
}
100+
}
101+
102+
103+
signing {
104+
useInMemoryPgpKeys(
105+
project.findProperty("signing.keyId")?.toString() ?: System.getenv("SIGNINGKEY"),
106+
project.findProperty("signing.InMemoryKey")?.toString() ?: System.getenv("MEMORY_KEY"),
107+
project.findProperty("signing.password")?.toString()?:System.getenv("SIGNINGPASSWORD")
108+
)
109+
sign(publishing.publications)
110+
}

0 commit comments

Comments
 (0)