From 9c3388a824844afa4b28b973049eaae75a21b05a Mon Sep 17 00:00:00 2001 From: fredboy Date: Tue, 14 May 2024 18:26:34 +0700 Subject: [PATCH] Move dependencies inside module scripts --- android/build.gradle | 19 +++++++++++++++++ build.gradle | 51 ++------------------------------------------ core/build.gradle | 16 +++++++++++--- desktop/build.gradle | 15 ++++++++++--- 4 files changed, 46 insertions(+), 55 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 80d010c..bf1af00 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,9 @@ +buildscript { + configurations { natives } +} + plugins { + id "com.android.application" id "kotlin-android" } @@ -123,4 +128,18 @@ task run(type: Exec) { def adb = path + "/platform-tools/adb" commandLine "$adb", 'shell', 'am', 'start', '-n', 'ru.deadsoftware.cavedroid/ru.deadsoftware.cavedroid.AndroidLauncher' +} + +dependencies { + implementation project(":core") + implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlinVersion") + api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" + natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" + natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" + natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" + natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" + + configurations.implementation { + exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8' + } } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2a9831a..e782b87 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ buildscript { - ext { appName = "CaveDroid" gdxVersion = '1.12.0' guavaVersion = '28.1' daggerVersion = '2.51.1' - kotlinVersion = '1.9.23' + kotlinVersion = '1.9.24' + kspVersion = '1.9.24-1.0.20' kotlinSerializationVersion = '1.6.3' } @@ -24,7 +24,6 @@ buildscript { } allprojects { - version = 'alpha0.9.2' repositories { @@ -36,49 +35,3 @@ allprojects { maven { url "https://jitpack.io" } } } - -project(":desktop") { - apply plugin: "java-library" - - dependencies { - implementation project(":core") - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion" - api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" - api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" - } -} - -project(":android") { - apply plugin: "android" - - configurations { natives } - - dependencies { - implementation project(":core") - implementation platform("org.jetbrains.kotlin:kotlin-bom:1.9.23") - api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" - natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" - natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" - natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" - natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" - - configurations.implementation { - exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8' - } - } -} - -project(":core") { - apply plugin: "java-library" - - - dependencies { - api "com.badlogicgames.gdx:gdx:$gdxVersion" - api "com.google.guava:guava:$guavaVersion-android" - api "com.google.dagger:dagger:$daggerVersion" - implementation 'org.jetbrains:annotations:23.1.0' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion" - annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" - } -} \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index cdf2ee7..4837be7 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,12 +1,22 @@ plugins { + id "java-library" id "org.jetbrains.kotlin.jvm" id "kotlin" id "idea" id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlinVersion" } -sourceCompatibility = 17 +java.targetCompatibility = JavaVersion.VERSION_17 +java.sourceCompatibility = JavaVersion.VERSION_17 -sourceSets.main.java.srcDirs = [ "src/" ] +sourceSets.main.java.srcDirs = ["src/"] -java.targetCompatibility = JavaVersion.VERSION_17 \ No newline at end of file +dependencies { + api "com.badlogicgames.gdx:gdx:$gdxVersion" + api "com.google.guava:guava:$guavaVersion-android" + api "com.google.dagger:dagger:$daggerVersion" + implementation 'org.jetbrains:annotations:23.1.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion" + annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" +} \ No newline at end of file diff --git a/desktop/build.gradle b/desktop/build.gradle index 70a63ba..04317e4 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -1,10 +1,13 @@ plugins { + id 'java-library' id 'kotlin' id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlinVersion" } -sourceCompatibility = 17 -sourceSets.main.java.srcDirs = [ "src/" ] +java.targetCompatibility = JavaVersion.VERSION_17 +java.sourceCompatibility = JavaVersion.VERSION_1_8 + +sourceSets.main.java.srcDirs = ["src/"] sourceSets.main.resources.srcDirs = ["../android/assets"] project.ext.mainClassName = "ru.deadsoftware.cavedroid.desktop.DesktopLauncher" @@ -48,5 +51,11 @@ task dist(type: Jar) { with jar } +dist.dependsOn classes -dist.dependsOn classes \ No newline at end of file +dependencies { + implementation project(":core") + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion" + api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" + api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" +} -- 2.29.2