-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify build files for Gradle 8, Java 17
- Loading branch information
Showing
4 changed files
with
93 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,62 @@ | ||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } | ||
google() | ||
} | ||
dependencies { | ||
} | ||
repositories { | ||
mavenCentral() | ||
maven { url 'https://s01.oss.sonatype.org' } | ||
gradlePluginPortal() | ||
mavenLocal() | ||
google() | ||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } | ||
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } | ||
} | ||
dependencies { | ||
} | ||
} | ||
|
||
allprojects { | ||
apply plugin: "eclipse" | ||
apply plugin: "idea" | ||
|
||
version = '1.0' | ||
ext { | ||
appName = "darkly" | ||
gdxVersion = '1.12.1' | ||
roboVMVersion = '2.3.12' | ||
box2DLightsVersion = '1.5' | ||
ashleyVersion = '1.7.3' | ||
aiVersion = '1.8.2' | ||
gdxControllersVersion = '2.1.0' | ||
jUnitVersion = '4.13' | ||
} | ||
apply plugin: 'idea' | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
google() | ||
gradlePluginPortal() | ||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } | ||
maven { url "https://oss.sonatype.org/content/repositories/releases/" } | ||
// This allows you to "Build and run using IntelliJ IDEA", an option in IDEA's Settings. | ||
idea { | ||
module { | ||
outputDir file('build/classes/java/main') | ||
testOutputDir file('build/classes/java/test') | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
google() | ||
gradlePluginPortal() | ||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } | ||
maven { url "https://oss.sonatype.org/content/repositories/releases/" } | ||
} | ||
} | ||
|
||
project(":desktop") { | ||
apply plugin: "java-library" | ||
|
||
configure(subprojects) { | ||
apply plugin: 'java-library' | ||
|
||
dependencies { | ||
implementation project(":core") | ||
api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" | ||
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
} | ||
|
||
project(":core") { | ||
apply plugin: "java-library" | ||
|
||
test { | ||
useJUnit() | ||
} | ||
|
||
dependencies { | ||
api "com.badlogicgames.gdx:gdx:$gdxVersion" | ||
testImplementation "junit:junit:$jUnitVersion" | ||
} | ||
compileJava { | ||
options.incremental = true | ||
} | ||
} | ||
|
||
tasks.eclipse.doLast { | ||
delete ".project" | ||
} | ||
subprojects { | ||
version = '$projectVersion' | ||
ext.appName = 'darkly' | ||
repositories { | ||
mavenCentral() | ||
maven { url 'https://s01.oss.sonatype.org' } | ||
// You may want to remove the following line if you have errors downloading dependencies. | ||
mavenLocal() | ||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } | ||
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
sourceCompatibility = 1.8 | ||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' | ||
|
||
sourceSets.main.java.srcDirs = ["src/main/java"] | ||
sourceSets.test.java.srcDirs = ["src/test/java"] | ||
test { | ||
useJUnit() | ||
} | ||
|
||
dependencies { | ||
api "com.badlogicgames.ashley:ashley:$ashleyVersion" | ||
api "com.badlogicgames.gdx:gdx:$gdxVersion" | ||
|
||
eclipse.project { | ||
name = appName + "-core" | ||
testImplementation "junit:junit:$jUnitVersion" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,48 @@ | ||
sourceCompatibility = 1.8 | ||
sourceSets.main.java.srcDirs = [ "src/" ] | ||
buildscript { | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" | ||
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" | ||
implementation project(':core') | ||
} | ||
|
||
sourceSets.main.java.srcDirs = ["src/"] | ||
sourceSets.main.resources.srcDirs = ["../core/assets"] | ||
|
||
project.ext.mainClassName = "net.gpdev.darkly.desktop.DesktopLauncher" | ||
project.ext.assetsDir = new File("../core/assets") | ||
|
||
task run(dependsOn: classes, type: JavaExec) { | ||
mainClass = project.mainClassName | ||
classpath = sourceSets.main.runtimeClasspath | ||
standardInput = System.in | ||
workingDir = project.assetsDir | ||
ignoreExitValue = true | ||
mainClass = project.mainClassName | ||
classpath = sourceSets.main.runtimeClasspath | ||
standardInput = System.in | ||
workingDir = project.assetsDir | ||
ignoreExitValue = true | ||
} | ||
|
||
task debug(dependsOn: classes, type: JavaExec) { | ||
mainClass = project.mainClassName | ||
classpath = sourceSets.main.runtimeClasspath | ||
standardInput = System.in | ||
workingDir = project.assetsDir | ||
ignoreExitValue = true | ||
debug = true | ||
mainClass = project.mainClassName | ||
classpath = sourceSets.main.runtimeClasspath | ||
standardInput = System.in | ||
workingDir = project.assetsDir | ||
ignoreExitValue = true | ||
debug = true | ||
} | ||
|
||
task dist(type: Jar) { | ||
manifest { | ||
attributes 'Main-Class': project.mainClassName | ||
} | ||
dependsOn configurations.runtimeClasspath | ||
from { | ||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } | ||
} | ||
with jar | ||
manifest { | ||
attributes 'Main-Class': project.mainClassName | ||
} | ||
dependsOn configurations.runtimeClasspath | ||
from { | ||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } | ||
} | ||
with jar | ||
} | ||
|
||
|
||
dist.dependsOn classes | ||
|
||
eclipse.project.name = appName + "-desktop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
org.gradle.daemon=true | ||
org.gradle.jvmargs=-Xms128m -Xmx1500m | ||
org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8 | ||
org.gradle.configureondemand=false | ||
ashleyVersion=1.7.4 | ||
gdxVersion=1.12.1 | ||
jUnitVersion=4.13 | ||
projectVersion=1.0.0 |