Skip to content

Commit

Permalink
Merge pull request #84 from AAkira/dev/2.1.0
Browse files Browse the repository at this point in the history
2.1.0
  • Loading branch information
AAkira committed Aug 26, 2021
2 parents 1890815 + 3c9ef8c commit 91996d8
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 97 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,24 @@ jobs:
run: ./gradlew :napier:test --stacktrace
- name: Run android tests
run: ./gradlew :napier:testReleaseUnitTest --stacktrace
- name: Run ios tests
run: ./gradlew :napier:iosX64Test --stacktrace
- name: Run jvm tests
run: ./gradlew :napier:jvmTest --stacktrace
- name: Run macos tests
- name: Run ios(intel) tests
run: ./gradlew :napier:iosX64Test --stacktrace
- name: Run ios(apple silicon) tests
run: ./gradlew :napier:iosSimulatorArm64Test --stacktrace
- name: Run macos(intel) tests
run: ./gradlew :napier:macosX64Test --stacktrace
- name: Run watchos tests
- name: Run macos(apple silicon) tests
run: ./gradlew :napier:macosArm64Test --stacktrace
- name: Run watchos(intel) tests
run: ./gradlew :napier:watchosX64Test --stacktrace
- name: Run tvos tests
- name: Run watchos(apple silicon) tests
run: ./gradlew :napier:watchosSimulatorArm64Test --stacktrace
- name: Run tvos(intel) tests
run: ./gradlew :napier:tvosX64Test --stacktrace
- name: Run tvos(apple silicon) tests
run: ./gradlew :napier:tvosSimulatorArm64Test --stacktrace

- name: Bundle the build report
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ uses the `android.util.Log`(Logcat)

![preview-android][preview-android]

### Darwin(iOS, macOS, watchOS, tvOS)
### Darwin(iOS, macOS, watchOS, tvOS)[Intel/Apple silicon]

format: `[Date time][Symbol][Log level][Class name].[Method name] - [Your log]`

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Can't read dependencies.Dep when using kts
// https://github.com/gradle/gradle/issues/9270
import dependencies.Dep

buildscript {
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/Variables.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Run on IntelliJ
val ideaActive = System.getProperty("idea.active") == "true"

// Run on apple silicon
val isAppleSilicon = System.getProperty("os.arch") == "aarch64"
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/dependencies/Dep.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package dependencies

object Dep {

private const val kotlin = "1.5.21"
private const val kotlin = "1.5.30"

object GradlePlugin {
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Dep.kotlin}"

const val android = "com.android.tools.build:gradle:4.1.3"
const val android = "com.android.tools.build:gradle:4.2.1"

const val crashlytics = "com.google.firebase:firebase-crashlytics-gradle:2.5.2"
const val googleService = "com.google.gms:google-services:4.3.5"
Expand All @@ -33,8 +33,8 @@ object Dep {
}

object Android {
const val appCompat = "androidx.appcompat:appcompat:1.2.0"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.0.4"
const val appCompat = "androidx.appcompat:appcompat:1.3.1"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.0"
}

object Firebase {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/dependencies/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dependencies

object Versions {
const val versionCode = 18
const val versionName = "2.0.0"
const val versionCode = 19
const val versionName = "2.1.0"

// android
const val androidVersionCode = 1
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ kotlin.native.enableDependencyPropagation=false
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true

# Android
android.useAndroidX=true
android.enableJetifier=true

# Snatype

GROUP=aakira
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 441ae05d1695723ea9a68d3223ef8b6460bbec0f

COCOAPODS: 1.10.1
COCOAPODS: 1.10.2

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<key>macOS (iOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>2</integer>
</dict>
<key>macOS (macOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
Expand Down
Binary file not shown.
32 changes: 19 additions & 13 deletions mpp-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ plugins {

version = "1.0.0"

val ideaActive = System.getProperty("idea.active") == "true"

kotlin {
android()
js {
Expand All @@ -19,11 +17,14 @@ kotlin {
jvm()

// darwin
macosX64()
if (ideaActive.not()) {
ios()
watchos()
if (isAppleSilicon) {
// apple silicon
macosArm64()
iosSimulatorArm64()
watchosSimulatorArm64()
} else {
// intel
macosX64()
iosX64()
watchosX64()
}
Expand Down Expand Up @@ -53,21 +54,26 @@ kotlin {
}
}

// apple
// darwin
val darwinMain by creating {
dependsOn(commonMain)
}
val macosX64Main by getting {
dependsOn(darwinMain)
}
if (ideaActive.not()) {
val iosMain by getting {
if (isAppleSilicon) {
// apple silicon
val macosArm64Main by getting {
dependsOn(darwinMain)
}
val iosSimulatorArm64Main by getting {
dependsOn(darwinMain)
}
val watchosMain by getting {
val watchosSimulatorArm64Main by getting {
dependsOn(darwinMain)
}
} else {
// intel
val macosX64Main by getting {
dependsOn(darwinMain)
}
val iosX64Main by getting {
dependsOn(darwinMain)
}
Expand Down
19 changes: 9 additions & 10 deletions mpp-sample/mpp_sample.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Pod::Spec.new do |spec|
spec.license = ''
spec.summary = 'CocoaPods library'

spec.static_framework = true
spec.vendored_frameworks = "build/cocoapods/framework/mpp_sample.framework"
spec.libraries = "c++"
spec.module_name = "#{spec.name}_umbrella"
Expand All @@ -17,13 +16,8 @@ Pod::Spec.new do |spec|


spec.pod_target_xcconfig = {
'KOTLIN_TARGET[sdk=iphonesimulator*]' => 'ios_x64',
'KOTLIN_TARGET[sdk=iphoneos*]' => 'ios_arm',
'KOTLIN_TARGET[sdk=watchsimulator*]' => 'watchos_x64',
'KOTLIN_TARGET[sdk=watchos*]' => 'watchos_arm',
'KOTLIN_TARGET[sdk=appletvsimulator*]' => 'tvos_x64',
'KOTLIN_TARGET[sdk=appletvos*]' => 'tvos_arm64',
'KOTLIN_TARGET[sdk=macosx*]' => 'macos_x64'
'KOTLIN_PROJECT_PATH' => ':mpp-sample',
'PRODUCT_MODULE_NAME' => 'mpp_sample',
}

spec.script_phases = [
Expand All @@ -32,10 +26,15 @@ Pod::Spec.new do |spec|
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$COCOAPODS_SKIP_KOTLIN_BUILD" ]; then
echo "Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" :mpp-sample:syncFramework \
-Pkotlin.native.cocoapods.target=$KOTLIN_TARGET \
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration=$CONFIGURATION \
-Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
Expand Down
Loading

0 comments on commit 91996d8

Please sign in to comment.