From 94d5e969a378ece4361192ba0da72688e5ed79de Mon Sep 17 00:00:00 2001 From: Alexander Ioffe Date: Tue, 15 Oct 2024 04:08:42 -0400 Subject: [PATCH] Cleanup & add CI --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++++++++ composeApp/build.gradle.kts | 7 +------ gradle/libs.versions.toml | 5 ----- settings.gradle.kts | 16 +--------------- shared/build.gradle.kts | 15 +-------------- 5 files changed, 30 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..88df96b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,27 @@ +name: CI + +on: [pull_request, push] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macOS-latest, windows-latest ] + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: 'Build + Test Android on Linux' + if: matrix.os == 'ubuntu-latest' + run: ./gradlew build --stacktrace -PisCI -Pnosign + + - name: 'Build + Common OSX Sources' + if: matrix.os == 'macOS-latest' + run: ./gradlew :shared:build --stacktrace -PisCI -Pnosign diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index ecb2dc7..fb869c1 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -50,15 +50,14 @@ kotlin { implementation(compose.ui) implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) - //implementation(libs.androidx.lifecycle.viewmodel) implementation(libs.androidx.lifecycle.viewmodel.compose) implementation(libs.androidx.lifecycle.runtime.compose) implementation(projects.shared) implementation(libs.androidx.compose.material3) implementation(libs.terpal.core.get().simpleString()) { + // This interferes with org.jetbrains:annotations in the in the android modules exclude("com.sschr15.annotations","jb-annotations-kmp") } - //implementation(libs.koin.compose.viewmodel) implementation(libs.androidx.lifecycle.viewmodel.compose) } } @@ -69,10 +68,6 @@ fun MinimalExternalModuleDependency.simpleString() = android { - //configurations.forEach { - // it.exclude(group = "com.sschr15.annotations", module = "jb-annotations-kmp") - //} - namespace = "com.example.project" compileSdk = libs.versions.android.compileSdk.get().toInt() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1708789..4b45c9e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -43,11 +43,6 @@ androidx-material = { group = "com.google.android.material", name = "material", androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" } androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } -# KMP Kolin and Kotlinx -#koin-compose-viewmodel = { group = "io.insert-koin", name = "koin-compose-viewmodel", version = "4.0.0" } -#androidx-lifecycle-viewmodel-compose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } -#androidx-navigation-compose = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "androidx-navigation" } - #Androidx specific libraries androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" } androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 091e92c..24ad5e9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,16 +3,9 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { repositories { - google { - //mavenContent { - // includeGroupAndSubgroups("androidx") - // includeGroupAndSubgroups("com.android") - // includeGroupAndSubgroups("com.google") - //} - } + google() mavenCentral() gradlePluginPortal() - //mavenLocal() } } @@ -27,13 +20,6 @@ dependencyResolutionManagement { } mavenCentral() mavenLocal() -// { -// mavenContent { -// includeModule("io.exoquery", "terpal-sql-core") -// includeModule("io.exoquery", "terpal-sql-core-jvm") -// includeModule("io.exoquery", "terpal-sql-android") -// } -// } } } diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 10c5c56..cae7254 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -38,16 +38,15 @@ kotlin { implementation(libs.kotlinx.datetime) implementation(libs.koin.core) implementation(libs.terpal.core.get().simpleString()) { + // This interferes with org.jetbrains:annotations in the in the android modules exclude("com.sschr15.annotations","jb-annotations-kmp") } - //compileOnly(libs.jetbrains.annotations.kmp) } androidMain { dependencies { implementation(libs.ktor.client.android) implementation(libs.android.driver) // not sure why putting this here blows things up - //implementation(libs.terpal.android) implementation(libs.jetbrains.annotations) } } @@ -64,11 +63,6 @@ fun MinimalExternalModuleDependency.simpleString() = this.let { "${it.module}:${it.versionConstraint.requiredVersion}" } android { - // Otherwise will complain there are duplicate annotations between jb-annotations and jb-annotations-kmp - //configurations.forEach { - // it.exclude(group = "com.sschr15.annotations", module = "jb-annotations-kmp") - //} - namespace = "com.example.project.shared" compileSdk = libs.versions.android.compileSdk.get().toInt() compileOptions { @@ -89,13 +83,6 @@ sqldelight { } repositories { -// mavenLocal { -// mavenContent { -// includeModule("io.exoquery", "terpal-sql-core") -// includeModule("io.exoquery", "terpal-sql-core-jvm") -// includeModule("io.exoquery", "terpal-sql-android") -// } -// } google() mavenCentral() mavenLocal()