@@ -2,8 +2,12 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22
33plugins {
44 id(" com.android.library" )
5+ id(" maven-publish" )
56}
67
8+ group = " dev.firechip"
9+ version = " 1.0.0"
10+
711android {
812 namespace = " dev.firechip.cobs"
913 compileSdk = 35
@@ -28,6 +32,12 @@ android {
2832 it.useJUnit()
2933 }
3034 }
35+
36+ publishing {
37+ singleVariant(" release" ) {
38+ withSourcesJar()
39+ }
40+ }
3141}
3242
3343kotlin {
@@ -39,3 +49,56 @@ kotlin {
3949dependencies {
4050 testImplementation(" junit:junit:4.13.2" )
4151}
52+
53+ publishing {
54+ publications {
55+ register<MavenPublication >(" release" ) {
56+ afterEvaluate {
57+ from(components[" release" ])
58+ }
59+ groupId = " dev.firechip"
60+ artifactId = " cobs_codec_kt"
61+ version = project.version.toString()
62+ pom {
63+ name = " cobs_codec_kt"
64+ description =
65+ " Pure-Kotlin Consistent Overhead Byte Stuffing (COBS) and " +
66+ " COBS/R for Android."
67+ url = " https://github.com/firechip/cobs_codec_kt"
68+ licenses {
69+ license {
70+ name = " MIT"
71+ url =
72+ " https://github.com/firechip/cobs_codec_kt/blob/main/LICENSE"
73+ }
74+ }
75+ developers {
76+ developer {
77+ id = " ajsb85"
78+ name = " Alexander Salas Bastidas"
79+ email = " ajsb85@firechip.dev"
80+ }
81+ }
82+ scm {
83+ url = " https://github.com/firechip/cobs_codec_kt"
84+ connection =
85+ " scm:git:https://github.com/firechip/cobs_codec_kt.git"
86+ developerConnection =
87+ " scm:git:ssh://git@github.com/firechip/cobs_codec_kt.git"
88+ }
89+ }
90+ }
91+ }
92+ repositories {
93+ maven {
94+ name = " GitHubPackages"
95+ url = uri(" https://maven.pkg.github.com/firechip/cobs_codec_kt" )
96+ credentials {
97+ username = System .getenv(" GITHUB_ACTOR" )
98+ ? : providers.gradleProperty(" gpr.user" ).orNull
99+ password = System .getenv(" GITHUB_TOKEN" )
100+ ? : providers.gradleProperty(" gpr.key" ).orNull
101+ }
102+ }
103+ }
104+ }
0 commit comments