Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Android/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,15 @@ def setup_testbed():
def build_testbed(context):
setup_sdk()
setup_testbed()

# Ensure that CROSS_BUILD_DIR is in the Gradle environment, regardless
# of whether it was set by environment variable or `--cross-build-dir`.
env = os.environ.copy()
env["CROSS_BUILD_DIR"] = CROSS_BUILD_DIR
Comment thread
mhsmith marked this conversation as resolved.
Outdated
run(
[gradlew, "--console", "plain", "packageDebug", "packageDebugAndroidTest"],
cwd=TESTBED_DIR,
env=env,
)


Expand Down Expand Up @@ -645,6 +651,10 @@ async def gradle_task(context):
task_prefix = "connected"
env["ANDROID_SERIAL"] = context.connected

# Ensure that CROSS_BUILD_DIR is in the Gradle environment, regardless
# of whether it was set by environment variable or `--cross-build-dir`.
env["CROSS_BUILD_DIR"] = CROSS_BUILD_DIR

if context.ci_mode:
context.args[0:0] = [
# See _add_ci_python_opts in libregrtest/main.py.
Expand Down Expand Up @@ -896,7 +906,7 @@ def add_parser(*args, **kwargs):
help="Delete build directories for the selected target"
)

add_parser("build-testbed", help="Build the testbed app")
build_testbed = add_parser("build-testbed", help="Build the testbed app")
test = add_parser("test", help="Run the testbed app")
package = add_parser("package", help="Make a release package")
ci = add_parser("ci", help="Run build, package and test")
Expand All @@ -912,6 +922,7 @@ def add_parser(*args, **kwargs):
make_host,
build,
package,
build_testbed,
Comment thread
mhsmith marked this conversation as resolved.
Outdated
test,
ci,
]:
Expand Down
5 changes: 4 additions & 1 deletion Android/testbed/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ plugins {

val ANDROID_DIR = file("../..")
val PYTHON_DIR = ANDROID_DIR.parentFile!!
val PYTHON_CROSS_DIR = file("$PYTHON_DIR/cross-build")
val CROSS_BUILD_DIR = System.getenv("CROSS_BUILD_DIR") ?: "cross-build"
val PYTHON_CROSS_DIR = file(
if ((File(CROSS_BUILD_DIR)).isAbsolute) CROSS_BUILD_DIR else "$PYTHON_DIR/$CROSS_BUILD_DIR"
Comment thread
mhsmith marked this conversation as resolved.
Outdated
)
val inSourceTree = (
ANDROID_DIR.name == "Android" && file("$PYTHON_DIR/pyconfig.h.in").exists()
)
Expand Down
Loading