Skip to content

Commit

Permalink
Add common code directory and a sample class
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed May 22, 2024
1 parent 7336a04 commit 18a3ef7
Show file tree
Hide file tree
Showing 193 changed files with 56 additions and 224 deletions.
85 changes: 52 additions & 33 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
import java.net.URI

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
}

kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += "-opt-in=kotlinx.coroutines.DelicateCoroutinesApi"
freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
}
}
}

jvm("desktop")

sourceSets {
androidMain.dependencies {
implementation(libs.kotlinx.coroutines)

implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.navigation.ui)
implementation(libs.androidx.preference)
//implementation(libs.androidx.sqlite)
implementation(libs.androidx.work)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.room)

implementation(libs.material)
implementation(libs.okhttp.coroutines)
implementation(libs.okhttp.brotli)
implementation(libs.okhttp.mockwebserver)
implementation(libs.koin)
implementation(libs.osmdroid)
implementation(libs.jts)
implementation(libs.mpandroidchart)
implementation(libs.coil.core)
implementation(libs.coil.svg)
}
commonMain.dependencies {
implementation(libs.androidx.sqlite)
}
}
}

android {
namespace = "org.btcmap"
compileSdk = 34

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")

defaultConfig {
applicationId = "org.btcmap"
minSdk = 27
Expand All @@ -22,12 +68,6 @@ android {
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += "-opt-in=kotlinx.coroutines.DelicateCoroutinesApi"
freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
}

signingConfigs {
create("selfSigned") {
storeFile = File(rootDir, "release.jks")
Expand Down Expand Up @@ -85,6 +125,11 @@ android {
buildFeatures {
viewBinding = true
}

dependencies {
testImplementation(libs.junit)
testImplementation(libs.json)
}
}

tasks.register("bundleData") {
Expand All @@ -107,30 +152,4 @@ tasks.register("bundleData") {
val usersSrc = URI("https://static.btcmap.org/api/v3/users.json")
File(destDir, "users.json").writeText(usersSrc.toURL().readText())
}
}

dependencies {
implementation(libs.kotlinx.coroutines)

implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.navigation.ui)
implementation(libs.androidx.preference)
implementation(libs.androidx.sqlite)
implementation(libs.androidx.work)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.room)

implementation(libs.material)
implementation(libs.okhttp.coroutines)
implementation(libs.okhttp.brotli)
implementation(libs.okhttp.mockwebserver)
implementation(libs.koin)
implementation(libs.osmdroid)
implementation(libs.jts)
implementation(libs.mpandroidchart)
implementation(libs.coil.core)
implementation(libs.coil.svg)

testImplementation(libs.junit)
testImplementation(libs.json)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions app/src/debug/res/drawable/launcher_fg.xml

This file was deleted.

86 changes: 0 additions & 86 deletions app/src/test/kotlin/api/ApiImplTest.kt

This file was deleted.

19 changes: 0 additions & 19 deletions app/src/test/kotlin/area/AreaQueriesTest.kt

This file was deleted.

62 changes: 0 additions & 62 deletions app/src/test/kotlin/element/OsmTagsTest.kt

This file was deleted.

5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinAndroid) apply false
}
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ json = { module = "org.json:json", version.ref = "json" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

0 comments on commit 18a3ef7

Please sign in to comment.