Skip to content

Commit

Permalink
Merge pull request #837 from simple-robot/pref-build
Browse files Browse the repository at this point in the history
尝试调整优化项目的构建配置与依赖关系配置
  • Loading branch information
ForteScarlet authored Jun 4, 2024
2 parents 67b168f + b0a595d commit 4f5ec24
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 140 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sealed class P(override val group: String) : ProjectDetail() {
val versionWithoutSnapshot: Version

init {
val mainVersion = version(4, 0, 0) - version("RC2")
val mainVersion = version(4, 0, 0) - version("RC3")

fun initVersionWithoutSnapshot(status: Version?): Version = if (status == null) {
mainVersion
Expand Down
30 changes: 4 additions & 26 deletions simbot-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ kotlin {
sourceSets {
commonMain {
dependencies {
// jvm compile only
api(libs.jetbrains.annotations)
api(project(":simbot-commons:simbot-common-annotations"))
api(libs.kotlinx.serialization.json)
implementation(project(":simbot-commons:simbot-common-annotations"))
implementation(project(":simbot-logger"))

api(project(":simbot-commons:simbot-common-suspend-runner"))
api(project(":simbot-commons:simbot-common-core"))
api(project(":simbot-commons:simbot-common-collection"))
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.serialization.core)
implementation(libs.kotlinx.serialization.json)
// suspend reversal annotations

}
Expand All @@ -102,7 +102,6 @@ kotlin {
jvmMain {
dependencies {
compileOnly(libs.jetbrains.annotations)
compileOnly(libs.kotlinx.serialization.json)
compileOnly(project(":simbot-commons:simbot-common-annotations"))

compileOnly(libs.kotlinx.coroutines.reactive)
Expand Down Expand Up @@ -130,27 +129,6 @@ kotlin {
implementation(libs.ktor.client.js)
implementation(libs.ktor.client.core)
}

nativeTest.dependencies {
// implementation(libs.ktor.client.core)
// implementation(libs.ktor.client.cio)
}

linuxTest.dependencies {
// implementation(libs.ktor.client.core)
// implementation(libs.ktor.client.cio)
}

appleTest.dependencies {
// implementation(libs.ktor.client.core)
// implementation(libs.ktor.client.cio)
}

mingwTest.dependencies {
// implementation(libs.ktor.client.core)
// implementation(libs.ktor.client.winhttp)
}

}
}

Expand Down
3 changes: 2 additions & 1 deletion simbot-api/src/jvmMain/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Project https://github.com/simple-robot/simpler-robot
* Email [email protected]
*
* This file is part of the Simple Robot Library.
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -36,6 +36,7 @@
requires simbot.common.collection;
requires kotlinx.coroutines.core;
requires kotlinx.serialization.core;
requires kotlinx.serialization.json;
requires static kotlinx.coroutines.reactive;
requires static kotlinx.coroutines.reactor;
requires static kotlinx.coroutines.rx2;
Expand Down
25 changes: 1 addition & 24 deletions simbot-commons/simbot-common-annotations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Project https://github.com/simple-robot/simpler-robot
* Email [email protected]
*
* This file is part of the Simple Robot Library.
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -27,29 +27,6 @@ import love.forte.gradle.common.kotlin.multiplatform.applyTier2
import love.forte.gradle.common.kotlin.multiplatform.applyTier3
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

/*
* Copyright (c) 2023-2024. ForteScarlet.
*
* Project https://github.com/simple-robot/simpler-robot
* Email [email protected]
*
* This file is part of the Simple Robot Library.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Lesser GNU General Public License for more details.
*
* You should have received a copy of the Lesser GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

plugins {
kotlin("multiplatform")
id("simbot.dokka-module-configuration")
Expand Down
11 changes: 0 additions & 11 deletions simbot-commons/simbot-common-atomic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ kotlin {
}

sourceSets {
commonMain {
dependencies {
// compileOnly(project(":simbot-commons:simbot-common-annotations"))
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
Expand All @@ -85,12 +80,6 @@ kotlin {
implementation(libs.kotlinx.lincheck)
}
}

jsMain {
dependencies {
// implementation(project(":simbot-commons:simbot-common-annotations"))
}
}
}
}

Expand Down
25 changes: 5 additions & 20 deletions simbot-commons/simbot-common-collection/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ kotlin {
explicitApi()
applyDefaultHierarchyTemplate()

sourceSets.configureEach {
languageSettings {
// optIn("love.forte.simbot.common.collection.ExperimentalSimbotCollectionApi")
}
}

configKotlinJvm(JVMConstants.KT_JVM_TARGET_VALUE)

js(IR) {
Expand All @@ -76,8 +70,7 @@ kotlin {
sourceSets {
commonMain {
dependencies {
// compileOnly(project(":simbot-commons:simbot-common-annotations"))
compileOnly(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.core)
}
}
commonTest {
Expand All @@ -87,24 +80,16 @@ kotlin {
}
}

jvmMain.dependencies {
compileOnly(libs.kotlinx.coroutines.core)
}

jvmTest {
dependencies {
implementation(kotlin("test-junit5"))
implementation(libs.kotlinx.lincheck)
}
}

nativeMain.dependencies {
api(libs.kotlinx.coroutines.core)
}

jsMain.dependencies {
api(libs.kotlinx.coroutines.core)
}

getByName("wasmJsMain").dependencies {
api(libs.kotlinx.coroutines.core)
}
}
}

Expand Down
21 changes: 4 additions & 17 deletions simbot-commons/simbot-common-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ kotlin {
sourceSets {
commonMain {
dependencies {
compileOnly(project(":simbot-commons:simbot-common-annotations"))
implementation(project(":simbot-commons:simbot-common-annotations"))
implementation(libs.kotlinx.coroutines.core)

api(project(":simbot-commons:simbot-common-suspend-runner"))
api(project(":simbot-commons:simbot-common-collection"))
compileOnly(libs.kotlinx.coroutines.core)
api(libs.kotlinx.serialization.core)
}
}
Expand All @@ -86,6 +87,7 @@ kotlin {
}

jvmMain.dependencies {
compileOnly(project(":simbot-commons:simbot-common-annotations"))
compileOnly(libs.kotlinx.coroutines.reactor)
compileOnly(libs.kotlinx.coroutines.reactive)
}
Expand All @@ -97,21 +99,6 @@ kotlin {
implementation("io.projectreactor:reactor-test:3.6.2")
}
}

nativeMain.dependencies {
api(project(":simbot-commons:simbot-common-annotations"))
api(libs.kotlinx.coroutines.core)
}

jsMain.dependencies {
api(project(":simbot-commons:simbot-common-annotations"))
api(libs.kotlinx.coroutines.core)
}

getByName("wasmJsMain").dependencies {
api(project(":simbot-commons:simbot-common-annotations"))
api(libs.kotlinx.coroutines.core)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module simbot.common.core {
requires kotlin.stdlib;
requires kotlinx.coroutines.core;
requires static simbot.common.annotations;
requires transitive simbot.common.suspendrunner;
requires transitive simbot.common.collection;
requires static kotlinx.coroutines.core;
requires static kotlinx.coroutines.reactor;
requires transitive kotlinx.serialization.core;
requires static reactor.core;
Expand Down
10 changes: 1 addition & 9 deletions simbot-commons/simbot-common-ktor-inputfile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kotlin {

sourceSets {
commonMain.dependencies {
compileOnly(libs.ktor.client.core)
implementation(libs.ktor.client.core)
}
commonTest {
dependencies {
Expand All @@ -68,14 +68,6 @@ kotlin {
implementation(project(":simbot-logger-slf4j2-impl"))
}
}

jsMain.dependencies {
implementation(libs.ktor.client.core)
}

nativeMain.dependencies {
implementation(libs.ktor.client.core)
}
}
}

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module simbot.common.ktor.inputfile {
requires kotlin.stdlib;
requires static io.ktor.http;
requires static io.ktor.client.core;
requires static io.ktor.utils;
requires static io.ktor.io;
requires io.ktor.http;
requires io.ktor.client.core;
requires io.ktor.utils;
requires io.ktor.io;

exports love.forte.simbot.common.ktor.inputfile;
}
20 changes: 5 additions & 15 deletions simbot-commons/simbot-common-suspend-runner/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Project https://github.com/simple-robot/simpler-robot
* Email [email protected]
*
* This file is part of the Simple Robot Library.
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -59,8 +59,9 @@ kotlin {
sourceSets {
commonMain {
dependencies {
api(project(":simbot-logger"))
compileOnly(project(":simbot-commons:simbot-common-annotations"))
implementation(project(":simbot-commons:simbot-common-annotations"))
implementation(project(":simbot-logger"))

api(libs.kotlinx.coroutines.core)
}
}
Expand All @@ -72,6 +73,7 @@ kotlin {
}

jvmMain.dependencies {
compileOnly(project(":simbot-commons:simbot-common-annotations"))
compileOnly(libs.kotlinx.coroutines.reactor)
compileOnly(libs.kotlinx.coroutines.rx2)
compileOnly(libs.kotlinx.coroutines.rx3)
Expand All @@ -86,18 +88,6 @@ kotlin {
implementation("io.projectreactor:reactor-test:3.6.2")
}
}

nativeMain.dependencies {
api(project(":simbot-commons:simbot-common-annotations"))
}

jsMain.dependencies {
api(project(":simbot-commons:simbot-common-annotations"))
}

getByName("wasmJsMain").dependencies {
implementation(project(":simbot-commons:simbot-common-annotations"))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ kotlin {

@Suppress("VulnerableLibrariesLocal")
dependencies {
implementation(project(":simbot-logger"))
compileOnly(project(":simbot-commons:simbot-common-annotations"))
api(project(":simbot-quantcat:simbot-quantcat-common"))
api(project(":simbot-cores:simbot-core"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Project https://github.com/simple-robot/simpler-robot
* Email [email protected]
*
* This file is part of the Simple Robot Library.
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -44,6 +44,7 @@ kotlin {

dependencies {
implementation(platform(libs.spring.boot.v3.dependencies))
implementation(project(":simbot-logger"))

compileOnly(project(":simbot-commons:simbot-common-annotations"))
api(project(":simbot-quantcat:simbot-quantcat-common"))
Expand Down
6 changes: 3 additions & 3 deletions simbot-cores/simbot-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ kotlin {
sourceSets {
commonMain {
dependencies {
api(project(":simbot-commons:simbot-common-annotations"))
api(project(":simbot-commons:simbot-common-collection"))
implementation(project(":simbot-commons:simbot-common-annotations"))
implementation(project(":simbot-commons:simbot-common-collection"))

api(project(":simbot-api"))
api(libs.kotlinx.coroutines.core)
Expand All @@ -88,7 +88,7 @@ kotlin {

jvmMain.dependencies {
compileOnly(project(":simbot-commons:simbot-common-annotations"))
compileOnly(project(":simbot-commons:simbot-common-collection"))
// compileOnly(project(":simbot-commons:simbot-common-collection"))
}

jvmTest {
Expand Down
2 changes: 1 addition & 1 deletion simbot-cores/simbot-core/src/jvmMain/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires kotlin.stdlib;
requires transitive simbot.api;
requires static simbot.common.annotations;
requires static simbot.common.collection;
requires transitive simbot.common.collection;
requires kotlinx.coroutines.core;

exports love.forte.simbot.core.application;
Expand Down
Loading

0 comments on commit 4f5ec24

Please sign in to comment.