Skip to content

Commit 7534eaa

Browse files
committed
release: v0.2.6
1 parent d5b4bda commit 7534eaa

File tree

7 files changed

+45
-45
lines changed

7 files changed

+45
-45
lines changed

.github/workflows/publish-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ jobs:
5454
--build-cache
5555
-Porg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
5656
-Porg.gradle.daemon=false
57-
57+
env:
58+
PLUGIN_AUTO: false
5859

5960
publish-gradle-plugin:
6061
name: Publish Gradle Plugin
@@ -88,7 +89,8 @@ jobs:
8889
-Porg.gradle.daemon=false
8990
-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
9091
-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
91-
92+
env:
93+
PLUGIN_AUTO: true
9294

9395
create-release:
9496
name: Create release

buildSrc/src/main/kotlin/PublishConfugure.kt

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import org.gradle.api.Project
21
import org.gradle.api.artifacts.dsl.RepositoryHandler
32
import org.gradle.api.publish.maven.MavenPom
4-
import utils.by
53
import utils.systemProperty
64
import java.net.URI
75

@@ -16,23 +14,23 @@ fun RepositoryHandler.configPublishMaven(sonatype: Sonatype, username: String?,
1614
}
1715
}
1816

19-
fun MavenPom.setupPom(project: Project) {
20-
name.set("Kotlin suspend transform compiler plugin - ${project.name}")
21-
description.set(project.description ?: "")
22-
url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
23-
licenses {
24-
license {
25-
name by "MIT License"
26-
url by "https://mit-license.org/"
27-
}
28-
}
29-
scm {
30-
url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
31-
connection.set("scm:git:https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
32-
developerConnection.set("scm:git:ssh://[email protected]/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
33-
}
34-
setupDevelopers()
35-
}
17+
//fun MavenPom.setupPom(project: Project) {
18+
// name.set("Kotlin suspend transform compiler plugin - ${project.name}")
19+
// description.set(project.description ?: "")
20+
// url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
21+
// licenses {
22+
// license {
23+
// name by "MIT License"
24+
// url by "https://mit-license.org/"
25+
// }
26+
// }
27+
// scm {
28+
// url.set("https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin")
29+
// connection.set("scm:git:https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
30+
// developerConnection.set("scm:git:ssh://[email protected]/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git")
31+
// }
32+
// setupDevelopers()
33+
//}
3634

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

7371
fun isPublishConfigurable(): Boolean {
7472
return sonatypeUserInfoOrNull != null
75-
}
73+
}

buildSrc/src/main/kotlin/suspend-transform.gradle-publish.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import utils.systemProperty
2-
import utils.by
1+
import love.forte.gradle.common.core.project.setup
32

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

8+
setup(IProject)
9+
910
pluginBundle {
1011
this.website = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin"
1112
this.vcsUrl = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin.git"

buildSrc/src/main/kotlin/suspend-transform.jvm-maven-publish.gradle.kts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import love.forte.gradle.common.core.Gpg
22
import love.forte.gradle.common.core.project.setup
33
import love.forte.gradle.common.publication.configure.jvmConfigPublishing
4+
import love.forte.gradle.common.publication.configure.setupPom
45

56
plugins {
67
id("org.jetbrains.dokka")
@@ -10,21 +11,9 @@ plugins {
1011

1112
setup(IProject)
1213

13-
val (sonatypeUsername, sonatypePassword) = sonatypeUserInfoOrNull
14+
//val (sonatypeUsername, sonatypePassword) = sonatypeUserInfoOrNull
1415

15-
val sonatypeContains = sonatypeUserInfoOrNull != null
16-
17-
//val jarJavadoc by tasks.registering(Jar::class) {
18-
// archiveClassifier.set("javadoc")
19-
// // from(tasks.findByName("dokkaHtml"))
20-
//}
21-
//
22-
//val jarSources by tasks.registering(Jar::class) {
23-
// archiveClassifier.set("sources")
24-
// from(sourceSets["main"].allSource)
25-
//}
26-
27-
val p = project
16+
//val sonatypeContains = sonatypeUserInfoOrNull != null
2817

2918
jvmConfigPublishing {
3019
project = IProject
@@ -42,12 +31,20 @@ jvmConfigPublishing {
4231
artifact(jarSources)
4332
artifact(jarJavadoc)
4433

45-
isSnapshot = p.version.toString().contains("SNAPSHOT", true)
34+
isSnapshot = project.version.toString().contains("SNAPSHOT", true)
4635
releasesRepository = ReleaseRepository
4736
snapshotRepository = SnapshotRepository
4837
gpg = Gpg.ofSystemPropOrNull()
38+
4939
}
5040

41+
publishing.publications.configureEach {
42+
if (this is MavenPublication) {
43+
pom {
44+
setupPom(project.name, IProject)
45+
}
46+
}
47+
}
5148

5249
//publishing {
5350
// publications {

buildSrc/src/main/kotlin/utils/PropertiesUtil.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ fun isRelease(): Boolean = systemProperty("RELEASE").toBoolean()
3232
/**
3333
* 是否在CI中
3434
*/
35-
fun isCi(): Boolean = systemProperty("CI").toBoolean()
35+
fun isCi(): Boolean = systemProperty("CI").toBoolean()
36+
/**
37+
* 是否自动配置gradle的发布
38+
*/
39+
fun isAutomatedGradlePluginPublishing(): Boolean = isCi() && systemProperty("PLUGIN_AUTO").toBoolean()

compiler/suspend-transform-plugin/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ plugins {
66
kotlin("kapt")
77
kotlin("plugin.serialization")
88
id("com.github.gmazzo.buildconfig")
9-
//id("com.bnorm.power.kotlin-power-assert")
109
id("suspend-transform.jvm-maven-publish")
11-
// id("com.bennyhuo.kotlin.plugin.embeddable.test") version "1.7.10.0"
1210
}
1311

1412
//testWithEmbedded0()

plugins/suspend-transform-plugin-gradle/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import utils.isCi
1+
import utils.isAutomatedGradlePluginPublishing
22

33
plugins {
44
kotlin("jvm")
@@ -51,15 +51,15 @@ gradlePlugin {
5151
implementationClass = "love.forte.plugin.suspendtrans.gradle.SuspendTransformGradlePlugin"
5252
}
5353
}
54-
this.isAutomatedPublishing = isCi()
54+
this.isAutomatedPublishing = isAutomatedGradlePluginPublishing()
5555
// repo?
5656
}
5757

5858
//publishing {
5959
// repositories {
6060
// mavenLocal()
6161
// gradlePluginPortal {
62-
// this.name = "Gradle Central Plugin Repository"
62+
// this.name = "GradleCentralPluginRepository"
6363
// }
6464
// }
6565
//}

0 commit comments

Comments
 (0)