Skip to content

Commit

Permalink
Merge branch 'main' into fix/ios-screen-height
Browse files Browse the repository at this point in the history
  • Loading branch information
slartus committed Oct 31, 2023
2 parents abdb7a3 + 471e4ea commit 51a356d
Show file tree
Hide file tree
Showing 124 changed files with 2,353 additions and 3,911 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ core-data-shared/build/
keys/my-key.asc

*.asc
/kotlin-js-store/
44 changes: 0 additions & 44 deletions android/build.gradle.kts

This file was deleted.

81 changes: 69 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,81 @@
import org.gradle.internal.impldep.org.codehaus.plexus.util.Os

plugins {
`kotlin-dsl`
alias(libs.plugins.multiplatform).apply(false)
alias(libs.plugins.compose).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.dagger).apply(false)
`maven-publish`
}

allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://jitpack.io")
mavenLocal()
}
}

buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
// Stub secrets to let the project sync and build without the publication values set up
extra.apply {
set("signing.keyId", null)
set("signing.password", null)
set("signing.secretKeyRingFile", null)
set("ossrhUsername", null)
set("ossrhPassword", null)
}

subprojects {
afterEvaluate {
afterEvaluate {
configureImplicitDependencies()
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>() {
kotlinOptions.jvmTarget = "17"
}

plugins.apply("signing")
plugins.withId("maven-publish") {
configure<PublishingExtension> {
extensions.configure<SigningExtension> {
val secretPropsFile = project.rootProject.file("local.properties")
if (secretPropsFile.exists()) {
secretPropsFile.reader().use {
java.util.Properties().apply {
load(it)
}
}.onEach { (name, value) ->
extra.apply {
set(name.toString(), value)
}
}
} else {
extra.apply {
set("signing.keyId", System.getenv("SIGNING_KEY_ID"))
set("signing.password", System.getenv("SIGNING_PASSWORD"))
set(
"signing.secretKeyRingFile",
System.getenv("SIGNING_SECRET_KEY_RING_FILE")
)
set("ossrhUsername", System.getenv("OSSRH_USERNAME"))
set("ossrhPassword", System.getenv("OSSRH_PASSWORD"))
}
}

sign(publications)
}

repositories {
maven {
name = "sonatype"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = extra.get("ossrhUsername").toString()
password = extra.get("ossrhPassword").toString()
}
}
}
}
}
}
21 changes: 3 additions & 18 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
import org.apache.tools.ant.taskdefs.condition.Os

plugins {
`kotlin-dsl`
}

repositories {
mavenLocal()
google()
mavenCentral()
maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
gradlePluginPortal()
}

dependencies {
implementation(Dependencies.JetBrains.Compose.gradlePlugin)
implementation(Dependencies.JetBrains.Kotlin.gradlePlugin)
implementation(Dependencies.Android.Tools.Build.gradlePlugin)
implementation(Dependencies.JetBrains.Kotlin.serializationPlugin)
implementation(Dependencies.Google.Dagger.hiltGradlePlugin)
}

val rootDirProject = file("../")

kotlin {
sourceSets.getByName("main").kotlin.srcDir("buildSrc/src/main/kotlin")
}
compileOnly(gradleApi())
}
82 changes: 0 additions & 82 deletions buildSrc/buildSrc/src/main/kotlin/Dependencies.kt

This file was deleted.

85 changes: 85 additions & 0 deletions buildSrc/buildSrc/src/main/kotlin/common.maven.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven
import org.gradle.api.tasks.bundling.Jar
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.registering
import org.gradle.kotlin.dsl.withType
import org.gradle.plugins.signing.Sign
import java.io.File

var MavenPublication.mppArtifactId: String
get() = throw UnsupportedOperationException()
set(value) {
val target = this.name
artifactId = if ("kotlinMultiplatform" in target) value else "$value-$target"
}

fun Project.configureMavenPublication(
groupId: String,
artifactId: String,
name: String
) {
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

extensions.configure<PublishingExtension> {
publications {
all {
this as MavenPublication

this.groupId = groupId
mppArtifactId = artifactId

artifact(javadocJar.get())

pom {
this.name.set(name)
this.description.set("Lightweight multiplatform navigation library (jvm, android, ios)")
this.url.set("https://github.com/AlexGladkov/Odyssey")

url.set("https://github.com/AlexGladkov/Odyssey")
licenses {
license {
this.name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("AlexGladkov")
this.name.set("Alex Gladkov")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/AlexGladkov/Odyssey")
}
}
}
}
}
}

fun Project.getLocalProperty(key: String, file: String = "local.properties"): String? {
val properties = java.util.Properties()
val localProperties = File(file)
if (localProperties.isFile) {
java.io.InputStreamReader(java.io.FileInputStream(localProperties), Charsets.UTF_8).use { reader ->
properties.load(reader)
}
} else error("File from not found")

return properties.getProperty(key)
}

fun Project.configureImplicitDependencies() {
val signingTasks = tasks.withType<Sign>()
tasks.withType<AbstractPublishToMaven>().configureEach {
dependsOn(signingTasks)
}
}
5 changes: 5 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pluginManagement {
repositories {
gradlePluginPortal()
}
}
33 changes: 0 additions & 33 deletions buildSrc/src/main/kotlin/android-setup.gradle.kts

This file was deleted.

Loading

0 comments on commit 51a356d

Please sign in to comment.