Skip to content

Commit

Permalink
调整CI配置
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Jul 1, 2024
1 parent 38e729f commit 62b4c4f
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
11 changes: 4 additions & 7 deletions buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
*/

import love.forte.gradle.common.core.project.ProjectDetail
import love.forte.gradle.common.core.project.Version
import love.forte.gradle.common.core.project.minus
import love.forte.gradle.common.core.property.systemProp
import love.forte.gradle.common.core.project.version as v


/**
Expand All @@ -40,11 +37,11 @@ object P {
override val description: String get() = DESCRIPTION
override val homepage: String get() = HOMEPAGE

const val VERSION = "0.9.2"
const val NEXT_VERSION = "0.9.2"

private val baseVersion = v(0, 9, 2)

val snapshotVersion = baseVersion - Version.SNAPSHOT
override val version = if (isSnapshot()) snapshotVersion else baseVersion
override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT"
override val version = if (isSnapshot()) snapshotVersion else VERSION

override val developers: List<Developer> = developers {
developer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fun org.jetbrains.dokka.gradle.AbstractDokkaTask.configOutput(format: String) {
outputDirectory.set(rootProject.file("build/dokka/$format"))
}

@Suppress("MaxLineLength")
tasks.named<org.jetbrains.dokka.gradle.DokkaMultiModuleTask>("dokkaHtmlMultiModule") {
configOutput("html")

Expand All @@ -43,6 +44,8 @@ tasks.named<org.jetbrains.dokka.gradle.DokkaMultiModuleTask>("dokkaHtmlMultiModu
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customAssets = listOf(rootProject.file(".simbot/dokka-assets/logo-icon.svg"))
customStyleSheets = listOf(rootProject.file(".simbot/dokka-assets/css/kdoc-style.css"))
// TODO ?
homepageLink = "https://github.com/simple-robot/simbot-component-onebot"
footerMessage = "© 2024-${Year.now().value} <a href='https://github.com/simple-robot'>Simple Robot</a>, <a href='https://github.com/ForteScarlet'>ForteScarlet</a>. All rights reserved."
separateInheritedMembers = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ plugins {


// dokka config
@Suppress("MaxLineLength")
tasks.withType<DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
version = P.ComponentOneBot.version.toString()
version = P.ComponentOneBot.version
documentedVisibilities.set(
listOf(
DokkaConfiguration.Visibility.PUBLIC,
Expand Down Expand Up @@ -62,7 +63,14 @@ tasks.withType<DokkaTaskPartial>().configureEach {
sourceLink {
localDirectory.set(projectDir.resolve("src"))
val relativeTo = projectDir.relativeTo(rootProject.projectDir)
remoteUrl.set(URI.create("${P.ComponentOneBot.HOMEPAGE}/tree/dev/main/$relativeTo/src/").toURL())
val uri = URI.create(
"${P.ComponentOneBot.HOMEPAGE}/tree/dev/main/${relativeTo.path.replace('\\', '/')}/src/"
)

logger.info("Dokka source link URI: {}", uri)

// remoteUrl.set(URI.create("${P.ComponentOneBot.HOMEPAGE}/tree/dev/main/$relativeTo/src/").toURL())
remoteUrl.set(uri.toURL())
remoteLineSuffix.set("#L")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ log4j = "2.20.0"
# simbot
simbot = "4.1.0"
suspendTransform = "0.9.0"
gradleCommon = "0.4.0"
gradleCommon = "0.6.0"
# ksp
ksp = "2.0.0-1.0.22"
# https://square.github.io/kotlinpoet/
Expand Down
5 changes: 2 additions & 3 deletions simbot-component-onebot-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import love.forte.gradle.common.core.project.setup
import love.forte.gradle.common.kotlin.multiplatform.applyTier1
import love.forte.gradle.common.kotlin.multiplatform.applyTier123
import love.forte.gradle.common.kotlin.multiplatform.applyTier2
import love.forte.gradle.common.kotlin.multiplatform.applyTier3
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
Expand Down Expand Up @@ -48,9 +49,7 @@ kotlin {
configJs()
}

applyTier1()
applyTier2()
applyTier3()
applyTier123()

sourceSets {
commonMain.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import love.forte.gradle.common.core.project.setup
import love.forte.gradle.common.kotlin.multiplatform.applyTier1
import love.forte.gradle.common.kotlin.multiplatform.applyTier123
import love.forte.gradle.common.kotlin.multiplatform.applyTier2
import love.forte.gradle.common.kotlin.multiplatform.applyTier3

Expand All @@ -41,9 +42,7 @@ kotlin {
configJs()
}

applyTier1()
applyTier2()
applyTier3()
applyTier123()

sourceSets {
commonMain.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.devtools.ksp.gradle.KspTaskMetadata
import love.forte.gradle.common.core.project.setup
import love.forte.gradle.common.kotlin.multiplatform.applyTier1
import love.forte.gradle.common.kotlin.multiplatform.applyTier123
import love.forte.gradle.common.kotlin.multiplatform.applyTier2
import love.forte.gradle.common.kotlin.multiplatform.applyTier3
import org.jetbrains.dokka.gradle.DokkaTaskPartial
Expand Down Expand Up @@ -53,9 +54,7 @@ kotlin {
configJs()
}

applyTier1()
applyTier2()
applyTier3()
applyTier123()

sourceSets {
commonMain.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.devtools.ksp.gradle.KspTaskMetadata
import love.forte.gradle.common.core.project.setup
import love.forte.gradle.common.kotlin.multiplatform.applyTier1
import love.forte.gradle.common.kotlin.multiplatform.applyTier123
import love.forte.gradle.common.kotlin.multiplatform.applyTier2
import love.forte.gradle.common.kotlin.multiplatform.applyTier3
import org.jetbrains.dokka.gradle.DokkaTaskPartial
Expand Down Expand Up @@ -55,9 +56,7 @@ kotlin {
configJs()
}

applyTier1()
applyTier2()
applyTier3()
applyTier123()

sourceSets {
commonMain.dependencies {
Expand Down

0 comments on commit 62b4c4f

Please sign in to comment.