@@ -18,11 +18,6 @@ if [[ ! -d "${patches_dir}" ]]; then
18
18
exit 1
19
19
fi
20
20
21
- if [[ " ${BUILD_VERSION} " == " " ]]; then
22
- echo " $0 : BUILD_VERSION environment is not set"
23
- exit 1
24
- fi
25
-
26
21
cd ${source_dir} /swift-project
27
22
swift_android_patch=" ${patches_dir} /swift-android.patch"
28
23
@@ -33,13 +28,28 @@ perl -pi -e 's/#if os\(Windows\)/#if os\(Android\)/g' $swift_android_patch
33
28
# remove the need to link in android-execinfo
34
29
perl -pi -e ' s/dispatch android-execinfo/dispatch/g' $swift_android_patch
35
30
36
- if [ " ${BUILD_VERSION} " = ' release' ]; then
37
- testing_patch=" ${patches_dir} /swift-android-testing-release.patch"
38
- else
39
- testing_patch=" ${patches_dir} /swift-android-testing-except-release.patch"
40
- fi
31
+ case " ${BUILD_VERSION} " in
32
+ release)
33
+ testing_patch=" ${patches_dir} /swift-android-testing-release.patch"
34
+ ;;
35
+ devel)
36
+ testing_patch=" ${patches_dir} /swift-android-testing-except-release.patch"
37
+ ;;
38
+ trunk)
39
+ testing_patch=" ${patches_dir} /swift-android-testing-except-release.patch"
40
+ dispatch_patch=" ${patches_dir} /swift-android-trunk-libdispatch.patch"
41
+ ;;
42
+ * )
43
+ echo " $0 : invalid BUILD_VERSION=${BUILD_VERSION} "
44
+ exit 1
45
+ ;;
46
+ esac
47
+
48
+ for patch in " $swift_android_patch " " $testing_patch " " $dispatch_patch " ; do
49
+ if [[ " ${patch} " == " " ]]; then
50
+ continue
51
+ fi
41
52
42
- for patch in " $swift_android_patch " " $testing_patch " ; do
43
53
echo " applying patch $patch in $PWD …"
44
54
45
55
if git apply -C1 --reverse --check " $patch " > /dev/null 2>&1 ; then
@@ -59,4 +69,3 @@ perl -pi -e 's/os\(Android\)/os\(AndroidDISABLED\)/g' swift-testing/Sources/Test
59
69
# need to un-apply libandroid-spawn since we don't need it for API28+
60
70
perl -pi -e ' s/MATCHES "Android"/MATCHES "AndroidDISABLED"/g' llbuild/lib/llvm/Support/CMakeLists.txt
61
71
perl -pi -e ' s/ STREQUAL Android\)/ STREQUAL AndroidDISABLED\)/g' swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
62
-
0 commit comments