Closed omar-azmi closed 6 months ago
Thanks for the indepth review, and also for the handy tool.
Initially, I was mostly having issues getting the scripts to run on windows due to inconsistency between bash and cmd commands.
But I realize now that this issue stems from the fact that executing a bash script via cmd redirects it to git-bash, which supports all bash commands, therefore no substitutions to your original $CMD
variables is needed.
but executing a pearl script via cmd, makes it run in the command-prompt environment, where bash commands will not be available.
So, for consistency, a user should ideally run all of the scripts (.sh
and .pl
) in a bash terminal. This way, they won't have to redefine the command variables (including "/dev/null"
, which works on windows git-bash).
Alternatively, we could modify the perl scripts so that they make use of builtin filesystem procedures, rather than calling system commands for trivial operations. This way, all scripts will function just fine irrespective of whether they were originally launched from cmd, or bash.
So, a summary of what I plan on changing in the followup commits:
--release 8
for java compilation.NUL
from .gitignore
, which currently gets created when $DEV_NULL = NUL
, and a bash script that utilizes that variable is ran.I've applied your suggestions, and it works fine on my machine, irrespective of whether I envoke the scripts from cmd or bash. I think it is good to go. would you mind testing it yourself and accepting the PR if it's not causing any issue? let me know if any changes need to be made.
Looks good! I've tested it on my Windows machine and it works well. Nice touch with the bespoke recursive copy function in export-libs.pl
. Thank you!
I was having difficulties getting the scripts to run in windows git-bash, and a lot of it had to to with path strings. This PR improves the compatibility of the scripts with windows, and can also compile projects with dependencies (such as androidx).
Overview of the changes made:
API_LEVEL
to 28, as the finalmake.sh
script fails during compilation at higher api level. possibly related to #4 .include.sh
, so that they reflect windows paths and commands, rather than linux's .\" ... \"
), instead of single quotation (' ... '
). this is because paths begining with a single quotation and ending with one are perfectly valid in windows, thus making the intended paths incorrect.export-libs.pl
, make sure that files are opened in binary mode rather than text. withoutbinmode($fh);
, the resource pngs of androidx were getting corrupted due to their eighth magic byte (0x0A
or "\n") being re-encoded as CRLF (0x0D0A
or "\r\n").make.sh
:android.jar
at the top, otherwise java fails to import the android classes in ourMainActivity.java
, because they were not defined prior.11
to8
, otherwise a compilation error is thrown. this could be due to the fact we previously compiled the linked libraries using target8
, inlink.pl
.$CMD_FIND_SRC_KOTLIN
)..gitignore
to ignore leftovers from building.Fixes to consider before merging:
.gitignore
be removed?