-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of AGILE code for Desktop version.
- Loading branch information
1 parent
ba07ee0
commit b536588
Showing
140 changed files
with
19,056 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{java,scala,groovy,kt,kts}] | ||
indent_size = 4 | ||
|
||
[*.gradle] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* text=auto eol=lf | ||
*.bat text=auto eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
<uses-feature android:glEsVersion="0x00020000" android:required="true"/> | ||
<application | ||
android:allowBackup="true" | ||
android:fullBackupContent="true" | ||
android:icon="@drawable/ic_launcher" | ||
android:isGame="true" | ||
android:appCategory="game" | ||
android:label="@string/app_name" | ||
tools:ignore="UnusedAttribute" | ||
android:theme="@style/GdxTheme"> | ||
<activity | ||
android:name="com.agifans.agile.android.AndroidLauncher" | ||
android:label="@string/app_name" | ||
android:screenOrientation="landscape" | ||
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
|
||
android { | ||
compileSdk 32 | ||
sourceSets { | ||
main { | ||
manifest.srcFile 'AndroidManifest.xml' | ||
java.srcDirs('src/main/java') | ||
aidl.srcDirs('src/main/java') | ||
renderscript.srcDirs('src/main/java') | ||
res.srcDirs('res') | ||
assets.srcDirs('../assets') | ||
jniLibs.srcDirs('libs') | ||
} | ||
} | ||
packagingOptions { | ||
resources.with { | ||
excludes += ['META-INF/robovm/ios/robovm.xml', | ||
'META-INF/DEPENDENCIES.txt', 'META-INF/DEPENDENCIES', 'META-INF/dependencies.txt', '**/*.gwt.xml'] | ||
pickFirsts += ['META-INF/LICENSE.txt', 'META-INF/LICENSE', 'META-INF/license.txt', 'META-INF/LGPL2.1', | ||
'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/notice.txt'] | ||
} | ||
} | ||
defaultConfig { | ||
applicationId 'com.agifans.agile' | ||
minSdkVersion 19 | ||
targetSdkVersion 32 | ||
versionCode 1 | ||
versionName "1.0" | ||
multiDexEnabled true | ||
} | ||
namespace "com.agifans.agile" | ||
compileOptions { | ||
sourceCompatibility "11" | ||
targetCompatibility "11" | ||
coreLibraryDesugaringEnabled true | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled true | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
// needed for AAPT2, may be needed for other tools | ||
google() | ||
} | ||
|
||
configurations { natives } | ||
|
||
dependencies { | ||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' | ||
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" | ||
implementation project(':core') | ||
|
||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" | ||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" | ||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" | ||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" | ||
|
||
} | ||
|
||
// Called every time gradle gets executed, takes the native dependencies of | ||
// the natives configuration, and extracts them to the proper libs/ folders | ||
// so they get packed with the APK. | ||
tasks.register('copyAndroidNatives') { | ||
doFirst { | ||
file("libs/armeabi-v7a/").mkdirs() | ||
file("libs/arm64-v8a/").mkdirs() | ||
file("libs/x86_64/").mkdirs() | ||
file("libs/x86/").mkdirs() | ||
|
||
configurations.named("natives").orNull.copy().files.each { jar -> | ||
def outputDir = null | ||
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") | ||
if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a") | ||
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64") | ||
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") | ||
if(outputDir != null) { | ||
copy { | ||
from zipTree(jar) | ||
into outputDir | ||
include "*.so" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
tasks.matching { it.name.contains("merge") && it.name.contains("JniLibFolders") }.configureEach { packageTask -> | ||
packageTask.dependsOn 'copyAndroidNatives' | ||
} | ||
|
||
tasks.register('run', Exec) { | ||
def path | ||
def localProperties = project.file("../local.properties") | ||
if (localProperties.exists()) { | ||
Properties properties = new Properties() | ||
localProperties.withInputStream { instr -> | ||
properties.load(instr) | ||
} | ||
def sdkDir = properties.getProperty('sdk.dir') | ||
if (sdkDir) { | ||
path = sdkDir | ||
} else { | ||
path = "$System.env.ANDROID_SDK_ROOT" | ||
} | ||
} else { | ||
path = "$System.env.ANDROID_SDK_ROOT" | ||
} | ||
|
||
def adb = path + "/platform-tools/adb" | ||
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.agifans.agile/com.agifans.agile.android.AndroidLauncher' | ||
} | ||
|
||
eclipse.project.name = appName + "-android" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# To enable ProGuard in your project, edit project.properties | ||
# to define the proguard.config property as described in that file. | ||
# | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in ${sdk.dir}/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the ProGuard | ||
# include property in project.properties. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
-verbose | ||
|
||
-dontwarn android.support.** | ||
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication | ||
-dontwarn com.badlogic.gdx.utils.GdxBuild | ||
-dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild | ||
-dontwarn com.badlogic.gdx.jnigen.BuildTarget* | ||
-dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild | ||
|
||
# If you're encountering ProGuard issues and use gdx-controllers, THIS MIGHT BE WHY!!! | ||
|
||
# Uncomment the following line if you use the gdx-controllers official extension. | ||
#-keep class com.badlogic.gdx.controllers.android.AndroidControllers | ||
|
||
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* { | ||
<init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration); | ||
} | ||
|
||
-keepclassmembers class com.badlogic.gdx.physics.box2d.World { | ||
boolean contactFilter(long, long); | ||
void beginContact(long); | ||
void endContact(long); | ||
void preSolve(long, long); | ||
void postSolve(long, long); | ||
boolean reportFixture(long); | ||
float reportRayFixture(long, float, float, float, float, float); | ||
} | ||
|
||
# You will need the next three lines if you use scene2d for UI or gameplay | ||
# If you don't use scene2d at all, you can remove or comment out the next line | ||
-keep public class com.badlogic.gdx.scenes.scene2d.** { *; } | ||
# You will need the next two lines if you use BitmapFont or any scene2d.ui text | ||
-keep public class com.badlogic.gdx.graphics.g2d.BitmapFont { *; } | ||
# You will probably need this line in most cases | ||
-keep public class com.badlogic.gdx.graphics.Color { *; } | ||
|
||
# These two lines are used with mapping files; see https://developer.android.com/build/shrink-code#retracing | ||
-keepattributes LineNumberTable,SourceFile | ||
-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system edit | ||
# "ant.properties", and override values to adapt the script to your | ||
# project structure. | ||
# | ||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): | ||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-rules.pro | ||
|
||
# Project target. | ||
target=android-19 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">agile</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<resources> | ||
<style name="GdxTheme" parent="android:Theme"> | ||
<item name="android:windowBackground">@android:color/transparent</item> | ||
<item name="android:colorBackgroundCacheHint">@null</item> | ||
<item name="android:windowAnimationStyle">@android:style/Animation</item> | ||
<item name="android:windowNoTitle">true</item> | ||
<item name="android:windowContentOverlay">@null</item> | ||
<item name="android:windowFullscreen">true</item> | ||
</style> | ||
</resources> |
18 changes: 18 additions & 0 deletions
18
android/src/main/java/com/agifans/agile/android/AndroidLauncher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.agifans.agile.android; | ||
|
||
import android.os.Bundle; | ||
|
||
import com.badlogic.gdx.backends.android.AndroidApplication; | ||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; | ||
import com.agifans.agile.Agile; | ||
|
||
/** Launches the Android application. */ | ||
public class AndroidLauncher extends AndroidApplication { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration(); | ||
configuration.useImmersiveMode = true; // Recommended, but not required. | ||
initialize(new Agile(), configuration); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
maven { url 'https://s01.oss.sonatype.org' } | ||
mavenLocal() | ||
google() | ||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } | ||
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } | ||
} | ||
dependencies { | ||
classpath "com.android.tools.build:gradle:8.1.2" | ||
classpath "org.docstr:gwt-gradle-plugin:$gwtPluginVersion" | ||
|
||
} | ||
} | ||
|
||
allprojects { | ||
apply plugin: 'eclipse' | ||
apply plugin: 'idea' | ||
} | ||
|
||
configure(subprojects - project(':android')) { | ||
apply plugin: 'java-library' | ||
sourceCompatibility = 11 | ||
compileJava { | ||
options.incremental = true | ||
} | ||
} | ||
|
||
subprojects { | ||
version = '1.0.0' | ||
ext.appName = 'agile' | ||
repositories { | ||
mavenCentral() | ||
maven { url 'https://s01.oss.sonatype.org' } | ||
// You may want to remove the following line if you have errors downloading dependencies. | ||
mavenLocal() | ||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } | ||
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
|
||
eclipse.project.name = 'agile' + '-parent' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' | ||
eclipse.project.name = appName + '-core' | ||
|
||
dependencies { | ||
api "com.badlogicgames.gdx:gdx:$gdxVersion" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.10.0//EN" "https://www.gwtproject.org/doctype/2.10.0/gwt-module.dtd"> | ||
<module> | ||
<source path="" /> | ||
|
||
</module> |
Oops, something went wrong.