Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcdd4489

Browse files
committed
collect-dependencies opt in for now
1 parent12233b2 commitcdd4489

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

‎src/main/scripts/create_scripts.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
# gradle/src/main/groovy/net/zhuoweizhang/swiftandroid/SwiftAndroidPlugin.groovy
66
#
77

8+
export ANDROID_HOME="${ANDROID_HOME?-Please export ANDROID_HOME}"
9+
export JAVA_HOME="${JAVA_HOME?-Please export JAVA_HOME}"
10+
811
SWIFT_INSTALL="$(dirname"$PWD")"
9-
SRC_SCRIPTS_DIR="$PWD/$(dirname$0)"
10-
UNAME=`uname`
12+
UNAME="$(uname)"
1113

1214
SCRIPTS=~/.gradle/scripts
1315

14-
export JAVA_HOME="${JAVA_HOME?-Please export JAVA_HOME}"
15-
1616
cat<<DOC &&
1717
1818
Running:$SWIFT_INSTALL/swift-android-gradle/$0
@@ -118,6 +118,9 @@ SWIFT_INSTALL="$SWIFT_INSTALL"
118118
export PATH="\$SWIFT_INSTALL/usr/bin:\$PATH"
119119
export SWIFT_EXEC=~/.gradle/scripts/swiftc-android.sh
120120
121+
# Uncomment if you would like to work with packages containing prebuilt binaries
122+
#"\$SWIFT_INSTALL"/swift-android-gradle/src/main/scripts/collect-dependencies.py
123+
121124
swift build "\$@"
122125
123126
SCRIPT
@@ -128,8 +131,6 @@ cat <<SCRIPT >swiftc-android.sh &&
128131
# Substitutes in for swiftc to compile package and build Android sources
129132
#
130133
131-
PLATFORM=\$(uname)
132-
133134
SWIFT_INSTALL="$SWIFT_INSTALL"
134135
export PATH="\$SWIFT_INSTALL/usr/$UNAME:\$SWIFT_INSTALL/usr/bin:\$PATH"
135136
@@ -141,7 +142,7 @@ fi
141142
# remove whatever target SwiftPM has supplied
142143
ARGS=\$(echo "\$*" | sed -E "s@-target [^[:space:]]+ -sdk /[^[:space:]]* (-F /[^[:space:]]* )?@@")
143144
144-
if [[\$PLATFORM == "Darwin" ]]; then
145+
if [["$UNAME" == "Darwin" ]]; then
145146
# xctest
146147
if [[ "\$*" =~ "-Xlinker -bundle" ]]; then
147148
xctest_bundle=\$(echo\$ARGS | grep -o\$(pwd)'[^[:space:]]*xctest')
@@ -164,9 +165,9 @@ if [[ \$PLATFORM == "Darwin" ]]; then
164165
fi
165166
166167
# for compatability with V3 Package.swift for now
167-
if [[ "\$ARGS" =~ " -emit-executable " && "\$ARGS" =~ ".so " ]]; then
168-
ARGS=\$(echo "\$ARGS" | sed -E "s@ (-module-name [^[:space:]]+ )?-emit-executable @ -emit-library @")
169-
fi
168+
#if [[ "\$ARGS" =~ " -emit-executable " && "\$ARGS" =~ ".so " ]]; then
169+
# ARGS=\$(echo "\$ARGS" | sed -E "s@ (-module-name [^[:space:]]+ )?-emit-executable @ -emit-library @")
170+
#fi
170171
171172
# compile using toolchain's swiftc with Android target
172173
swiftc -target armv7-none-linux-androideabi -sdk "\$SWIFT_INSTALL/ndk-android-21"\\
@@ -185,21 +186,20 @@ DESTINATION="\$1"
185186
SWIFT_INSTALL="$SWIFT_INSTALL"
186187
187188
mkdir -p "\$DESTINATION" && cd "\$DESTINATION" &&
188-
rsync -u "\$SWIFT_INSTALL"/usr/lib/swift/android/*.so . &&
189-
rm -f *Unittest*
189+
rsync -u "\$SWIFT_INSTALL"/usr/lib/swift/android/*.so .
190190
191191
SCRIPT
192192

193193
cat<<SCRIPT >run-tests.sh &&
194194
#!/bin/bash
195+
#
196+
# Builds test bundles and pushes them to the device and runs them
197+
#
195198
196199
export SWIFT_INSTALL="$SWIFT_INSTALL"
197-
export PATH="\$SWIFT_INSTALL/usr/bin:\$PATH"
198-
~/.gradle/scripts/run-tests.py
199-
SCRIPT
200+
"\$SWIFT_INSTALL"/swift-android-gradle/src/main/scripts/run-tests.py
200201
201-
cp$SRC_SCRIPTS_DIR/collect-dependencies.py$SCRIPTS/&&
202-
cp$SRC_SCRIPTS_DIR/run-tests.py$SCRIPTS/&&
202+
SCRIPT
203203

204204
chmod +x {generate-swift,swift-build,swiftc-android,copy-libraries,run-tests}.sh&&
205205
echo Created:$SCRIPTS/{generate-swift,swift-build,swiftc-android,copy-libraries,run-tests}.sh&&

‎src/main/scripts/run-tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def exec_tests(folder, name):
3838

3939

4040
defrun(json):
41-
subprocess.call([expanduser("~/.gradle/scripts/collect-dependencies.py")])
4241
subprocess.call([expanduser("~/.gradle/scripts/swift-build.sh"),"--build-tests"])
4342

4443
name=extract_tests_package(package_json)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp