Ported to java19 (because gradle doesn't support 20 yet)

This commit is contained in:
Speiger 2023-05-19 22:08:59 +02:00
parent b42e680b8a
commit 30b0cd7eb7
5 changed files with 42 additions and 42 deletions

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java"> <classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes> <attributes>
<attribute name="gradle_scope" value="main"/> <attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources"> <classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes> <attributes>
<attribute name="gradle_scope" value="main"/> <attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-19/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/> <classpathentry kind="output" path="bin/default"/>
</classpath> </classpath>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>Project-Engine-SimpleJavaEngine</name> <name>GameProject-SimpleJavaEngine</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

View File

@ -11,7 +11,7 @@ eclipse {
downloadSources = true downloadSources = true
} }
} }
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(19)
repositories { repositories {
mavenCentral() mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
@ -22,7 +22,7 @@ repositories {
task srcJar(type: Jar) { task srcJar(type: Jar) {
from sourceSets.main.allSource from sourceSets.main.allSource
classifier = 'sources' archiveClassifier = 'sources'
from { from {
configurations.compile.collect { configurations.compile.collect {
it.isDirectory() ? it : zipTree(it) it.isDirectory() ? it : zipTree(it)
@ -44,26 +44,26 @@ jar{
dependencies { dependencies {
//LWJGL 3 //LWJGL 3
compile platform("org.lwjgl:lwjgl-bom:$lwjglVersion") implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
compile "org.lwjgl:lwjgl" implementation "org.lwjgl:lwjgl"
compile "org.lwjgl:lwjgl-glfw" implementation "org.lwjgl:lwjgl-glfw"
compile "org.lwjgl:lwjgl-jemalloc" implementation "org.lwjgl:lwjgl-jemalloc"
compile "org.lwjgl:lwjgl-openal" implementation "org.lwjgl:lwjgl-openal"
compile "org.lwjgl:lwjgl-opengl" implementation "org.lwjgl:lwjgl-opengl"
compile "org.lwjgl:lwjgl-stb" implementation "org.lwjgl:lwjgl-stb"
compile "org.lwjgl:lwjgl-nfd" implementation "org.lwjgl:lwjgl-nfd"
compile "org.lwjgl:lwjgl::$lwjglNatives" implementation "org.lwjgl:lwjgl::$lwjglNatives"
compile "org.lwjgl:lwjgl-glfw::$lwjglNatives" implementation "org.lwjgl:lwjgl-glfw::$lwjglNatives"
compile "org.lwjgl:lwjgl-jemalloc::$lwjglNatives" implementation "org.lwjgl:lwjgl-jemalloc::$lwjglNatives"
compile "org.lwjgl:lwjgl-openal::$lwjglNatives" implementation "org.lwjgl:lwjgl-openal::$lwjglNatives"
compile "org.lwjgl:lwjgl-opengl::$lwjglNatives" implementation "org.lwjgl:lwjgl-opengl::$lwjglNatives"
compile "org.lwjgl:lwjgl-stb::$lwjglNatives" implementation "org.lwjgl:lwjgl-stb::$lwjglNatives"
compile "org.lwjgl:lwjgl-nfd::$lwjglNatives" implementation "org.lwjgl:lwjgl-nfd::$lwjglNatives"
//Gson //Gson
compile 'com.google.code.gson:gson:2.8.6' implementation 'com.google.code.gson:gson:2.8.6'
//Primitive Collections //Primitive Collections
compile 'de.speiger:Primitive-Collections:0.7.0' implementation 'de.speiger:Primitive-Collections:0.7.0'
} }

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -60,7 +60,7 @@ public class ZipAssetPackage implements IAssetPackage
protected FileSystem getReference() throws IOException protected FileSystem getReference() throws IOException
{ {
usedReferences.getAndIncrement(); usedReferences.getAndIncrement();
if(cache == null) cache = FileSystems.newFileSystem(baseFolder, null); if(cache == null) cache = FileSystems.newFileSystem(baseFolder);
return cache; return cache;
} }
@ -68,7 +68,7 @@ public class ZipAssetPackage implements IAssetPackage
public List<String> getDomains() public List<String> getDomains()
{ {
List<String> domains = new ObjectArrayList<>(); List<String> domains = new ObjectArrayList<>();
try(FileSystem system = FileSystems.newFileSystem(baseFolder, null)) try(FileSystem system = FileSystems.newFileSystem(baseFolder))
{ {
try(DirectoryStream<Path> dirs = Files.newDirectoryStream(system.getPath("assets"))) try(DirectoryStream<Path> dirs = Files.newDirectoryStream(system.getPath("assets")))
{ {
@ -98,7 +98,7 @@ public class ZipAssetPackage implements IAssetPackage
@Override @Override
public void getAllAssets(AssetLocation folder, Predicate<String> fileNames, int maxDepth, Collection<AssetLocation> result) public void getAllAssets(AssetLocation folder, Predicate<String> fileNames, int maxDepth, Collection<AssetLocation> result)
{ {
try(FileSystem system = FileSystems.newFileSystem(baseFolder, null)) try(FileSystem system = FileSystems.newFileSystem(baseFolder))
{ {
Path start = system.getPath(folder.getActualLocation()); Path start = system.getPath(folder.getActualLocation());
if(Files.notExists(start)) return; if(Files.notExists(start)) return;