• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1ext {
2    GROUPID = "com.badlogicgames.gdx"
3    VERSION = "1.9.3-SNAPSHOT"
4    gdxVersion = VERSION
5    robovmVersion = "1.9.0"
6    moeVersion = "1.0.0"
7    androidVersion = "4.4"
8    gwtVersion = "2.6.0"
9    jglfwVersion = "1.1"
10    lwjglVersion = "2.9.2"
11    lwjgl3Version = "3.0.0b"
12    jlayerVersion = "1.0.1-gdx"
13    jorbisVersion = "0.0.17"
14    junitVersion = "4.11"
15    appleExtensionVersion = "1.4"
16}
17
18buildscript {
19    repositories {
20        mavenCentral()
21        jcenter()
22    }
23
24    dependencies {
25        classpath "com.android.tools.build:gradle:1.2.3"
26        classpath "org.robovm:robovm-gradle-plugin:1.5.0"
27        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
28    }
29}
30
31// apply the following to all projects, except the
32// Android test project, that one has its own
33// build.gradle file cause Android is special...
34configure(allprojects - project(':tests:gdx-tests-android')) {
35    apply plugin: "eclipse"
36    apply plugin: "idea"
37    apply plugin: "java"
38
39    compileJava.options.encoding = 'UTF-8';
40
41    repositories {
42        mavenLocal()
43        mavenCentral()
44        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
45    }
46
47    group = GROUPID
48    version = VERSION
49
50    // set source Java version
51    sourceCompatibility = 1.6
52    targetCompatibility = 1.6
53    sourceSets.main.java.srcDirs = ["src"]
54    sourceSets.main.resources.srcDirs = ["src"]
55
56    // create a custom configuration for local dependencies such as Android runtime
57    configurations {
58        optional
59        compile.extendsFrom optional
60    }
61}
62
63project(":gdx") {
64
65    sourceSets.test.java.srcDirs = ["test"]
66
67    dependencies {
68        optional project(":extensions:gdx-jnigen")
69        testCompile "junit:junit:$junitVersion"
70    }
71}
72
73project(":backends:gdx-backend-android") {
74    dependencies {
75        compile project(":gdx")
76        optional fileTree(dir: 'libs', include: ['*.jar'])
77    }
78}
79
80project(":backends:gdx-backend-headless") {
81    dependencies { compile project(":gdx") }
82}
83
84project(":backends:gdx-backend-jglfw") {
85    dependencies {
86        compile project(":gdx")
87        compile "com.badlogicgames.jglfw:jglfw:$jglfwVersion"
88        compile "com.badlogicgames.jglfw:jglfw-platform:$jglfwVersion:natives-desktop"
89    }
90}
91
92project(":backends:gdx-backend-lwjgl") {
93    dependencies {
94        compile project(":gdx")
95        compile "org.lwjgl.lwjgl:lwjgl:$lwjglVersion"
96        compile "org.lwjgl.lwjgl:lwjgl_util:$lwjglVersion"
97        compile "com.badlogicgames.jlayer:jlayer:$jlayerVersion"
98        compile "org.jcraft:jorbis:$jorbisVersion"
99    }
100}
101
102project(":backends:gdx-backend-lwjgl3") {
103    dependencies {
104        compile project(":gdx")
105        compile "org.lwjgl:lwjgl:$lwjgl3Version"
106        compile "org.lwjgl:lwjgl-platform:$lwjgl3Version:natives-linux"
107        compile "org.lwjgl:lwjgl-platform:$lwjgl3Version:natives-windows"
108        compile "org.lwjgl:lwjgl-platform:$lwjgl3Version:natives-osx"
109        compile "com.apple:AppleJavaExtensions:$appleExtensionVersion"
110        compile "com.badlogicgames.jlayer:jlayer:$jlayerVersion"
111        compile "org.jcraft:jorbis:$jorbisVersion"
112    }
113}
114
115project(":backends:gdx-backend-robovm") {
116    dependencies {
117        compile project(":gdx")
118        optional "org.robovm:robovm-rt:$robovmVersion"
119        optional "org.robovm:robovm-objc:$robovmVersion"
120        optional "org.robovm:robovm-cocoatouch:$robovmVersion"
121    }
122}
123
124project(":backends:gdx-backend-moe") {
125    dependencies {
126        compile project(":gdx")
127        optional fileTree(dir: 'libs', include: ['*.jar'])
128    }
129}
130
131project(":backends:gdx-backends-gwt") {
132    sourceSets.main.java.exclude "**/System.java"
133
134    dependencies {
135        compile project(":gdx")
136        optional "com.google.gwt:gwt-user:$gwtVersion"
137        optional "com.google.gwt:gwt-dev:$gwtVersion"
138    }
139
140    eclipse {
141        sourceSets.main.java.srcDirs "src", "src/com/badlogic/gdx/backends/gwt/emu"
142        classpath.file.whenMerged { classpath ->
143            classpath.entries.find { it.path == 'src' }*.excludes = [
144                    "com/badlogic/gdx/backends/gwt/emu/"]
145        }
146    }
147}
148
149project(":extensions:gdx-box2d:gdx-box2d") {
150    dependencies {
151        compile project(":gdx")
152        optional project(":extensions:gdx-jnigen")
153    }
154}
155
156project(":extensions:gdx-box2d:gdx-box2d-gwt") {
157    dependencies { compile project(":gdx") }
158
159    eclipse {
160        sourceSets.main.java.srcDirs "src", "src/com/badlogic/gdx/physics/box2d/gwt/emu"
161        classpath.file.whenMerged { classpath ->
162            classpath.entries.find { it.path == 'src' }*.excludes = [
163                    "com/badlogic/gdx/physics/box2d/gwt/emu/"
164            ]
165        }
166    }
167}
168
169project(":extensions:gdx-bullet") {
170    sourceSets.main.java.srcDirs = [
171            "jni/swig-src/collision",
172            "jni/swig-src/dynamics",
173            "jni/swig-src/extras",
174            "jni/swig-src/linearmath",
175            "jni/swig-src/softbody",
176            "src"
177    ]
178
179    dependencies {
180        compile project(":gdx")
181        optional project(":extensions:gdx-jnigen")
182    }
183}
184
185project(":extensions:gdx-controllers:gdx-controllers") {
186    dependencies { compile project(":gdx"); }
187}
188
189project(":extensions:gdx-controllers:gdx-controllers-android") {
190    dependencies {
191        compile project(":gdx");
192        compile project(":extensions:gdx-controllers:gdx-controllers");
193        compile project(":backends:gdx-backend-android");
194    }
195}
196
197project(":extensions:gdx-controllers:gdx-controllers-desktop") {
198    dependencies {
199        compile project(":gdx");
200        compile project(":extensions:gdx-controllers:gdx-controllers");
201        compile project(":backends:gdx-backend-lwjgl");
202        optional project(":extensions:gdx-jnigen")
203    }
204}
205
206project(":extensions:gdx-controllers:gdx-controllers-lwjgl3") {
207    dependencies {
208        compile project(":gdx");
209        compile project(":extensions:gdx-controllers:gdx-controllers");
210        compile project(":backends:gdx-backend-lwjgl3");
211        optional project(":extensions:gdx-jnigen")
212    }
213}
214
215project(":extensions:gdx-controllers:gdx-controllers-gwt") {
216    dependencies {
217        compile project(":gdx");
218        compile project(":extensions:gdx-controllers:gdx-controllers");
219        compile project(":backends:gdx-backends-gwt");
220    }
221
222    eclipse {
223        sourceSets.main.java.srcDirs "src", "src/com/badlogic/gdx/controllers/gwt/emu"
224        classpath.file.whenMerged { classpath ->
225            classpath.entries.find { it.path == 'src' }*.excludes = [
226                    "com/badlogic/gdx/controllers/gwt/emu/"
227            ]
228        }
229    }
230}
231
232project(":extensions:gdx-freetype") {
233    dependencies { compile project(":gdx"); }
234}
235
236project(":extensions:gdx-jnigen") {
237    dependencies { compile "com.github.javaparser:javaparser-core:2.3.0" }
238}
239
240project(":extensions:gdx-setup") {
241}
242
243
244project(":extensions:gdx-tools") {
245    dependencies {
246        compile files("../../gdx/libs/gdx-natives.jar")
247        compile files("../../extensions/gdx-freetype/libs/gdx-freetype-natives.jar")
248        compile project(":backends:gdx-backend-lwjgl")
249        compile project(":backends:gdx-backend-headless")
250        compile project(":extensions:gdx-freetype")
251        optional fileTree(dir: 'libs', include: ['*.jar'])
252    }
253}
254
255project(":tests:gdx-tests") {
256    dependencies {
257        compile project(":gdx")
258        compile project(":extensions:gdx-box2d:gdx-box2d")
259        compile project(":extensions:gdx-bullet")
260        compile project(":extensions:gdx-controllers:gdx-controllers")
261        compile project(":extensions:gdx-freetype")
262    }
263}
264
265project(":tests:gdx-tests-android") {
266    apply plugin: "eclipse"
267    apply plugin: "idea"
268    apply plugin: "android"
269
270    dependencies {
271        compile project(":tests:gdx-tests")
272        compile project(":backends:gdx-backend-android")
273        compile "com.android.support:support-v4:+"
274    }
275}
276
277project(":tests:gdx-tests-gwt") {
278    apply plugin: "gwt"
279    apply plugin: "war"
280    dependencies {
281        compile project(":tests:gdx-tests")
282        compile project(":backends:gdx-backends-gwt")
283        compile project(":extensions:gdx-box2d:gdx-box2d-gwt")
284        compile project(":extensions:gdx-controllers:gdx-controllers-gwt")
285    }
286}
287
288project(":tests:gdx-tests-iosrobovm") {
289    dependencies {
290        compile project(":tests:gdx-tests")
291        compile project(":backends:gdx-backend-robovm")
292    }
293
294    eclipse.project {
295        natures 'org.robovm.eclipse.RoboVMNature'
296    }
297}
298
299project("tests:gdx-tests-ios-intel") {
300    dependencies {
301        compile project(":tests:gdx-tests")
302        //compile project(":backends:gdx-backend-moe")
303        compile "com.badlogicgames.gdx:gdx-backend-moe:$gdxVersion"
304        //natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
305    }
306
307    eclipse.project {
308        natures 'org.robovm.eclipse.RoboVMNature'
309    }
310}
311
312project(":tests:gdx-tests-jglfw") {
313    dependencies {
314        compile project(":tests:gdx-tests")
315        compile project(":backends:gdx-backend-jglfw")
316        compile files("../../gdx/libs/gdx-natives.jar")
317        compile files("../../backends/gdx-backend-jglfw/libs/gdx-backend-jglfw-natives.jar")
318        compile files("../../extensions/gdx-box2d/gdx-box2d/libs/gdx-box2d-natives.jar")
319        compile files("../../extensions/gdx-bullet/libs/gdx-bullet-natives.jar")
320        compile files("../../extensions/gdx-controllers/gdx-controllers-desktop/libs/gdx-controllers-desktop-natives.jar")
321        compile project(":extensions:gdx-controllers:gdx-controllers-desktop")
322        compile files("../../extensions/gdx-freetype/libs/gdx-freetype-natives.jar")
323    }
324
325    eclipse.project.linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/gdx-tests-android/assets'
326    task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
327        doLast {
328            def classpath = new XmlParser().parse(file(".classpath"))
329            new Node(classpath, "classpathentry", [kind: 'src', path: 'assets']);
330            def writer = new FileWriter(file(".classpath"))
331            def printer = new XmlNodePrinter(new PrintWriter(writer))
332            printer.setPreserveWhitespace(true)
333            printer.print(classpath)
334        }
335    }
336}
337
338project(":tests:gdx-tests-lwjgl") {
339    dependencies {
340        compile project(":tests:gdx-tests")
341        compile project(":backends:gdx-backend-lwjgl")
342        compile files("../../gdx/libs/gdx-natives.jar")
343        compile files("../../extensions/gdx-box2d/gdx-box2d/libs/gdx-box2d-natives.jar")
344        compile files("../../extensions/gdx-bullet/libs/gdx-bullet-natives.jar")
345        compile files("../../extensions/gdx-controllers/gdx-controllers-desktop/libs/gdx-controllers-desktop-natives.jar")
346        compile project(":extensions:gdx-controllers:gdx-controllers-desktop")
347        compile files("../../extensions/gdx-freetype/libs/gdx-freetype-natives.jar")
348    }
349
350    eclipse.project.linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/gdx-tests-android/assets'
351    task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
352        doLast {
353            def classpath = new XmlParser().parse(file(".classpath"))
354            new Node(classpath, "classpathentry", [kind: 'src', path: 'assets']);
355            def writer = new FileWriter(file(".classpath"))
356            def printer = new XmlNodePrinter(new PrintWriter(writer))
357            printer.setPreserveWhitespace(true)
358            printer.print(classpath)
359        }
360    }
361}
362
363project(":tests:gdx-tests-lwjgl3") {
364    dependencies {
365        compile project(":tests:gdx-tests")
366        compile project(":backends:gdx-backend-lwjgl3")
367        compile files("../../gdx/libs/gdx-natives.jar")
368        compile files("../../extensions/gdx-box2d/gdx-box2d/libs/gdx-box2d-natives.jar")
369        compile files("../../extensions/gdx-bullet/libs/gdx-bullet-natives.jar")
370        compile files("../../extensions/gdx-controllers/gdx-controllers-lwjgl3/libs/gdx-controllers-desktop-natives.jar")
371        compile project(":extensions:gdx-controllers:gdx-controllers-lwjgl3")
372        compile files("../../extensions/gdx-freetype/libs/gdx-freetype-natives.jar")
373    }
374
375    eclipse.project.linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/gdx-tests-android/assets'
376    task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
377        doLast {
378            def classpath = new XmlParser().parse(file(".classpath"))
379            new Node(classpath, "classpathentry", [kind: 'src', path: 'assets']);
380            def writer = new FileWriter(file(".classpath"))
381            def printer = new XmlNodePrinter(new PrintWriter(writer))
382            printer.setPreserveWhitespace(true)
383            printer.print(classpath)
384        }
385    }
386}
387
388if (JavaVersion.current().isJava8Compatible()) {
389    allprojects {
390        tasks.withType(Javadoc) {
391            options.addStringOption("Xdoclint:none", "-quiet")
392        }
393    }
394}
395
396task fetchNatives << {
397    ant.importBuild "fetch.xml"
398    fetch.execute()
399    copy.execute()
400}
401