deptofdefense / AndroidTacticalAssaultKit-CIV

Other
900 stars 321 forks source link

Fix GitHub Assemble Action #314

Open xtoddx opened 8 months ago

xtoddx commented 8 months ago

Problem

The assemble action on PRs derives from the openjdk:8-jdk container, but during the update process install of apache ant brings in OpenJDK 11.

The javah command for jni interactions was removed in version 10, so using version 11 breaks the build process while building commoncommo

Solution

In order to use the expected JDK, install ant manually instead of from deb package.

Ability to merge

✅ Evidence of a successful run (See "Validation" below) ✅ Signed-off and accepted Developer Certificate of Origin (CONTRIBUTORS.md change in this PR) ✅ Reasonable scope and size for review (the PR text you're reading is much larger than the change)

Discussion

Validation

Here is the successful run using the new action: [https://github.com/xtoddx/ATAK-CIV/actions/runs/7351078940/job/20013833196?pr=1](xtoddx/ATAK-CIV #1)

Since github deletes action logs after a while, I'll provide some screenshots as well.

First, we see that ant is no longer installed by apt:

Screen Shot 2023-12-28 at 6 02 56 PM

Then, we see the new step executes successfully:

Screen Shot 2023-12-28 at 6 03 43 PM

Cliking the link above will show that the entire action was successful.

Changes to Environment

This commit followed the existing pattern for keeping version numbers in the environment, and added ANT_VERSION for this purpose.

Additionally, ANT_HOME is added per the (ant manual)[https://ant.apache.org/manual/index.html], and PATH is updated so the ant binary can be found.

Long term

There is room for a more long-term fix, by using javac -h instead of javah to build headers form the jni components. Since the public project is a minor version behind what is released through other channels like the play store, I'll reserve that change in case it has already happend internally but not made it to github.