Source reformat

This commit is contained in:
Anuken
2019-04-08 09:03:18 -04:00
parent 4a96b9bb00
commit b40beb0d1d
331 changed files with 2822 additions and 3274 deletions
+21 -21
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry">
package="io.anuke.mindustry">
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:resizeableActivity="false"
@@ -16,16 +16,16 @@
android:appCategory="game"
android:label="@string/app_name"
android:theme="@style/GdxTheme" android:fullBackupContent="@xml/backup_rules">
<meta-data android:name="android.max_aspect" android:value="2.1" />
<meta-data android:name="android.max_aspect" android:value="2.1"/>
<activity
android:name="io.anuke.mindustry.AndroidLauncher"
android:label="@string/app_name"
android:screenOrientation="user"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout">
android:name="io.anuke.mindustry.AndroidLauncher"
android:label="@string/app_name"
android:screenOrientation="user"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
@@ -33,7 +33,7 @@
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:mimeType="application/octet-stream"/>
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.mmap" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.mmap"/>
</intent-filter>
<intent-filter>
@@ -41,28 +41,28 @@
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:mimeType="application/octet-stream"/>
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.msav" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.msav"/>
</intent-filter>
<intent-filter android:icon="@mipmap/ic_launcher"
android:label="Mindustry Map"
android:priority="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.mmap" android:mimeType="*/*" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.mmap" android:mimeType="*/*"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.msav" android:mimeType="*/*" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.msav" android:mimeType="*/*"/>
</intent-filter>
</activity>
<activity android:name=".DonationsActivity"
android:theme="@style/GdxTheme" />
android:theme="@style/GdxTheme"/>
</application>
+45 -45
View File
@@ -1,30 +1,30 @@
buildscript {
repositories {
buildscript{
repositories{
mavenLocal()
mavenCentral()
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
dependencies{
classpath 'com.android.tools.build:gradle:3.3.2'
}
}
apply plugin: "com.android.application"
configurations { natives }
configurations{ natives }
repositories {
mavenCentral()
repositories{
mavenCentral()
jcenter()
maven {
url "https://maven.google.com"
maven{
url "https://maven.google.com"
}
}
dependencies {
dependencies{
implementation project(":core")
implementation project(":net")
@@ -46,14 +46,14 @@ task deploy(type: Copy){
from "build/outputs/apk/release/android-release.apk"
into "../deploy/"
rename ("android-release.apk", appName + "-android-" + getVersionString() + ".apk")
rename("android-release.apk", appName + "-android-" + getVersionString() + ".apk")
}
android {
android{
buildToolsVersion '28.0.3'
compileSdkVersion 28
sourceSets {
main {
sourceSets{
main{
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
@@ -65,11 +65,11 @@ android {
androidTest.setRoot('tests')
}
packagingOptions {
packagingOptions{
exclude 'META-INF/robovm/ios/robovm.xml'
}
defaultConfig {
defaultConfig{
def vfile = file('../core/assets/version.properties')
def code = 0
@@ -93,16 +93,16 @@ android {
versionName versionNameResult
}
compileOptions {
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "google"
signingConfigs {
release {
if(project.hasProperty("RELEASE_STORE_FILE")) {
signingConfigs{
release{
if(project.hasProperty("RELEASE_STORE_FILE")){
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
@@ -113,8 +113,8 @@ android {
}
}
buildTypes {
release {
buildTypes{
release{
signingConfig signingConfigs.release
}
}
@@ -122,22 +122,22 @@ android {
// 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.
task copyAndroidNatives() {
task copyAndroidNatives(){
file("libs/armeabi/").mkdirs()
file("libs/armeabi-v7a/").mkdirs()
file("libs/arm64-v8a/").mkdirs()
file("libs/x86_64/").mkdirs()
file("libs/x86/").mkdirs()
configurations.natives.files.each { jar ->
configurations.natives.files.each{ jar ->
def outputDir = null
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
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 {
if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
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"
@@ -146,21 +146,21 @@ task copyAndroidNatives() {
}
}
task run(type: Exec) {
task run(type: Exec){
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
if(localProperties.exists()){
Properties properties = new Properties()
localProperties.withInputStream { instr ->
localProperties.withInputStream{ instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
if(sdkDir){
path = sdkDir
} else {
}else{
path = "$System.env.ANDROID_HOME"
}
} else {
}else{
path = "$System.env.ANDROID_HOME"
}
@@ -169,19 +169,19 @@ task run(type: Exec) {
}
// sets up the Android Idea project, using the old Ant based build.
idea {
module {
idea{
module{
sourceDirs += file("src")
scopes = [COMPILE: [plus: [project.configurations.compile]]]
iml {
withXml {
iml{
withXml{
def node = it.asNode()
def builder = NodeBuilder.newInstance()
builder.current = node
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
builder.component(name: "FacetManager"){
facet(type: "android", name: "Android"){
configuration{
option(name: "UPDATE_PROPERTY_FILES", value: "true")
}
}
-1
View File
@@ -9,6 +9,5 @@
#
# 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-project.txt
# Project target.
target=android-19
@@ -18,18 +18,15 @@ import io.anuke.arc.function.Consumer;
import io.anuke.arc.scene.ui.layout.Unit;
import io.anuke.arc.util.Strings;
import io.anuke.arc.util.serialization.Base64Coder;
import io.anuke.net.KryoClient;
import io.anuke.net.KryoServer;
import io.anuke.mindustry.core.Platform;
import io.anuke.mindustry.game.Saves.SaveSlot;
import io.anuke.mindustry.io.SaveIO;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.ui.dialogs.FileChooser;
import io.anuke.net.KryoClient;
import io.anuke.net.KryoServer;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;
import java.util.ArrayList;
import static io.anuke.mindustry.Vars.*;
@@ -59,7 +56,7 @@ public class AndroidLauncher extends AndroidApplication{
int len = s.length();
byte[] data = new byte[len / 2];
for(int i = 0; i < len; i += 2){
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
data[i / 2] = (byte)((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i + 1), 16));
}
String result = new String(Base64Coder.encode(data));
@@ -184,7 +181,7 @@ public class AndroidLauncher extends AndroidApplication{
}
private boolean isTablet(Context context){
TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
return manager != null && manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE;
}
}