diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index 7ce71b9..8dc2933 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -11,14 +11,11 @@ jobs: runs-on: macOS-latest steps: - - uses: actions/checkout@v1 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 11 - - name: Build and publish local - run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64 - - name: Install pods - run: cd sample/ios-app && pod install - - name: Check iOS - run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty + java-version: 17 + distribution: zulu + - name: Check + run: ./local-check.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4949eb8..2a87af0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,11 +20,12 @@ jobs: SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }} steps: - - uses: actions/checkout@v1 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 + distribution: zulu - name: Publish run: ./gradlew publish diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8e48434..d784dd4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlinVersion = "1.9.23" +kotlinVersion = "1.9.25" androidAppCompatVersion = "1.6.1" materialDesignVersion = "1.8.0" androidLifecycleVersion = "2.2.0" @@ -30,6 +30,6 @@ androidCoreTesting = { module = "androidx.arch.core:core-testing", version.ref = # gradle plugins kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" } -androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.4.2" } +androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "8.3.2" } mokoResourcesGradlePlugin = { module = "dev.icerock.moko:resources-generator", version.ref = "mokoResourcesVersion" } -mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.3.0" } +mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.4.0" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 086178f..7467e60 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Apr 16 13:01:03 NOVT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/local-check.sh b/local-check.sh new file mode 100755 index 0000000..fa78b55 --- /dev/null +++ b/local-check.sh @@ -0,0 +1,37 @@ +# +# Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. +# + +set -e + +log() { + echo "\033[0;32m> $1\033[0m" +} + +./gradlew detekt +log "detekt success" + +./gradlew assembleDebug +log "android success" + +./gradlew compileKotlinIosX64 +log "ios success" + +./gradlew build publishToMavenLocal +log "full build success" + +if ! command -v xcodebuild &> /dev/null +then + log "xcodebuild could not be found, skip ios checks" +else + ./gradlew syncMultiPlatformLibraryDebugFrameworkIosX64 + log "sync success" + + ( + cd sample/ios-app && + pod install && + set -o pipefail && + xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty + ) + log "ios xcode success" +fi diff --git a/sample/ios-app/Podfile.lock b/sample/ios-app/Podfile.lock index 1768348..12cb0fb 100644 --- a/sample/ios-app/Podfile.lock +++ b/sample/ios-app/Podfile.lock @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: "../mpp-library" SPEC CHECKSUMS: - MultiPlatformLibrary: 2a9f43df7bd018c32611a2087c1e2ef74847394c + MultiPlatformLibrary: 050151f1b2e9b2dcfff0763bb625fb3a0a063076 PODFILE CHECKSUM: e8746dc30e9d53a96c59e8f821148cde03ea8c5b diff --git a/sample/mpp-library/MultiPlatformLibrary.podspec b/sample/mpp-library/MultiPlatformLibrary.podspec index 0f908b0..c779a67 100644 --- a/sample/mpp-library/MultiPlatformLibrary.podspec +++ b/sample/mpp-library/MultiPlatformLibrary.podspec @@ -19,7 +19,6 @@ Pod::Spec.new do |spec| 'KOTLIN_FRAMEWORK_BUILD_TYPE[config=*elease]' => 'release', 'CURENT_SDK[sdk=iphoneos*]' => 'iphoneos', 'CURENT_SDK[sdk=iphonesimulator*]' => 'iphonesimulator', - 'CURENT_SDK[sdk=macosx*]' => 'macos' } spec.script_phases = [ @@ -37,21 +36,17 @@ fi if [ "$CURENT_SDK" == "iphoneos" ]; then TARGET="Ios" ARCH="Arm64" -elif [ "$CURENT_SDK" == "macos" ]; then - TARGET="Macos" - if [ "$NATIVE_ARCH" == "arm64" ]; then - ARCH="Arm64" - else - ARCH="X64" - fi -else - if [ "$NATIVE_ARCH" == "arm64" ]; then +elif [ "$CURENT_SDK" == "iphonesimulator" ]; then + if [ "$ARCHS" == "arm64" ]; then TARGET="IosSimulator" ARCH="Arm64" else TARGET="Ios" ARCH="X64" fi +else + echo "unsupported $CURENT_SDK" + exit 1 fi MPP_PROJECT_ROOT="$SRCROOT/../../mpp-library" diff --git a/settings.gradle.kts b/settings.gradle.kts index f981cb5..0bb31ec 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,7 +2,6 @@ * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ -enableFeaturePreview("VERSION_CATALOGS") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") dependencyResolutionManagement {