Skip to content

Commit f69b6e1

Browse files
committed
Fix 'gradlew' containing CRLF in Docker image on Windows
1 parent 9b276b5 commit f69b6e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pythonforandroid/toolchain.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,14 @@ def apk(self, args):
816816
env["ANDROID_HOME"] = self.ctx.sdk_dir
817817

818818
gradlew = sh.Command('./gradlew')
819+
if exists('/usr/bin/dos2unix'):
820+
# .../dists/bdisttest_python3/gradlew
821+
# .../build/bootstrap_builds/sdl2-python3crystax/gradlew
822+
# if docker on windows, gradle contains CRLF
823+
output = shprint(
824+
sh.Command('dos2unix'), gradlew._path,
825+
_tail=20, _critical=True, _env=env
826+
)
819827
if args.build_mode == "debug":
820828
gradle_task = "assembleDebug"
821829
elif args.build_mode == "release":

0 commit comments

Comments
 (0)