21
21
cd ${source_dir} /swift-project
22
22
swift_android_patch=" ${patches_dir} /swift-android.patch"
23
23
24
+ ls -la swift/utils/build-script-impl
25
+ ls -la ${swift_android_patch}
26
+ ls -la swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift
27
+
24
28
# patch the patch, which seems to only be needed for an API less than 28
25
29
# https://github.com/finagolfin/swift-android-sdk/blob/main/swift-android.patch#L110
26
30
perl -pi -e ' s/#if os\(Windows\)/#if os\(Android\)/g' $swift_android_patch
@@ -56,9 +60,9 @@ for patch in "$swift_android_patch" "$testing_patch" "$dispatch_patch"; do
56
60
57
61
echo " applying patch $patch in $PWD …"
58
62
# first check to make sure the patches can apply and fail if not
59
- patch -v --check -C1 < " $patch "
60
- echo " patch --check result: $0 "
61
- patch -v -C1 < " $patch "
63
+ git apply -v --check -C1 " $patch "
64
+ echo " git apply --check result: $0 "
65
+ git apply -v -C1 " $patch "
62
66
63
67
# if git apply -C1 --reverse --check "$patch" >/dev/null 2>&1 ; then
64
68
# echo "already patched"
@@ -70,11 +74,6 @@ for patch in "$swift_android_patch" "$testing_patch" "$dispatch_patch"; do
70
74
# fi
71
75
done
72
76
73
- # validate the patches
74
- ls -la swift/utils/build-script-impl
75
- grep ' VALIDATING SYMBOLIC LINK' swift/utils/build-script-impl
76
-
77
-
78
77
perl -pi -e ' s%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift
79
78
# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
80
79
perl -pi -e ' s;os\(Android\);os\(AndroidDISABLED\);g' swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
@@ -83,3 +82,7 @@ perl -pi -e 's;os\(Android\);os\(AndroidDISABLED\);g' swift-testing/Sources/Test
83
82
perl -pi -e ' s;MATCHES "Android";MATCHES "AndroidDISABLED";g' llbuild/lib/llvm/Support/CMakeLists.txt
84
83
perl -pi -e ' s; STREQUAL Android\); STREQUAL AndroidDISABLED\);g' swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
85
84
85
+ # validate the patches
86
+ ls -la swift/utils/build-script-impl
87
+ grep ' VALIDATING SYMBOLIC LINK' swift/utils/build-script-impl
88
+
0 commit comments