Skip to content

Commit

Permalink
fixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
msx80 committed Sep 15, 2024
1 parent 1f68936 commit 12e88d5
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 4 deletions.
45 changes: 44 additions & 1 deletion android-mvn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,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
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
2 changes: 2 additions & 0 deletions demo/HelloWorld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>


<artifactId>helloworld</artifactId>
<groupId>com.github.msx80.omicron</groupId>
<version>0.0.3</version>


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.github.msx80.omicron.plugins.builtin;

import com.badlogic.gdx.Gdx;
import com.github.msx80.omicron.HardwareInterface;
import com.github.msx80.omicron.HardwarePlugin;

public class PlatformPlugin implements HardwarePlugin {

@Override
public void init(HardwareInterface hw) {

}

@Override
public Object exec(String command, Object params) {
if("PLATFORM".equals(command))
{
return Gdx.app.getType().toString().toUpperCase();
}
return "ERR: command not found";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public AbstractJarCartridge(Loader loader) throws Exception {

@Override
public byte[] loadFile(String filePath) {
String path = properties.getProperty(PROP_PKG).replace('.', '/')+'/';
String path = properties.getProperty("omicron.pkg").replace('.', '/')+'/';
String cf = path+filePath;

return loader.loadFile(cf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public synchronized Game getGameObject() {
private Game loadGameObject()
{
try {
String className = properties.getProperty(PROP_PKG) + "." + properties.getProperty(PROP_MAIN);
String className = properties.getProperty("omicron.pkg") + "." + properties.getProperty("omicron.main");
ClassLoader c = getAllowAllClassLoader(this::loadCustomClass);
Class<?> userClass = c.loadClass(className);
return (Game) userClass.newInstance();
Expand Down

0 comments on commit 12e88d5

Please sign in to comment.