Add template

This commit is contained in:
oakes
2014-01-18 20:15:29 -05:00
parent 6bfbdce2c7
commit f5860b976b
17 changed files with 337 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package {{package}};
import clojure.lang.RT;
import clojure.lang.Symbol;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.Game;
public class {{android-class-name}} extends AndroidApplication {
public void onCreate (android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RT.var("clojure.core", "require").invoke(Symbol.intern("{{namespace}}"));
try {
Game game = (Game) RT.var("{{namespace}}", "{{app-name}}").deref();
initialize(game, true);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,31 @@
package {{package}};
import clojure.lang.RT;
import clojure.lang.Symbol;
import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
import com.badlogic.gdx.Game;
import org.robovm.cocoatouch.foundation.NSAutoreleasePool;
import org.robovm.cocoatouch.uikit.UIApplication;
public class {{ios-class-name}} extends IOSApplication.Delegate {
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
RT.var("clojure.core", "require").invoke(Symbol.intern("{{namespace}}"));
try {
Game game = (Game) RT.var("{{namespace}}", "{{app-name}}").deref();
return new IOSApplication(game, config);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static void main(String[] argv) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(argv, null, {{ios-class-name}}.class);
pool.drain();
}
}

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>{{app-name}}</string>
<key>CFBundleExecutable</key>
<string>{{app-name}}</string>
<key>CFBundleIdentifier</key>
<string>{{package}}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>{{app-name}}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${app.version}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon</string>
<string>Icon-72</string>
</array>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,11 @@
# {{name}}
A LibGDX game in which ... well, that part is up to you.
## Contents
* `android/src` Android-specific code
* `desktop/resources` Images, audio, and other files
* `desktop/src` Desktop-specific code
* `desktop/src-common` Cross-platform game code
* `ios/src` iOS-specific code

View File

@@ -0,0 +1,37 @@
(defproject {{app-name}} "0.0.1-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[com.badlogicgames.gdx/gdx "0.9.9" :use-resources true]
[com.badlogicgames.gdx/gdx-backend-android "0.9.9"]
[neko/neko "3.0.0"]
[org.clojure-android/clojure "1.5.1-jb" :use-resources true]
[play-clj "0.1.0-SNAPSHOT"]]
:repositories [["sonatype"
"https://oss.sonatype.org/content/repositories/snapshots/"]]
:profiles {:dev {:dependencies [[android/tools.nrepl "0.2.0-bigstack"]
[compliment "0.0.3"]]
:android {:aot :all-with-unused}}
:release {:android
{;; Specify the path to your private
;; keystore and the the alias of the
;; key you want to sign APKs with.
;; :keystore-path "/home/user/.android/private.keystore"
;; :key-alias "mykeyalias"
:aot :all}}}
:android {;; Specify the path to the Android SDK directory either
;; here or in your ~/.lein/profiles.clj file.
;; :sdk-path "/home/user/path/to/android-sdk/"
;; Uncomment this if dexer fails with OutOfMemoryException
;; :force-dex-optimize true
:assets-path "../desktop/resources"
:native-libraries-paths ["libs"]
:target-version "{{target-sdk}}"
:aot-exclude-ns ["clojure.parallel" "clojure.core.reducers"]
:dex-opts ["-JXmx2048M"]}
:source-paths ["src/clojure" "../desktop/src-common"]
:java-source-paths ["src/java" "gen"]
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"])

View File

@@ -0,0 +1,18 @@
(ns {{namespace}}
(:require [play-clj.core :refer :all]
[play-clj.ui :refer :all]))
(defscreen main-screen
:on-show
(fn [screen entities]
(update! screen :renderer (stage))
(conj entities (label "Hello world!" (color :white))))
:on-render
(fn [screen entities]
(clear!)
(render! screen entities)))
(defgame {{app-name}}
:on-create
(fn [this]
(set-screen! this main-screen)))

View File

@@ -0,0 +1,10 @@
(ns {{desktop-namespace}}
(:require [{{namespace}} :refer :all])
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
[org.lwjgl.input Keyboard])
(:gen-class))
(defn -main
[]
(LwjglApplication. {{app-name}} "{{app-name}}" 800 600 true)
(Keyboard/enableRepeatEvents true))

View File

@@ -0,0 +1,16 @@
(defproject {{app-name}} "0.0.1-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[com.badlogicgames.gdx/gdx "0.9.9"]
[com.badlogicgames.gdx/gdx-backend-lwjgl "0.9.9"]
[com.badlogicgames.gdx/gdx-platform "0.9.9"
:classifier "natives-desktop"]
[org.clojure/clojure "1.5.1"]
[play-clj "0.1.0-SNAPSHOT"]]
:repositories [["sonatype"
"https://oss.sonatype.org/content/repositories/snapshots/"]]
:source-paths ["src" "src-common"]
:javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
:aot [{{desktop-namespace}}]
:main {{desktop-namespace}})

View File

@@ -0,0 +1,12 @@
/target
/lib
/classes
/checkouts
pom.xml
pom.xml.asc
*.jar
*.class
.lein-deps-sum
.lein-failures
.lein-plugins
.lein-repl-history

View File

@@ -0,0 +1,17 @@
(defproject {{app-name}} "0.0.1-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[com.badlogicgames.gdx/gdx "0.9.9"]
[com.badlogicgames.gdx/gdx-backend-robovm "0.9.9"]
[org.clojure/clojure "1.5.1"]
[play-clj "0.1.0-SNAPSHOT"]]
:repositories [["sonatype"
"https://oss.sonatype.org/content/repositories/snapshots/"]]
:source-paths ["src/clojure" "../desktop/src-common"]
:java-source-paths ["src/java"]
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
:ios {:robovm-opts ["-forcelinkclasses" "{{package-prefix}}.**:clojure.**:com.badlogic.**:play_clj.**"
"-libs" "libs/libObjectAL.a:libs/libgdx.a"
"-frameworks" "UIKit:OpenGLES:QuartzCore:CoreGraphics:OpenAL:AudioToolbox:AVFoundation"
"-resources" "../desktop/resources/**"]}
:aot :all
:main {{ios-namespace}})