Skip to content

Commit

Permalink
Merge pull request #20 from mParticle/bugfix/killswitch
Browse files Browse the repository at this point in the history
Don't delete build dir when initializing
  • Loading branch information
samdozor authored Jul 29, 2021
2 parents aad425d + bf4fcd7 commit 176085b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
}
```
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/androidExample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ kotlin.js.compiler=ir
IS_PUBLISHED=false

GROUP=com.mparticle
VERSION_NAME=1.2.2
VERSION_NAME=1.2.3

19 changes: 19 additions & 0 deletions gradle/carthage.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
7 changes: 3 additions & 4 deletions smartype-receivers/smartype-mparticle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ kotlin {
// Create Carthage tasks
listOf("bootstrap", "update").forEach { type ->
task<Exec>("carthage${type.capitalize()}") {
group = "carthage"
executable = "carthage"
commandLine("$rootDir/gradle/carthage.sh")
args(
type,
"--platform", "iOS",
Expand All @@ -120,9 +119,9 @@ tasks.named<Delete>("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)
}
}

Expand Down
3 changes: 1 addition & 2 deletions smartype/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ kotlin {
}
listOf("bootstrap", "update").forEach { type ->
task<Exec>("carthage${type.capitalize()}") {
group = "carthage"
executable = "carthage"
commandLine("$rootDir/gradle/carthage.sh")
args(
type,
"--platform", "iOS",
Expand Down

0 comments on commit 176085b

Please sign in to comment.