build.gradle 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. apply plugin: 'java'
  2. apply plugin: 'eclipse'
  3. // note from smelC: I did not add a plugin for 'idea' as I don't use it.
  4. // Please add it if you do.
  5. // In this section you declare where to find the dependencies of your project
  6. repositories {
  7. // Use 'jcenter' for resolving your dependencies.
  8. // You can declare any Maven/Ivy/file repository here.
  9. jcenter()
  10. }
  11. project.ext.assetsDir = new File("assets");
  12. sourceSets {
  13. main {
  14. java {
  15. srcDirs 'squidlib/src/main/java'
  16. srcDirs 'squidlib-util/src/main/java'
  17. srcDirs 'squidlib-util/src/main/resources'
  18. // srcDirs 'squidlib-util/etc' <- No. Solely contains TilesetsGenerator
  19. // which isn't useful anymore.
  20. }
  21. }
  22. test {
  23. java {
  24. srcDirs 'squidlib/src/test/java'
  25. srcDirs 'squidlib-util/src/test/java'
  26. srcDirs 'squidlib-util/src/test/resources'
  27. // srcDirs 'squidlib-performance/src/main/java' <- requires org.openjdk
  28. }
  29. }
  30. }
  31. // define 'gdxVersion' if not defined yet. This allows
  32. // a project depending on SquidLib (like: your game) to define
  33. // 'gdxVersion' itself, and yet be able to build SquidLib standalone too.
  34. def gdxVersion = System.getenv("gdxVersion") ?: "1.9.6" // As in pom.xml
  35. // In this section you declare the dependencies for your production and test code
  36. dependencies {
  37. compile "com.badlogicgames.gdx:gdx:$gdxVersion"
  38. testCompile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
  39. testCompile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
  40. testCompile 'junit:junit:4.12'
  41. }
  42. // Execute with 'gradle everythingDemo' (add --info to get debug info)
  43. task(everythingDemo, type: JavaExec) {
  44. main = 'squidpony.gdx.examples.desktop.EverythingDemoLauncher'
  45. // smelC: It would be nice to automatically add the three following
  46. // lines to any 'JavaExec' task, but I could not find how to do it.
  47. classpath(sourceSets.test.runtimeClasspath,project.assetsDir)
  48. standardInput = System.in
  49. ignoreExitValue = true
  50. }