Parcourir la source

Add build files for gradle

smelc il y a 7 ans
Parent
commit
63193fd4e1
3 fichiers modifiés avec 52 ajouts et 1 suppressions
  1. 47 0
      build.gradle
  2. 2 1
      pom.xml
  3. 3 0
      settings.gradle

+ 47 - 0
build.gradle

@@ -0,0 +1,47 @@
+apply plugin: 'java'
+apply plugin: 'eclipse'
+// note from smelC: I did not add a plugin for 'idea' as I don't use it. 
+// Please add it if you do.
+
+// In this section you declare where to find the dependencies of your project
+repositories {
+    // Use 'jcenter' for resolving your dependencies.
+    // You can declare any Maven/Ivy/file repository here.
+    jcenter()
+}
+
+sourceSets {
+    main {
+        java {
+            srcDirs 'squidlib/src/main/java'
+            srcDirs 'squidlib-util/src/main/java'
+            srcDirs 'squidlib-util/src/main/resources'
+        }
+    }
+    test {
+    	java {
+            srcDirs 'squidlib/src/test/java'
+            srcDirs 'squidlib-util/src/test/java'
+            srcDirs 'squidlib-util/src/test/resources'
+    	}
+    }
+}
+
+// define 'gdxVersion' if not defined yet. This allows
+// a project depending on SquidLib (like: your game) to define
+// 'gdxVersion' itself, and yet be able to build SquidLib standalone too.
+def gdxVersion = System.getenv("gdxVersion") ?: "1.9.3" // As in pom.xml
+
+// In this section you declare the dependencies for your production and test code
+dependencies {
+	compile "com.badlogicgames.gdx:gdx:$gdxVersion"
+	// note from smelC: the following two lines may mean that any build depending on SquidLib
+	// will include the desktop jars, which is irrelevant if doing a GWT one.
+	// I'll update that once I test GWT again on Dungeon Mercenary.
+	compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
+	compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
+
+	compile project(":RegExodus")
+
+	testCompile 'junit:junit:4.12'
+}

+ 2 - 1
pom.xml

@@ -64,6 +64,7 @@
         <findbugs.version>3.0.2</findbugs.version>
         <cobertura.version>2.7</cobertura.version>
         <jdk.version>1.7</jdk.version>
+	<!-- As in build.gradle -->
         <gdx.version>1.9.3</gdx.version>
         <junit.version>4.11</junit.version>
         <regexodus.version>0.1.7</regexodus.version>
@@ -252,4 +253,4 @@
         </plugins>
     </reporting>
 
-</project>
+</project>

+ 3 - 0
settings.gradle

@@ -0,0 +1,3 @@
+include 'RegExodus'
+// This means RegExodus must be in a sibling directory
+project(':RegExodus').projectDir = new File('../RegExodus')