Skip to content

Commit aa79914

Browse files
committed
Avoid automatic decompression of .gz files
1 parent 8b64dd8 commit aa79914

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Android/testbed/app/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ androidComponents.onVariants { variant ->
229229
from(cwd)
230230
}
231231
}
232+
233+
// A filename ending with .gz will be automatically decompressed
234+
// while building the APK. Avoid this by adding a dash to the end,
235+
// and add an extra dash to any filenames that already end with one.
236+
// This will be undone in MainActivity.kt.
237+
rename(""".*(\.gz|-)""", "$0-")
232238
}
233239
}
234240

Android/testbed/app/src/main/java/org/python/testbed/MainActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ class PythonTestRunner(val context: Context) {
8080
continue
8181
}
8282
input.use {
83-
File(targetSubdir, name).outputStream().use { output ->
83+
// Undo the .gz workaround from build.gradle.kts.
84+
val outputName = name.replace(Regex("""(.*)-"""), "$1")
85+
File(targetSubdir, outputName).outputStream().use { output ->
8486
input.copyTo(output)
8587
}
8688
}

0 commit comments

Comments
 (0)