From cbf3457cf34c8cf692c330c10b0dbc64b18bf530 Mon Sep 17 00:00:00 2001 From: PeytonPlayz595 <106421860+PeytonPlayz595@users.noreply.github.com> Date: Tue, 16 Apr 2024 01:05:39 -0400 Subject: [PATCH] Combine desktopRuntime into one gradle build --- build-desktopruntime.gradle | 38 ------------------------------------- build.gradle | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 38 deletions(-) delete mode 100644 build-desktopruntime.gradle diff --git a/build-desktopruntime.gradle b/build-desktopruntime.gradle deleted file mode 100644 index e02ad00..0000000 --- a/build-desktopruntime.gradle +++ /dev/null @@ -1,38 +0,0 @@ -//rename this file to build.gradle - - -plugins { - id 'java' - id 'eclipse' -} - -sourceSets { - main { - java { - srcDir 'src/main/java' - srcDir 'src/lwjgl/java' - } - } -} - -repositories { - mavenCentral() -} - -// https://stackoverflow.com/questions/21037879/add-library-to-gradle-build -dependencies { - implementation fileTree(dir: './desktopRuntime/eclipseProject/deps_fix/', include: '*.jar') -} - -//credit to MCPreborn -tasks.register('runclient', JavaExec) { - group = "ShadowClient" - description = "Runs the client" - classpath sourceSets.main.runtimeClasspath - if (System.getProperty("os.name").toLowerCase().contains("mac")) { - jvmArgs '-XstartOnFirstThread' - } - - workingDir "./desktopRuntime" - main 'net.lax1dude.eaglercraft.v1_8.internal.lwjgl.MainClass' -} diff --git a/build.gradle b/build.gradle index 5c76755..573dc79 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,12 @@ sourceSets { srcDir 'src/teavm/java' } } + eagler { + java { + srcDir 'src/main/java' + srcDir 'src/lwjgl/java' + } + } } repositories { @@ -20,6 +26,7 @@ repositories { dependencies { teavm(teavm.libs.jso) teavm(teavm.libs.jsoApis) + eaglerImplementation fileTree(dir: './desktopRuntime/eclipseProject/deps_fix/', include: '*.jar') } teavm.js { @@ -37,3 +44,16 @@ teavm.js { sourceMap = true debugInformation = false } + +tasks.register('runclient', JavaExec) { + classpath = sourceSets.eagler.compileClasspath + group = "ShadowClient" + description = "Runs the client" + classpath sourceSets.eagler.runtimeClasspath + if (System.getProperty("os.name").toLowerCase().contains("mac")) { + jvmArgs '-XstartOnFirstThread' + } + + workingDir "./desktopRuntime" + main 'net.lax1dude.eaglercraft.v1_8.internal.lwjgl.MainClass' +} \ No newline at end of file