Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into mutablestateflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cheonjaeung committed Jan 6, 2023
2 parents fe11c95 + dd87176 commit 464b9db
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 72 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.23.1")
}
}

Expand Down
103 changes: 31 additions & 72 deletions savedstate-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import java.util.Properties
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("org.jetbrains.kotlin.android")
id("com.android.library")
id("maven-publish")
id("signing")
id("com.vanniktech.maven.publish")
}

android {
namespace = "${project.group}"
namespace = "io.woong.savedstate"
compileSdk = 33

defaultConfig {
Expand All @@ -25,91 +24,51 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1")
implementation("androidx.core:core-ktx:1.9.0")

androidTestImplementation("androidx.test:core-ktx:1.5.0")
androidTestImplementation("androidx.test:runner:1.5.1")
androidTestImplementation("androidx.test.ext:junit-ktx:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test.ext:junit-ktx:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("com.google.truth:truth:1.1.3")
androidTestImplementation("androidx.activity:activity-ktx:1.6.1")
}

publishing {
repositories {
maven {
name = "sonatype"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = localProperty("OSSRH_USERNAME")
password = localProperty("OSSRH_PASSWORD")
}
}
}

publications {
create<MavenPublication>("release") {
afterEvaluate {
from(components.getByName("release"))
}

groupId = "${project.group}"
artifactId = "savedstate-ktx"
version = "${project.version}"
mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()

pom {
name.set("savedstate-ktx")
description.set("Kotlin extensions for Android SavedStateHandle")
url.set("https://github.com/cheonjaewoong/savedstate-ktx")
coordinates("io.woong.savedstate", "savedstate-ktx", "${project.version}")

licenses {
license {
name.set("MIT")
url.set("https://github.com/cheonjaewoong/savedstate-ktx/blob/master/LICENSE.txt")
}
}
pom {
name.set("savedstate-ktx")
description.set("Kotlin extensions library for Android SavedStateHandle")
url.set("https://github.com/cheonjaewoong/savedstate-ktx")

developers {
developer {
id.set("cheonjaewoong")
name.set("Jaewoong Cheon")
email.set("cheonjaewoong@gmail.com")
}
}

scm {
url.set("https://github.com/cheonjaewoong/savedstate-ktx")
connection.set("scm:git:git://github.com/cheonjaewoong/savedstate-ktx.git")
developerConnection.set("scm:git:ssh://git@github.com/cheonjaewoong/savedstate-ktx.git")
}
licenses {
license {
name.set("MIT")
url.set("https://github.com/cheonjaewoong/savedstate-ktx/blob/master/LICENSE.txt")
}
}
}
}

signing {
sign(publishing.publications)
}
developers {
developer {
id.set("cheonjaewoong")
name.set("Jaewoong Cheon")
email.set("cheonjaewoong@gmail.com")
}
}

fun localProperty(name: String): String? {
val localPropertiesFile = project.rootProject.file("local.properties")
if (!localPropertiesFile.exists()) {
return null
}
val properties = localPropertiesFile.reader().use { reader ->
Properties().apply { load(reader) }
scm {
url.set("https://github.com/cheonjaewoong/savedstate-ktx")
connection.set("scm:git:git://github.com/cheonjaewoong/savedstate-ktx.git")
developerConnection.set("scm:git:ssh://git@github.com/cheonjaewoong/savedstate-ktx.git")
}
}
return properties.getProperty(name, null)
}

0 comments on commit 464b9db

Please sign in to comment.