Skip to content

Commit

Permalink
Added a simple editorconfig based on default Java code style.
Browse files Browse the repository at this point in the history
Autoformatted all project files.
  • Loading branch information
scscgit committed Feb 25, 2017
1 parent 47929fc commit ee46ef4
Show file tree
Hide file tree
Showing 21 changed files with 348 additions and 338 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=true
indent_style=space
indent_size=4

[{.babelrc,.stylelintrc,.eslintrc,*.bowerrc,*.jsb3,*.jsb2,*.json}]
indent_style=space
indent_size=2

16 changes: 8 additions & 8 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sk.tuke.gamedev.iddqd.tukequest"
android:versionCode="1"
android:versionName="1.0" >
package="sk.tuke.gamedev.iddqd.tukequest"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="24" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="24"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/GdxTheme" >
android:theme="@style/GdxTheme">
<activity
android:name="sk.tuke.gamedev.iddqd.tukequest.AndroidLauncher"
android:label="@string/app_name"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<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>
</activity>
</application>
Expand Down
23 changes: 11 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ 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();
Expand All @@ -37,12 +36,12 @@ task copyAndroidNatives() {

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) {
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
Expand Down Expand Up @@ -90,8 +89,8 @@ eclipse {
}

classpath {
plusConfigurations += [ project.configurations.compile ]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
plusConfigurations += [project.configurations.compile]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}

project {
Expand All @@ -109,7 +108,7 @@ eclipse {
idea {
module {
sourceDirs += file("src");
scopes = [ COMPILE: [plus:[project.configurations.compile]]]
scopes = [COMPILE: [plus: [project.configurations.compile]]]

iml {
withXml {
Expand All @@ -119,7 +118,7 @@ idea {
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
option(name: "UPDATE_PROPERTY_FILES", value:"true")
option(name: "UPDATE_PROPERTY_FILES", value: "true")
}
}
}
Expand Down
1 change: 0 additions & 1 deletion android/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion android/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>

<style name="GdxTheme" parent="android:Theme">
<item name="android:windowBackground">@android:color/transparent</item>
<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>
Expand Down
14 changes: 6 additions & 8 deletions android/src/sk/tuke/gamedev/iddqd/tukequest/AndroidLauncher.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package sk.tuke.gamedev.iddqd.tukequest;

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame;

public class AndroidLauncher extends AndroidApplication {
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new TukeQuestGame(), config);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new TukeQuestGame(), config);
}
}
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: "java"
sourceCompatibility = 1.6
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

sourceSets.main.java.srcDirs = [ "src/" ]
sourceSets.main.java.srcDirs = ["src/"]


eclipse.project {
Expand Down
7 changes: 4 additions & 3 deletions core/src/TukeQuestGame.gwt.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN"
"http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module>
<source path="sk/tuke/gamedev/iddqd/tukequest" />
</module>
<source path="sk/tuke/gamedev/iddqd/tukequest"/>
</module>
44 changes: 22 additions & 22 deletions core/src/sk/tuke/gamedev/iddqd/tukequest/TukeQuestGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class TukeQuestGame extends ApplicationAdapter {
SpriteBatch batch;
Texture img;

@Override
public void create () {
batch = new SpriteBatch();
img = new Texture("badlogic.jpg");
}
SpriteBatch batch;
Texture img;

@Override
public void render () {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(img, 0, 0);
batch.end();
}

@Override
public void dispose () {
batch.dispose();
img.dispose();
}
@Override
public void create() {
batch = new SpriteBatch();
img = new Texture("badlogic.jpg");
}

@Override
public void render() {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(img, 0, 0);
batch.end();
}

@Override
public void dispose() {
batch.dispose();
img.dispose();
}
}
24 changes: 12 additions & 12 deletions desktop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: "java"

sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = [ "src/" ]
sourceSets.main.java.srcDirs = ["src/"]

project.ext.mainClassName = "sk.tuke.gamedev.iddqd.tukequest.desktop.DesktopLauncher"
project.ext.assetsDir = new File("../android/assets");
Expand All @@ -17,9 +17,9 @@ task run(dependsOn: classes, type: JavaExec) {
task dist(type: Jar) {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from {configurations.compile.collect {zipTree(it)}}
from { configurations.compile.collect { zipTree(it) } }
from files(project.assetsDir);

manifest {
attributes 'Main-Class': project.mainClassName
}
Expand All @@ -35,12 +35,12 @@ eclipse {
}

task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
doLast {
def classpath = new XmlParser().parse(file(".classpath"))
new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
def writer = new FileWriter(file(".classpath"))
def printer = new XmlNodePrinter(new PrintWriter(writer))
printer.setPreserveWhitespace(true)
printer.print(classpath)
}
}
doLast {
def classpath = new XmlParser().parse(file(".classpath"))
new Node(classpath, "classpathentry", [kind: 'src', path: 'assets']);
def writer = new FileWriter(file(".classpath"))
def printer = new XmlNodePrinter(new PrintWriter(writer))
printer.setPreserveWhitespace(true)
printer.print(classpath)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame;

public class DesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new TukeQuestGame(), config);
}
public static void main(String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new TukeQuestGame(), config);
}
}
Loading

0 comments on commit ee46ef4

Please sign in to comment.