diff --git a/CHANGELOG.md b/CHANGELOG.md index 2809569..a1337fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +- Added support for Apple Silicon simulator. ## [0.7.1] - 2022-12-05Z - Updated KMP version and cleaned up gradle scripts. diff --git a/build.gradle.kts b/build.gradle.kts index 13626c3..0045064 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework import java.text.SimpleDateFormat import java.util.Date import uk.gov.hmrc.Dependencies @@ -44,10 +45,13 @@ kotlin { jvm() val iosX64 = iosX64("ios") val iosArm32 = iosArm32() - val iosArm64 = iosArm64() //Simulator + val iosArm64 = iosArm64() + val iosSimulatorArm64 = iosSimulatorArm64() + + val xcFramework = XCFramework(Config.frameworkName) targets{ - configure(listOf(iosX64, iosArm32, iosArm64)) { + configure(listOf(iosX64, iosArm32, iosArm64, iosSimulatorArm64)) { binaries.framework { baseName = Config.frameworkName embedBitcode("disable") @@ -109,14 +113,17 @@ kotlin { val iosArm32Main by sourceSets.getting val iosArm64Main by sourceSets.getting + val iosSimulatorArm64Main by sourceSets.getting - configure(listOf(iosArm32Main, iosArm64Main)) { + configure(listOf(iosArm32Main, iosArm64Main, iosSimulatorArm64Main)) { dependsOn(iosMain) } val iosArm32Test by sourceSets.getting val iosArm64Test by sourceSets.getting - configure(listOf(iosArm32Test, iosArm64Test)) { + val iosSimulatorArm64Test by sourceSets.getting + + configure(listOf(iosArm32Test, iosArm64Test, iosSimulatorArm64Test)) { dependsOn(iosTest) } } @@ -126,9 +133,9 @@ kotlin { multiplatformSwiftPackage { swiftToolsVersion("5.3") targetPlatforms { - iOS { v("13") } + iOS { v("14") } } - outputDirectory(File(projectDir, "build/xcframework")) + outputDirectory(File(projectDir, "build/XCFrameworks/release")) } // Configure GitHub Packages publishing diff --git a/buildSrc/src/main/kotlin/uk/gov/hmrc/Dependencies.kt b/buildSrc/src/main/kotlin/uk/gov/hmrc/Dependencies.kt index 1e49113..844f70e 100644 --- a/buildSrc/src/main/kotlin/uk/gov/hmrc/Dependencies.kt +++ b/buildSrc/src/main/kotlin/uk/gov/hmrc/Dependencies.kt @@ -49,7 +49,7 @@ object Dependencies { } object Versions { - const val klockVersion = "2.0.7" + const val klockVersion = "2.4.13" const val kermitVersion = "1.2.2" const val junit5Version = "3.4.2" const val jupiterEngineVersion = "5.7.1" diff --git a/build_xcframework.sh b/build_xcframework.sh index b3b82dc..43616bc 100755 --- a/build_xcframework.sh +++ b/build_xcframework.sh @@ -6,7 +6,7 @@ if [ -z "$GITHUB_TOKEN" ]; then else if echo $1 | grep -Eq $SEMVER_REGEX; then # Run tests and build xcframework - if ./gradlew check && ./gradlew createXCFramework; then + if ./gradlew check && ./gradlew assembleHelpToSaveKalculatorXCFramework; then DIRECTORY="swiftpm" ZIP="HelpToSaveKalculator.xcframework.zip" if [ -d "$DIRECTORY" ]; then @@ -17,7 +17,7 @@ else fi mkdir $DIRECTORY echo "INFO: Copying artifact" - cp -r build/xcframework/HelpToSaveKalculator.xcframework $DIRECTORY + cp -r build/XCFrameworks/release/HelpToSaveKalculator.xcframework $DIRECTORY echo "INFO: Zipping" cd $DIRECTORY zip -r $ZIP . diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..ccebba7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da1db5f..f398c33 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..79a61d4 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac