Code Monkey home page Code Monkey logo

libgdx-sbt-project.g8's People

Contributors

aginiewicz avatar theshortcut avatar tlazaro avatar willyfrog avatar yhslai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libgdx-sbt-project.g8's Issues

Prepare Typesafe Activator template?

Typesafe Activator is now (since version 0.2.x released at Scala Days 2013) accepting templates - http://typesafe.com/activator/template/contribute - unfortunately, they are using their own format.

Maybe create a branch for it? While g8 is more lightweight solution (and thus lots of people will prefer it instead of Activator, including me - it's few MB vs 200MB), Activator is promoted by Typesafe so will most likely be turning into the standard way to create templates that are easy to setup without root access on all platforms (only issue - it is big, but who knows, maybe soon there will be lite version?) - with bundled documentation/tutorials.

I believe that as it is technically possible now, we should at least try to see how much work is needed to get libgdx template into Typesafe Activator - it would give it really big recognition! It will have less features (Activator templates are simpler, seems there is no parametrization?) and requires some directory reordering (it does not promote ./src/{main,test}/{java,scala} but ./{app,test} instead). Fortunately build is based on sbt, so after some reordering simple project with all-default parameters might work just OK.

It might turn out, that it isn't feasible for project like libgdx at all, but one cannot be sure before more research into the topic.

idea: simplify adding macros

Macros are new feature of Scala 2.10.x, and they are very very useful on Android. Thanks to macros I was able to create game entity system that was 100% type safe, managers were independent on components and it did not use reflection, or needed lot of writing.

I propose adding two projects on top of common - engine and macros. Engine can then contain game independent code (and we all have some!), macros can contain well, macros, and common the game itself. With desktop/android/ios containing platform specific parts.

Why split into extra engine and macros? Because:

  • macros needs to be compiled before they can be used, so they need to be above common
  • macros require reflection at compile time, so we do not want to depend on it directly, we need it as provided dependency (used at run-time, but not included)
  • macros generate code so they need access to some parts of game code, which common needs access too - this common code can be well defined as engine.

That way macros and common depend on engine, but engine has macros as only provided dependency.

Why I propose including this change in libgdx-sbt-project? Because it needs some modifications and configuration:

  • adding extra projects and correct dependencies (provided dependency vs dependency)
  • changing update-gdx to extract files into engine instead of common

and it isn't obvious what needs to be done at first. I've already tested such setup in my projects and it works like a charm, so if we decide to include it (and after merge of sbt-android 0.7) I will prepare pull request with those changes.

Changes in libgdx distribution, need better extraction mechanics

Recently distribution of libgdx files changed. There are two important things:

  • there are now Android x86 .so files. While x86 is rare on real devices, x86 based emulator works very efficiently (still not sure if it runs though, it isn't that important), but...
  • there is no more libandroidgl20.so file, which is copied "by name" in build.sbt

While first change can be ignored for the time being (there is still no gdx-audio on x86), second one I think will break update-gdx for nightlies when first one with this change will be uploaded. Unfortunately simple remove of this file, will break stable releases, so I think better extraction mechanics is needed.

source: http://www.badlogicgames.com/wordpress/?p=3103

Lower the barrier to entry, especially for non Scala users.

Right now you have to install Conscript, then giter8, then sbt, (not to mention git must also be installed,) and then run a command you might not quite understand the semantics of, just to get an empty project. It would be nice if someone could just download a script and run it. This is especially important when you are trying to convince a client that Scala would be a more efficient choice for game development.

I'd like to use the play framework's 'play' command as inspiration.

Bring back iOS support

After fixing:

in #79 for Android and Desktop - I removed iOS due to some issues (see comments in pull request).

I'm opening this ticket to close above three and make statistics of open tickets look better :)

idea: move non-working iOS stuff into branch

I'd say that it would be good to move all iOS stuff into separate branch, before it is ready for release - and afaik it does not work (there is one issue about it) nor is plugged into any sbt project.

For people who wants to work on it, there is no problem, because g8 has support to pull a branch directly.

HTML5 Support

I was wondering what it would take to enable HTML5 support for this project, or if that is even possible.

Remove testing frameworks from template

They are not essential for games, and there are multiple alternatives, specially for mocking. How do you think? If you agree, I can make pull request for it.

Try out 2.11.0-m5 with the template.

Scala 2.11 has many improvements, but the most salient for the mobile use is the splitting up of the standard library. Proguard takes care of most of the bulk, but if nothing else it should speed up processing time on Android and iOS.

Add Wiki page about AndroidManifest.xml

Mostly motivated by this change:

libgdx/libgdx#1079

We might add comment like "remove this for Libgdx 1.0-SNAPSHOT", but it will increase file size. To not create multiple versions of file or branches of template, I think adding such information to Wiki will be best.

Idea: Add RoboVM iOS support.

The sbt interface for the functionality should mirror sbt android support. RoboVM files are already in libgdx nightlies and can easily be extracted like all the other library files.

Explore pushing the moving parts into a libgdx-sbt plugin

It would be nice if the bulk of features could be pushed into a plugin that this template relies on. The benefits would be that 1) your project could get updates without having to regenerate from the template and 2) your project could use either a stable version or a snapshot version of the plugin.

