Skip to content

Commit

Permalink
android build again
Browse files Browse the repository at this point in the history
  • Loading branch information
msx80 committed Sep 19, 2024
1 parent 65f74fa commit 8a38ef0
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Build android
run: |
cd android-mvn
mvn --batch-mode -Dcartridge.artifactId=doorsofdoom -Dcartridge.groupId=com.github.msx80.omicron -Dcartridge.version=$GITHUB_DDVER clean install android:apk
mvn --batch-mode -Dcartridge.artifactId=doorsofdoom -Dcartridge.groupId=com.github.msx80.omicron -Dcartridge.version=$GITHUB_DDVER clean package
- name: Deploy Apk
uses: actions/upload-artifact@v4
with:
Expand Down
73 changes: 62 additions & 11 deletions android-mvn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.msx80.omicron</groupId>
<artifactId>omicronandroid</artifactId>
<artifactId>android-wrapper</artifactId>
<version>1.0.0</version>
<packaging>apk</packaging>

<name>OmicronAndroid</name>

<properties>

<!-- This is the omicron cartridge to be package as an Android app. You can pass the properties as arguments to mvn with -D -->
Expand All @@ -22,7 +21,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gdx.version>1.12.1</gdx.version>
<omicron.engine.version>0.0.6</omicron.engine.version>
<omicron.engine.version>0.0.7</omicron.engine.version>
</properties>

<pluginRepositories>
Expand Down Expand Up @@ -121,7 +120,50 @@
</pluginManagement>

<plugins>



<plugin>
<!-- parse the version of the cartridge into Major, Minor, Incremental etc. Used to derive the versionCode from the Incremental part. -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>validate</phase>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
<configuration>
<propertyPrefix>cartridgeVersion</propertyPrefix>
<versionString>${cartridge.version}</versionString>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Cartridge version breakup:</echo>
<echo>Major: ${cartridgeVersion.majorVersion}</echo>
<echo>Minor: ${cartridgeVersion.minorVersion}</echo>
<echo>Incremental (this will be used as VersionCode): ${cartridgeVersion.incrementalVersion}</echo>
<echo>Qualifier: ${cartridgeVersion.qualifier}</echo>
<echo>BuildNumber: ${cartridgeVersion.buildNumber}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>

<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -224,13 +266,23 @@
<!-- main android plugin. select platform and build-tool version (33.0.2 is the last one supported by java 8) -->
<groupId>com.github.msx80</groupId>
<artifactId>android-maven-plugin</artifactId>
<!--<executions>
<executions>
<execution>
<phase>install</phase>
<phase>package</phase>
<goals>
<goal>apk</goal>
</goals>-->
<configuration>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
<configuration>
<zipalignSkip>false</zipalignSkip>
<zipalign>
<skip>false</skip>
<verbose>true</verbose>
<inputApk>${project.build.directory}/${cartridge.artifactId}.apk</inputApk>
<outputApk>${project.build.directory}/${cartridge.artifactId}.apk</outputApk>
</zipalign>
<!-- read natives from the folder we have unpacked them earlier -->
<nativeLibrariesDirectory>${project.build.directory}/libgdxnatives/</nativeLibrariesDirectory>
<sdk>
Expand All @@ -245,8 +297,7 @@
<!-- use the dynamically built manifest -->
<androidManifestFile>${project.build.directory}/filtered-manifest/src/main/AndroidManifest.xml.template</androidManifestFile>
</configuration>
<!-- </execution>
</executions> -->

</plugin>
</plugins>
<finalName>${cartridge.artifactId}</finalName>
Expand Down
2 changes: 1 addition & 1 deletion android-mvn/src/main/AndroidManifest.xml.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="${omicron.pkg}"
android:versionCode="${omicron.versionCode}"
android:versionCode="${cartridgeVersion.incrementalVersion}"
android:versionName="${cartridge.version}">
<application android:label="${omicron.name}" android:icon="@drawable/ic_launcher" >

Expand Down
3 changes: 2 additions & 1 deletion doorsofdoom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

<artifactId>doorsofdoom</artifactId>
<groupId>com.github.msx80.omicron</groupId>
<!-- NOTE: keep Major and Minor version at 0 because Incremental is used to derive versionCode for android -->
<version>0.0.6</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<omicron.engine.version>0.0.6</omicron.engine.version>
<omicron.engine.version>0.0.7</omicron.engine.version>
</properties>
<repositories>
<repository>
Expand Down
1 change: 0 additions & 1 deletion doorsofdoom/src/main/resources/omicron.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ omicron.omicronVersion=0.0.1
omicron.name=Doors of Doom
omicron.pkg=com.github.msx80.doorsofdoom
omicron.main=DoorsOfDoom
omicron.versionCode=3
omicron.orientation=landscape

0 comments on commit 8a38ef0

Please sign in to comment.