From 73f7c65b5472ab801ddc82d1b937a99565cc7b4d Mon Sep 17 00:00:00 2001 From: Sam Dozor Date: Wed, 14 Jul 2021 14:49:43 -0400 Subject: [PATCH 1/4] Don't delete build dir when initializing --- .../main/kotlin/com/mparticle/smartype/generator/Generator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/Generator.kt b/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/Generator.kt index 0467c03..f882a97 100644 --- a/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/Generator.kt +++ b/smartype-generator/src/main/kotlin/com/mparticle/smartype/generator/Generator.kt @@ -158,7 +158,7 @@ class Generate : CliktCommand(name="generate", help = "Generate Smartype Client val directory = File(System.getProperty("user.dir")).resolve(File(binOutputDirectory)) - directory.deleteRecursively() + if (!directory.exists()) { directory.mkdirs() } From fdc71a45348e4925760d1c2b0c38b74eee8b65bf Mon Sep 17 00:00:00 2001 From: Sam Dozor Date: Thu, 29 Jul 2021 11:01:37 -0400 Subject: [PATCH 2/4] Implement Carthage workaround for Xcode 12 --- gradle/carthage.sh | 19 +++++++++++++++++++ .../smartype-mparticle/build.gradle.kts | 3 +-- smartype/build.gradle.kts | 3 +-- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 gradle/carthage.sh diff --git a/gradle/carthage.sh b/gradle/carthage.sh new file mode 100755 index 0000000..58cdb31 --- /dev/null +++ b/gradle/carthage.sh @@ -0,0 +1,19 @@ +# carthage.sh +# Usage example: ./carthage.sh build --platform iOS +# see: https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md +set -euo pipefail + +xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) +trap 'rm -f "$xcconfig"' INT TERM HUP EXIT + +# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise +# the build will fail on lipo due to duplicate architectures. + +CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3) +echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig + +echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig +echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig + +export XCODE_XCCONFIG_FILE="$xcconfig" +carthage "$@" \ No newline at end of file diff --git a/smartype-receivers/smartype-mparticle/build.gradle.kts b/smartype-receivers/smartype-mparticle/build.gradle.kts index 21de9b7..b6ba9fd 100644 --- a/smartype-receivers/smartype-mparticle/build.gradle.kts +++ b/smartype-receivers/smartype-mparticle/build.gradle.kts @@ -97,8 +97,7 @@ kotlin { // Create Carthage tasks listOf("bootstrap", "update").forEach { type -> task("carthage${type.capitalize()}") { - group = "carthage" - executable = "carthage" + commandLine("$rootDir/gradle/carthage.sh") args( type, "--platform", "iOS", diff --git a/smartype/build.gradle.kts b/smartype/build.gradle.kts index 82d46b1..40cb6cc 100644 --- a/smartype/build.gradle.kts +++ b/smartype/build.gradle.kts @@ -146,8 +146,7 @@ kotlin { } listOf("bootstrap", "update").forEach { type -> task("carthage${type.capitalize()}") { - group = "carthage" - executable = "carthage" + commandLine("$rootDir/gradle/carthage.sh") args( type, "--platform", "iOS", From 22f75f6b8f96a479ae548934bddf9937b75028ae Mon Sep 17 00:00:00 2001 From: Sam Dozor Date: Thu, 29 Jul 2021 11:32:56 -0400 Subject: [PATCH 3/4] Upgrade Dokka to 1.5.0 Apparently the old version has been deleted from Maven. --- buildSrc/src/main/kotlin/Dependencies.kt | 2 +- smartype-receivers/smartype-mparticle/build.gradle.kts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 6a1aa9e..939d799 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,6 +1,6 @@ object versions { const val kotlin = "1.4.31" - const val dokka = "0.10.1" + const val dokka = "1.5.0" const val spotless = "3.27.0" const val serialization = "1.1.0" } diff --git a/smartype-receivers/smartype-mparticle/build.gradle.kts b/smartype-receivers/smartype-mparticle/build.gradle.kts index b6ba9fd..b641fa1 100644 --- a/smartype-receivers/smartype-mparticle/build.gradle.kts +++ b/smartype-receivers/smartype-mparticle/build.gradle.kts @@ -119,9 +119,9 @@ tasks.named("clean") { tasks { val javadocJar by creating(Jar::class) { - dependsOn(dokka) + dependsOn(org.jetbrains.dokka.gradle.DokkaTask::class) archiveClassifier.set("javadoc") - from(dokka) + from(org.jetbrains.dokka.gradle.DokkaTask::class) } } From bf4fcd72dad42b522d58c768cbb4a27f476136f3 Mon Sep 17 00:00:00 2001 From: Sam Dozor Date: Thu, 29 Jul 2021 11:49:10 -0400 Subject: [PATCH 4/4] Update version to 1.2.3 --- README.md | 4 ++-- examples/androidExample/app/build.gradle | 4 ++-- gradle.properties | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 46305a1..a18d271 100644 --- a/README.md +++ b/README.md @@ -120,8 +120,8 @@ To use Smartype on Android, start by adding the generated `smartype.aar` to your ```kotlin dependencies { - implementation "com.mparticle:smartype-api:1.2.2" - implementation "com.mparticle:smartype-mparticle:1.2.2" + implementation "com.mparticle:smartype-api:1.2.3" + implementation "com.mparticle:smartype-mparticle:1.2.3" implementation fileTree(dir: 'libs', include: ['**/*.aar']) } ``` diff --git a/examples/androidExample/app/build.gradle b/examples/androidExample/app/build.gradle index 91f0fca..476f195 100644 --- a/examples/androidExample/app/build.gradle +++ b/examples/androidExample/app/build.gradle @@ -43,8 +43,8 @@ allprojects { } dependencies { - implementation "com.mparticle:smartype-api:1.2.1" - implementation "com.mparticle:smartype-mparticle:1.2.1" + implementation "com.mparticle:smartype-api:1.2.3" + implementation "com.mparticle:smartype-mparticle:1.2.3" implementation fileTree(dir: 'libs', include: ['**/*.aar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.0.2' diff --git a/gradle.properties b/gradle.properties index c1a91df..c4f1edb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,5 +8,5 @@ kotlin.js.compiler=ir IS_PUBLISHED=false GROUP=com.mparticle -VERSION_NAME=1.2.2 +VERSION_NAME=1.2.3