Set up the stuff to build the game for Android. See the Maven module forum topic for details.

This commit is contained in:
Krazy
2014-04-27 02:22:24 +00:00
parent 811d59ed24
commit 73cf1096bb
12 changed files with 160 additions and 69 deletions

7
.gitattributes vendored
View File

@@ -644,8 +644,14 @@ forge-gui-android/gen/forge/view/BuildConfig.java -text
forge-gui-android/gen/forge/view/R.java -text forge-gui-android/gen/forge/view/R.java -text
forge-gui-android/ic_launcher-web.png -text forge-gui-android/ic_launcher-web.png -text
forge-gui-android/libs/android-support-v4.jar -text forge-gui-android/libs/android-support-v4.jar -text
forge-gui-android/libs/armeabi-v7a/libgdx.so -text
forge-gui-android/libs/armeabi/libgdx.so -text
forge-gui-android/libs/gdx-backend-android-sources.jar -text forge-gui-android/libs/gdx-backend-android-sources.jar -text
forge-gui-android/libs/gdx-backend-android.jar -text forge-gui-android/libs/gdx-backend-android.jar -text
forge-gui-android/libs/gdx-freetype.jar -text
forge-gui-android/libs/gdx-sources.jar -text
forge-gui-android/libs/gdx.jar -text
forge-gui-android/libs/x86/libgdx.so -text
forge-gui-android/lint.xml -text forge-gui-android/lint.xml -text
forge-gui-android/proguard.cfg -text forge-gui-android/proguard.cfg -text
forge-gui-android/project.properties -text forge-gui-android/project.properties -text
@@ -1186,6 +1192,7 @@ forge-gui-mobile/src/forge/util/LayoutHelper.java -text
forge-gui-mobile/src/forge/util/PhysicsObject.java -text forge-gui-mobile/src/forge/util/PhysicsObject.java -text
forge-gui-mobile/src/forge/util/Utils.java -text forge-gui-mobile/src/forge/util/Utils.java -text
forge-gui-mobile/src/forge/util/WaitRunnable.java -text forge-gui-mobile/src/forge/util/WaitRunnable.java -text
forge-gui-mobile/src/forge/view/Main.java -text
forge-gui/.classpath -text forge-gui/.classpath -text
forge-gui/.project -text forge-gui/.project -text
forge-gui/.settings/org.eclipse.core.resources.prefs -text forge-gui/.settings/org.eclipse.core.resources.prefs -text

View File

@@ -13,7 +13,7 @@
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" > android:label="@string/app_name" >
<activity <activity
android:name="forge.view.Main" android:name=".Main"
android:label="@string/app_name" > android:label="@string/app_name" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,17 +6,11 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="lib" path="libs/gdx.jar" sourcepath="libs/gdx-sources.jar"/>
<classpathentry kind="lib" path="libs/gdx-freetype.jar"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@@ -1,9 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId> <groupId>forge</groupId>
<artifactId>forge-gui-mobile</artifactId>
<version>1.5.18-SNAPSHOT</version> <version>1.5.18-SNAPSHOT</version>
</parent>
<artifactId>forge-gui-mobile</artifactId>
<packaging>apk</packaging>
<name>Forge</name> <name>Forge</name>
<build> <build>
<sourceDirectory>src</sourceDirectory> <sourceDirectory>src</sourceDirectory>
<plugins> <plugins>
@@ -15,10 +23,40 @@
<target>1.7</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.9.0-rc.1</version>
<extensions>true</extensions>
<configuration>
<sign>
<debug>true</debug>
</sign>
<sdk>
<platform>19</platform>
</sdk>
<dexForceJumbo>true</dexForceJumbo>
<deleteConflictingFiles>true</deleteConflictingFiles>
<androidManifestFile>${project.basedir}/../forge-gui-android/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/../forge-gui-android/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/../forge-gui-android/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/../forge-gui-android/libs</nativeLibrariesDirectory>
<extractDuplicates>true</extractDuplicates>
<proguard>
<config>${project.basedir}/../forge-gui-android/proguard.cfg</config>
</proguard>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>forge</groupId> <groupId>forge</groupId>
<artifactId>forge-core</artifactId> <artifactId>forge-core</artifactId>
@@ -59,5 +97,32 @@
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.3</version> <version>3.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx</artifactId>
<version>0.9.9</version>
</dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-freetype</artifactId>
<version>0.9.9</version>
</dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-freetype-platform</artifactId>
<version>0.9.9</version>
</dependency>
<dependency>
<groupId>xmlpull</groupId>
<artifactId>xmlpull</artifactId>
<version>1.1.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-backend-android</artifactId>
<version>0.9.9</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -0,0 +1,24 @@
package forge.view;
import android.content.pm.ActivityInfo;
import android.os.Build;
import android.os.Bundle;
import com.badlogic.gdx.backends.android.AndroidApplication;
import forge.Forge;
public class Main extends AndroidApplication {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setup portrait orientation
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
if (Build.VERSION.SDK_INT > 8) { //use dual-side portrait mode if supported
this.setRequestedOrientation(7);
}
initialize(new Forge(getClipboard()), false);
}
}

View File

@@ -192,6 +192,7 @@
<module>forge-net</module> <module>forge-net</module>
<module>forge-gui</module> <module>forge-gui</module>
<module>forge-gui-desktop</module> <module>forge-gui-desktop</module>
<module>forge-gui-mobile</module>
</modules> </modules>
<distributionManagement> <distributionManagement>