Skip to content

Commit

Permalink
release: v0.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Mar 30, 2023
1 parent d5b4bda commit 7534eaa
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 45 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ jobs:
--build-cache
-Porg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
env:
PLUGIN_AUTO: false

publish-gradle-plugin:
name: Publish Gradle Plugin
Expand Down Expand Up @@ -88,7 +89,8 @@ jobs:
-Porg.gradle.daemon=false
-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
env:
PLUGIN_AUTO: true

create-release:
name: Create release
Expand Down
38 changes: 18 additions & 20 deletions buildSrc/src/main/kotlin/PublishConfugure.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.publish.maven.MavenPom
import utils.by
import utils.systemProperty
import java.net.URI

Expand All @@ -16,23 +14,23 @@ fun RepositoryHandler.configPublishMaven(sonatype: Sonatype, username: String?,
}
}

fun MavenPom.setupPom(project: Project) {
name.set("Kotlin suspend transform compiler plugin - ${project.name}")
description.set(project.description ?: "")
url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
licenses {
license {
name by "MIT License"
url by "https://mit-license.org/"
}
}
scm {
url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
connection.set("scm:git:https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
developerConnection.set("scm:git:ssh://[email protected]/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
}
setupDevelopers()
}
//fun MavenPom.setupPom(project: Project) {
// name.set("Kotlin suspend transform compiler plugin - ${project.name}")
// description.set(project.description ?: "")
// url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
// licenses {
// license {
// name by "MIT License"
// url by "https://mit-license.org/"
// }
// }
// scm {
// url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
// connection.set("scm:git:https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
// developerConnection.set("scm:git:ssh://[email protected]/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
// }
// setupDevelopers()
//}

/**
* 配置开发者/协作者信息。
Expand Down Expand Up @@ -72,4 +70,4 @@ operator fun SonatypeUserInfo?.component2(): String? = this?.sonatypePassword

fun isPublishConfigurable(): Boolean {
return sonatypeUserInfoOrNull != null
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import utils.systemProperty
import utils.by
import love.forte.gradle.common.core.project.setup

plugins {
`java-gradle-plugin`
id("com.gradle.plugin-publish") // version "1.0.0-rc-1"
}

setup(IProject)

pluginBundle {
this.website = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin"
this.vcsUrl = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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

plugins {
id("org.jetbrains.dokka")
Expand All @@ -10,21 +11,9 @@ plugins {

setup(IProject)

val (sonatypeUsername, sonatypePassword) = sonatypeUserInfoOrNull
//val (sonatypeUsername, sonatypePassword) = sonatypeUserInfoOrNull

val sonatypeContains = sonatypeUserInfoOrNull != null

//val jarJavadoc by tasks.registering(Jar::class) {
// archiveClassifier.set("javadoc")
// // from(tasks.findByName("dokkaHtml"))
//}
//
//val jarSources by tasks.registering(Jar::class) {
// archiveClassifier.set("sources")
// from(sourceSets["main"].allSource)
//}

val p = project
//val sonatypeContains = sonatypeUserInfoOrNull != null

jvmConfigPublishing {
project = IProject
Expand All @@ -42,12 +31,20 @@ jvmConfigPublishing {
artifact(jarSources)
artifact(jarJavadoc)

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

}

publishing.publications.configureEach {
if (this is MavenPublication) {
pom {
setupPom(project.name, IProject)
}
}
}

//publishing {
// publications {
Expand Down
6 changes: 5 additions & 1 deletion buildSrc/src/main/kotlin/utils/PropertiesUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ fun isRelease(): Boolean = systemProperty("RELEASE").toBoolean()
/**
* 是否在CI中
*/
fun isCi(): Boolean = systemProperty("CI").toBoolean()
fun isCi(): Boolean = systemProperty("CI").toBoolean()
/**
* 是否自动配置gradle的发布
*/
fun isAutomatedGradlePluginPublishing(): Boolean = isCi() && systemProperty("PLUGIN_AUTO").toBoolean()
2 changes: 0 additions & 2 deletions compiler/suspend-transform-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ plugins {
kotlin("kapt")
kotlin("plugin.serialization")
id("com.github.gmazzo.buildconfig")
//id("com.bnorm.power.kotlin-power-assert")
id("suspend-transform.jvm-maven-publish")
// id("com.bennyhuo.kotlin.plugin.embeddable.test") version "1.7.10.0"
}

//testWithEmbedded0()
Expand Down
6 changes: 3 additions & 3 deletions plugins/suspend-transform-plugin-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import utils.isCi
import utils.isAutomatedGradlePluginPublishing

plugins {
kotlin("jvm")
Expand Down Expand Up @@ -51,15 +51,15 @@ gradlePlugin {
implementationClass = "love.forte.plugin.suspendtrans.gradle.SuspendTransformGradlePlugin"
}
}
this.isAutomatedPublishing = isCi()
this.isAutomatedPublishing = isAutomatedGradlePluginPublishing()
// repo?
}

//publishing {
// repositories {
// mavenLocal()
// gradlePluginPortal {
// this.name = "Gradle Central Plugin Repository"
// this.name = "GradleCentralPluginRepository"
// }
// }
//}

0 comments on commit 7534eaa

Please sign in to comment.