forge icon indicating copy to clipboard operation
forge copied to clipboard

Android manifest update

Open Hanmac opened this issue 1 year ago • 10 comments

this moves the Android Manifest to the more Default Location for the plugins

and enables manifest-merger goal.

This sets the VersionName and generates the VersionCode from it

Hanmac avatar Apr 07 '24 18:04 Hanmac

@Agetian maybe you know why on github we don't need to mess with the d8 file?

Hanmac avatar Apr 08 '24 05:04 Hanmac

@Agetian maybe you know why on github we don't need to mess with the d8 file?

Hmm, not sure tbh, I haven't investigated the Github way of doing things as far as building and deploying an Android snapshot goes ^^;

Agetian avatar Apr 08 '24 16:04 Agetian

@Agetian can you look to replace

Forge.CURRENT_VERSION in there: https://github.com/Card-Forge/forge/blob/e2f4c2cfa7a551a215192334bdfc7cfed677b01d/forge-gui-mobile/src/forge/Forge.java#L57

BuildInfo.getVersionString ? https://github.com/Card-Forge/forge/blob/e2f4c2cfa7a551a215192334bdfc7cfed677b01d/forge-core/src/main/java/forge/util/BuildInfo.java#L35

that is one of the last pieces where the Version needs to be updated

Hanmac avatar Apr 26 '24 08:04 Hanmac

Hmm, getVersionString simply returns "GIT" for me (on a snapshot version), with the entire BuildInfo.class.getPackage() method returning "null"... Not sure if it would return a proper version string if executed on an actual release. At any rate, kinda confusing for snapshots as such. I wonder if there's a better way to track the number, hmm...

Agetian avatar Apr 26 '24 14:04 Agetian

Hmm, getVersionString simply returns "GIT" for me (on a snapshot version), with the entire BuildInfo.class.getPackage() method returning "null"... Not sure if it would return a proper version string if executed on an actual release. At any rate, kinda confusing for snapshots as such. I wonder if there's a better way to track the number, hmm...

Normally, maven should have put the version inside these Manifest files so it can be accessed by getPackage() I need to check what is missing

Hanmac avatar Apr 26 '24 14:04 Hanmac

I think we need https://maven.apache.org/shared/maven-archiver/examples/manifest.html

     <configuration>
         <archive>
             <manifest>
                 <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
             </manifest>
         </archive>
     </configuration>

i will check this out at weekend

Hanmac avatar Apr 26 '24 14:04 Hanmac

Sounds good!

Agetian avatar Apr 26 '24 14:04 Agetian

@Agetian the addDefaultImplementationEntries should already be enabled by default

when i run ./forge.sh i already got the correct Forge Version

As for the Android thing, i tried:

JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ mvn -U -B -P android-debug install -Dsign.keystore=forge.keystore -Dsign.alias=Forge -Dandroid.sdk.path=/opt/android-sdk/ -T 1C -DskipTests=true

and i get:

[ERROR] Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.6.1:manifest-merger (update-manifest) on project forge-gui-android: Execution update-manifest of goal com.simpligility.maven.plugins:android-maven-plugin:4.6.1:manifest-merger failed: FeatureName must follow [a-zA-Z0-9][a-zA-Z0-9_]* regex, found -> [Help 1]

but i can't find where the problem is happening (it is difficult to debug inside the maven plugin)

Hanmac avatar Apr 27 '24 10:04 Hanmac

This PR has not been updated in a while nad has been marked on stale. Stale PRs will be auto closed

github-actions[bot] avatar Jun 12 '24 09:06 github-actions[bot]

Linked Issue that is causing the problem: https://github.com/simpligility/android-maven-plugin/issues/814

Hanmac avatar Jun 12 '24 11:06 Hanmac