This would probably require work on other issues such as using a properties class for configuration, but I don't see any problems otherwise (yet).

idea: switch to sbt-proguard from sbt-assembly for building desktop jar

sbt-assembly "just works", but creates huge jar files, even for simple projects - it's like 16mb vs 1mb on android. I think that we could switch to sbt-proguard for it. IIRC there was comment on iOS ticket, that proguard will be useful there as well.

If we switch to sbt-proguard and do some tweaking to proguard config files handling, we will be able to share some configuration between desktop/ios/android - i.e. for desktop we could merge config from common and desktop, for android from common and android, and so on... if we put all scala related stuff in there, and all android related stuff into android project, it should be quite easy to just concatenate two config files.

Sadly, I believe we won't be able to use sbt-android bundled proguard, it seems to be too closely tied into android project and build process to use separately, unless I'm mistaken.

Not to use nightlies and to use "latest" version cannot resolve libgdx zip file url.

Related to #21, answering questions as below and doing update-gdx occurs FileNotFoundExceptions since this tries to get a zip from http://libgdx.googlecode.com/files/libgdx-latest.zip which does not exist.

libgdx_use_nightlies [true]: false
libgdx_version [latest]: latest

I think it should check latest libgdx version number and put it as libgdx-version if a user answers as shown above. I'm prepared to send a pull request to fix this.


ErrorLog

