Skip to content

Commit

Permalink
fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex009 committed Sep 22, 2024
1 parent 284506f commit 1062e73
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 17 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
with:
java-version: 17
- name: Check runtime
run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosSimulatorArm64
- name: Install pods
run: cd sample/ios-app && pod install
- name: build ios sample
run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch arm64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
run: ./local-check.sh
- name: Check sample
run: cd sample/ios-app && ./local-check.sh
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ The `develop` branch is pushed to `master` on release.

For more details on contributing please see the [contributing guide](CONTRIBUTING.md).

Before send PR please run checks on local:
- `./local-check.sh` in root of repository
- `./local-check.sh` in `sample` directory

## License
Copyright 2019 IceRock MAG Inc.
Expand Down
18 changes: 18 additions & 0 deletions local-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set -e

log() {
echo "\033[0;32m> $1\033[0m"
}

# run gradle tasks in faster order to receive faster feedback
./gradlew detekt
log "runtime detekt success"

./gradlew assembleDebug
log "runtime android success"

./gradlew compileKotlinIosX64
log "runtime ios success"

./gradlew build publishToMavenLocal
log "runtime build and publish success"
2 changes: 1 addition & 1 deletion sample/ios-app/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../mpp-library"

SPEC CHECKSUMS:
MultiPlatformLibrary: bcc3cf3919bec45c134090b11abd072e73e82e37
MultiPlatformLibrary: e90154651f2068415822dc37193df246c92e7b2a

PODFILE CHECKSUM: f02f071e13bda07c0fef717fc00fab294cd42253

Expand Down
4 changes: 3 additions & 1 deletion sample/ios-app/TestProj.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -273,6 +273,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 4VU932NX78;
INFOPLIST_FILE = src/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.icerock.moko.sample.geo;
PRODUCT_NAME = "moko-geo";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -291,6 +292,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 4VU932NX78;
INFOPLIST_FILE = src/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.icerock.moko.sample.geo;
PRODUCT_NAME = "moko-geo";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
34 changes: 34 additions & 0 deletions sample/local-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Copyright 2023 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 clean assembleDebug
log "sample android success"

if ! command -v xcodebuild &> /dev/null
then
log "xcodebuild could not be found, skip ios checks"

./gradlew build
log "sample full build success"
else
./gradlew clean compileKotlinIosX64
log "sample ios success"

./gradlew clean build syncMultiPlatformLibraryDebugFrameworkIosX64
log "sample clean build success"

(
cd 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 "sample ios xcode success"
fi
15 changes: 5 additions & 10 deletions sample/mpp-library/MultiPlatformLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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"
Expand Down

0 comments on commit 1062e73

Please sign in to comment.