Skip to content

Commit

Permalink
release: v0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Mar 30, 2023
1 parent 7534eaa commit 1ea6c05
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
-Porg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
env:
PLUGIN_AUTO: false
PLUGIN_AUTO: ${{ matrix.os == 'ubuntu-latest' }}

publish-gradle-plugin:
name: Publish Gradle Plugin
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/IProject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object IProject : ProjectDetail() {
const val DESCRIPTION = "Generate platform-compatible functions for Kotlin suspend functions"
const val HOMEPAGE = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin"

override val version: Version = version(0, 2, 6)
override val version: Version = version(0, 2, 7)

override val homepage: String get() = HOMEPAGE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import love.forte.gradle.common.core.Gpg
import love.forte.gradle.common.core.project.setup
import love.forte.gradle.common.publication.configure.jvmConfigPublishing
import love.forte.gradle.common.publication.configure.setupPom
import utils.isCi
import utils.isLinux

plugins {
id("org.jetbrains.dokka")
Expand All @@ -14,30 +16,32 @@ setup(IProject)
//val (sonatypeUsername, sonatypePassword) = sonatypeUserInfoOrNull

//val sonatypeContains = sonatypeUserInfoOrNull != null
if (!isCi() || isLinux) {
jvmConfigPublishing {
project = IProject
val jarSources by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}

jvmConfigPublishing {
project = IProject
val jarSources by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}

val jarJavadoc by tasks.registering(Jar::class) {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}
val jarJavadoc by tasks.registering(Jar::class) {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}

artifact(jarSources)
artifact(jarJavadoc)
artifact(jarSources)
artifact(jarJavadoc)

isSnapshot = project.version.toString().contains("SNAPSHOT", true)
releasesRepository = ReleaseRepository
snapshotRepository = SnapshotRepository
gpg = Gpg.ofSystemPropOrNull()
isSnapshot = project.version.toString().contains("SNAPSHOT", true)
releasesRepository = ReleaseRepository
snapshotRepository = SnapshotRepository
gpg = Gpg.ofSystemPropOrNull()

}
}


publishing.publications.configureEach {
if (this is MavenPublication) {
pom {
Expand All @@ -46,6 +50,7 @@ publishing.publications.configureEach {
}
}


//publishing {
// publications {
// create<MavenPublication>("suspendTransformJvmDist") {
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/utils/PropertiesUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ fun isRelease(): Boolean = systemProperty("RELEASE").toBoolean()
* 是否在CI中
*/
fun isCi(): Boolean = systemProperty("CI").toBoolean()

/**
* 是否自动配置gradle的发布
*/
fun isAutomatedGradlePluginPublishing(): Boolean = isCi() && systemProperty("PLUGIN_AUTO").toBoolean()

val isLinux: Boolean = systemProperty("os.name")?.contains("linux", true) ?: false

0 comments on commit 1ea6c05

Please sign in to comment.