update-gdx
[info] Pulling libgdx-latest
[warn] This may take a few minutes...
[trace] Stack trace suppressed: run last all-platforms/*:update-gdx for the full output.
error Error opening http://libgdx.googlecode.com/files/libgdx-latest.zip: java.io.FileNotFoundException: http://libgdx.googlecode.com/files/libgdx-latest.zip
[error] Total time: 2 s, completed 2013/06/10 1:14:50

Update sbt-android to version 0.7

There is new version of sbt-android. We should update to it as soon as possible, because all work (including the exclusion of files from jars) is being done there.

I've tried to update it in https://github.com/aginiewicz/libgdx-sbt-project.g8/tree/sbtandroid-0.7.x but failed - plugin knows where to look for android.jar (libraryJarPath is correct), but does not include it (providedClasspath is empty). I have no idea why, because it looks OK to me, maybe it is because our main project isn't android project, but aggregate of desktop and android projects, but it's just wild guess.

I've just asked about it on scala-on-android mailing list, will see what people with more experience in sbt-android will say.

sbt assembly fails on Mac OS

Trying to do sbt assembly.
It does not find /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/rt.jar because that isn't there. I read that this file is called classes and sits in a different folder on OS X. So I made a link:

cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib
sudo ln /System/Library/Frameworks/JavaVM.framework/Classes/classes.jar rt.jar

Then, I always get:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space [error] at java.util.Arrays.copyOfRange(Arrays.java:3209)

I made an ~/.sbtconfig like this:
SBT_OPTS="-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:PermSize=2048M -XX:MaxPermSize=4096M"

No luck, though.

Add Java 8 Support

[error] java.io.IOException: Can't read [/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar](Can't process class [com/oracle/net/Sdp$1.class] %28Unsupported class version number [52.0] %28maximum 51.0, Java 1.7%29%29)
[error] at proguard.InputReader.readInput(InputReader.java:232)
[error] at proguard.InputReader.readInput(InputReader.java:202)
[error] at proguard.InputReader.readInput(InputReader.java:180)
[error] at proguard.InputReader.execute(InputReader.java:100)
[error] at proguard.ProGuard.readInput(ProGuard.java:196)
[error] at proguard.ProGuard.execute(ProGuard.java:78)
[error] at proguard.ProGuard.main(ProGuard.java:483)
[error] Caused by: java.io.IOException: Can't process class [com/oracle/net/Sdp$1.class](Unsupported class version number [52.0] %28maximum 51.0, Java 1.7%29)
[error] at proguard.io.ClassReader.read(ClassReader.java:112)
[error] at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
[error] at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
[error] at proguard.io.JarReader.read(JarReader.java:65)
[error] at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)
[error] at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)
[error] at proguard.InputReader.readInput(InputReader.java:228)
[error] ... 6 more
[error] Caused by: java.lang.UnsupportedOperationException: Unsupported class version number [52.0](maximum 51.0, Java 1.7)
[error] at proguard.classfile.util.ClassUtil.checkVersionNumbers(ClassUtil.java:140)
[error] at proguard.classfile.io.LibraryClassReader.visitLibraryClass(LibraryClassReader.java:89)
[error] at proguard.classfile.LibraryClass.accept(LibraryClass.java:301)
[error] at proguard.io.ClassReader.read(ClassReader.java:86)
[error] ... 12 more

apk contains unnecessary files (GWT backend xml files, fonts even if not used, ...)

I don't know yet how much of this is from how libgdx-sbt is set up with it's multi-project approach, and how much is from android-sbt plugin or can be configured, but I think it is very important to deal with it. I've built simple app that displays text message from txt file in assets directory, this is what files I got:

./com/esotericsoftware/TableLayout.gwt.xml
./com/badlogic/gdx/graphics/g3d/shaders/default.fragment.glsl
./com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl
./com/badlogic/gdx/utils/arial-15.fnt
./com/badlogic/gdx/utils/arial-15.png
./com/badlogic/gdx.gwt.xml
./lib/armeabi-v7a/libgdx.so
./lib/armeabi-v7a/libandroidgl20.so
./lib/armeabi/libgdx.so
./lib/armeabi/libandroidgl20.so
./AndroidManifest.xml
./message.txt
./library.properties
./assets/message.txt
./META-INF/MANIFEST.MF
./META-INF/CERT.RSA
./META-INF/CERT.SF
./classes.dex
./rootdoc.txt
./resources.arsc

from those, following files are most likely not needed:

./com/esotericsoftware/TableLayout.gwt.xml
./com/badlogic/gdx.gwt.xml
./message.txt
./rootdoc.txt

first, I noticed one file from Scala, "./rootdoc.txt" that I believe shouldn't be there (turns out, the "./library.properties" is needed). Then all files from inside assets are copied also to root directory ("./message.txt" + "./assets/message.txt" in this case). There are also some files in "./com" directory. Now with those, while font and shaders are I believe needed, the xml files come from GWT backend, and should be stripped. It should be checked which files from those are actually needed, and find a way to remove what isn't (especially the duplicate resources, space is extremely important on phones, and assets is biggest directory out there!).

ClassNotFoundException

Hi, I am trying to use your template but I am stuck with the ClassNotFoundException. It seems that it is not adding the android-backend jar to the classes.min.jar. Any suggestions ? I am using sbt 0.11 with the android-plugin from 0.11 branch

The Logcat output:

D/AndroidRuntime( 2472): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 2472): CheckJNI is ON
D/AndroidRuntime( 2472): --- registering native functions ---
I/jdwp ( 2472): Ignoring second debugger -- accepting and dropping
I/ethernet( 2472): Loading ethernet jni class
I/ActivityManager( 2031): Starting activity: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=my.game.pkg/.Main }
D/AndroidRuntime( 2472): Shutting down VM
I/ActivityManager( 2031): Start proc my.game.pkg for activity my.game.pkg/.Main: pid=2478 uid=10051 gids={}
D/dalvikvm( 2472): Debugger has detached; object registry had 1 entries
I/AndroidRuntime( 2472): NOTE: attach of thread 'Binder Thread #3' failed
I/jdwp ( 2478): Ignoring second debugger -- accepting and dropping
I/UsageStats( 2031): Unexpected resume of my.game.pkg while already resumed in com.android.launcher
W/dalvikvm( 2478): Unable to resolve superclass of Lmy/game/pkg/Main; (10)
W/dalvikvm( 2478): Link of class 'Lmy/game/pkg/Main;' failed
D/AndroidRuntime( 2478): Shutting down VM
W/dalvikvm( 2478): threadid=1: thread exiting with uncaught exception (group=0xb58f6290)
E/AndroidRuntime( 2478): FATAL EXCEPTION: main
E/AndroidRuntime( 2478): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{my.game.pkg/my.game.pkg.Main}: java.lang.ClassNotFoundException: my.game.pkg.Main in loader dalvik.system.PathClassLoader[/data/app/my.game.pkg-1.apk]
E/AndroidRuntime( 2478): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
E/AndroidRuntime( 2478): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime( 2478): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime( 2478): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 2478): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2478): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2478): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 2478): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2478): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2478): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 2478): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 2478): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2478): Caused by: java.lang.ClassNotFoundException: my.game.pkg.Main in loader dalvik.system.PathClassLoader[/data/app/my.game.pkg-1.apk]
E/AndroidRuntime( 2478): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime( 2478): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime( 2478): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime( 2478): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 2478): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
E/AndroidRuntime( 2478): ... 11 more
I/Process ( 2478): Sending signal. PID: 2478 SIG: 9
W/ActivityManager( 2031): Force finishing activity my.game.pkg/.Main
I/ActivityManager( 2031): Process my.game.pkg (pid 2478) has died.
I/UsageStats( 2031): Something wrong here, didn't expect com.android.launcher to be paused

Using "sbt assembly" fails to load atlas

I'm having a very strange issue with the assembly task and a project I generated with this plugin. The game project can load a TextureAtlas just fine with sbt desktop/run, but if I generate with sbt assembly and run the jar, it can't parse the atlas. Here is the output of sbt assembly, here is the runtime error. I'm running on Windows 7 64-bit, libgdx is version 1.2.0, sbt and g8 are installed as this project's README describes, and my project is here https://github.com/tommyettinger/CommandersUnite . I needed to tweak the generated IntelliJ IDEA projects; I didn't really understand how they worked at the time, and I doubt I could exactly reproduce the steps I took. Still, all the files in the .idea project are present on my project's repo (except for workspace.xml, which updates whenever you scroll in a file, so it pollutes git). The issue is present using sbt alone, so the IntelliJ stuff shouldn't matter, but I don't know how this generator works. I needed to tweak the android/assets/ folder to be visible from desktop in IntelliJ, and I don't know if that propagated into the SBT project. Any help would be appreciated; I'm hoping this will be a quick fix that can be applied retroactively to my game, but I'm fully willing to re-generate the project.

IntelliJ IDEA integration - incorrect source root directory

Hi,

After generating IDEA project files it turns out that android/src directory is marked as Source Root instead of android/src/main/scala. I tried to fix it with adding

scalaSource in Compile := baseDirectory.value / "src/main/scala/"
scalaSource in Test := baseDirectory.value / "src/test/scala/"

to Settings.android in build.scala - but for some reason it didn't work.

Tbh I'm not sure whether this is a template issue or rather android-sdk-plugin problem (feel free to close this issue if so).
Sorry if this is something obvious - I'm a newcomer to scala/sbt world :)

Regards

Check out official gradle template for Libgdx

Recently Libgdx started using gradle to create new projects (with aim to replace setup-ui iirc). The idea behind this template is very very close to what we have here. It might be good to check what settings/customisation options they have, and what is project layout - then decide if we want to reuse some of those for g8 template. The url is:

https://github.com/libgdx/libgdx-gradle-template

It doesn't seem like there is much customisation, but their project seems to work with Eclipse and Idea, so we should at least check out its layout.

Scala 2.11 compatibility

Hi there,

I tried building my prototype with Scala 2.11.0-RC4. As for iOS, I kept initial project layout and haven't modified anything from template yet. I was able to compile whole project with 2.10, but now I get:

[error] .../Main.scala:23: inferred type arguments [Nothing,com.specdevs.cctrpg.Main] do not conform to method main's type parameter bounds [P <: org.robovm.cocoatouch.uikit.UIApplication,D <: org.robovm.cocoatouch.foundation.NSObject with org.robovm.cocoatouch.uikit.UIApplicationDelegate]
[error] .../Main.scala:23: inferred type arguments [Nothing,com.specdevs.cctrpg.Main] do not conform to method main's type parameter bounds [P <: org.robovm.cocoatouch.uikit.UIApplication,D <: org.robovm.cocoatouch.foundation.NSObject with org.robovm.cocoatouch.uikit.UIApplicationDelegate]
[error]       UIApplication.main(args, null, classOf[Main])
[error]                     ^
[error] .../Main.scala:23: type mismatch;
[error]  found   : Class[com.specdevs.cctrpg.Main](classOf[com.specdevs.cctrpg.Main])
[error]  required: Class[D]
[error]       UIApplication.main(args, null, classOf[Main])
[error]                                             ^
[error] two errors found

Have you seen it before?

Build error

I'm new to sbt, and I keep getting an error when using the template/ When I try to update gdx or run desktop I get this:
[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: org.scala-sbt#sbt-android-plugin;0.7.1-SNAPSHOT: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Some unresolved dependencies have extra attributes. Check that th ese dependencies exist with the requested attributes. [warn] org.scala-sbt:sbt-android-plugin:0.7.1-SNAPSHOT (sbtVersion=0.13 , scalaVersion=2.10) [warn]

I have built the android plugin and it put it in %HOME%.ivy2 someplace, but it looks like my gdx game can't find the android plugin. Can anyone help me?

Update to Scala 2.10.2 as soon as it comes out

Because earlier versions of Scala aren't respecting compatibility constraints: Bug SI-7253 / Fix for SI-7253. Android is less tolerant about such things than JDK, so it might be occurring in lots of places (it even was spotted on Android for the first time, but it turned out to be general issue).

I'm opening this so we remember about it. Fortunately, 2.10.2 is just behind the doors. It was announced, that if no new bugs are found, recently released 2.10.2-RC2 will be identical to 2.10.2 final. And it seems, that for 4 days, no new issues were found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.