@@ -11,28 +11,45 @@ Pod::Spec.new do |spec|
11
11
spec . libraries = "c++"
12
12
spec . module_name = "#{ spec . name } _umbrella"
13
13
14
+ spec . ios . deployment_target = '11.0'
15
+
14
16
spec . pod_target_xcconfig = {
15
- 'MPP_LIBRARY_NAME' => 'MultiPlatformLibrary' ,
16
- 'GRADLE_TASK[sdk=iphonesimulator*][config=*ebug]' => 'syncMultiPlatformLibraryDebugFrameworkIosX64' ,
17
- 'GRADLE_TASK[sdk=iphonesimulator*][config=*elease]' => 'syncMultiPlatformLibraryReleaseFrameworkIosX64' ,
18
- 'GRADLE_TASK[sdk=iphoneos*][config=*ebug]' => 'syncMultiPlatformLibraryDebugFrameworkIosArm64' ,
19
- 'GRADLE_TASK[sdk=iphoneos*][config=*elease]' => 'syncMultiPlatformLibraryReleaseFrameworkIosArm64'
17
+ 'KOTLIN_FRAMEWORK_BUILD_TYPE[config=*ebug]' => 'debug' ,
18
+ 'KOTLIN_FRAMEWORK_BUILD_TYPE[config=*elease]' => 'release' ,
19
+ 'CURENT_SDK[sdk=iphoneos*]' => 'iphoneos' ,
20
+ 'CURENT_SDK[sdk=iphonesimulator*]' => 'iphonesimulator' ,
20
21
}
21
22
22
23
spec . script_phases = [
23
24
{
24
25
:name => 'Compile Kotlin/Native' ,
25
26
:execution_position => :before_compile ,
26
27
:shell_path => '/bin/sh' ,
27
- #:output_files => ['$TARGET_BUILD_DIR/$PRODUCT_NAME.framework/$PRODUCT_NAME'],
28
28
:script => <<-SCRIPT
29
- MPP_PROJECT_ROOT="$SRCROOT/../../mpp-library"
29
+ if [ "$KOTLIN_FRAMEWORK_BUILD_TYPE" == "debug" ]; then
30
+ CONFIG="Debug"
31
+ else
32
+ CONFIG="Release"
33
+ fi
30
34
31
- MPP_OUTPUT_DIR="$MPP_PROJECT_ROOT/build/cocoapods/framework"
32
- MPP_OUTPUT_NAME="$MPP_OUTPUT_DIR/#{ spec . name } .framework"
35
+ if [ "$CURENT_SDK" == "iphoneos" ]; then
36
+ TARGET="Ios"
37
+ ARCH="Arm64"
38
+ else
39
+ if [ "$NATIVE_ARCH" == "arm64" ]; then
40
+ TARGET="IosSimulator"
41
+ ARCH="Arm64"
42
+ else
43
+ TARGET="Ios"
44
+ ARCH="X64"
45
+ fi
46
+ fi
47
+
48
+ MPP_PROJECT_ROOT="$SRCROOT/../../mpp-library"
49
+ GRADLE_TASK="syncMultiPlatformLibrary${CONFIG}Framework${TARGET}${ARCH}"
33
50
34
51
"$MPP_PROJECT_ROOT/../gradlew" -p "$MPP_PROJECT_ROOT" "$GRADLE_TASK"
35
52
SCRIPT
36
53
}
37
54
]
38
- end
55
+ end
0 commit comments