Skip to content

Commit e2b1f2c

Browse files
committed
Misc improvements
1 parent 962f6cf commit e2b1f2c

File tree

11 files changed

+91
-48
lines changed

11 files changed

+91
-48
lines changed

README-chs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fun test(a1: Int, a2: Any): String = runBlocking { test(a1, a2) }
9999
`build.gradle``build.gradle.kts`
100100
```kotlin
101101
plugins {
102-
id("net.mamoe.kotlin-jvm-blocking-bridge") version "0.4.0"
102+
id("net.mamoe.kotlin-jvm-blocking-bridge") version "0.4.1"
103103
}
104104
```
105105

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ You can try it now with Kotlin Compiler IR backend.
100100
`build.gradle` or `build.gradle.kts`
101101
```kotlin
102102
plugins {
103-
id("net.mamoe.kotlin-jvm-blocking-bridge") version "0.4.0"
103+
id("net.mamoe.kotlin-jvm-blocking-bridge") version "0.4.1"
104104
}
105105
```
106106

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ plugins {
88
kotlin("plugin.serialization") version Versions.kotlin apply false
99
id("com.gradle.plugin-publish") version "0.12.0" apply false
1010
id("com.jfrog.bintray") version Versions.bintray apply false
11+
id("com.bmuschko.nexus") version "2.3.1" apply false
12+
id("io.codearte.nexus-staging") version "0.11.0" apply false
1113
id("java")
1214
}
1315

buildSrc/src/main/kotlin/PublishingHelpers.kt

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -136,42 +136,50 @@ inline fun Project.setupPublishing(
136136
from(sourceSets["main"].allSource)
137137
}
138138

139-
publishing {
140-
/*
141-
repositories {
142-
maven {
143-
// change to point to your repo, e.g. http://my.org/repo
144-
url = uri("$buildDir/repo")
145-
}
146-
}*/
147-
publications {
148-
register("mavenJava", MavenPublication::class) {
149-
from(components["java"])
150-
artifact(sourcesJar.get())
151-
152-
this.groupId = groupId
153-
this.artifactId = artifactId
154-
this.version = project.version.toString()
155-
156-
pom {
157-
name.set(project.name)
158-
description.set(project.description)
159-
url.set(vcs)
160-
161-
licenses {
162-
license {
163-
name.set("Apache License 2.0")
164-
url.set("$vcs/blob/master/LICENSE.txt")
139+
@Suppress("DEPRECATION")
140+
val javadocJar by tasks.registering(Jar::class) {
141+
classifier = "javadoc"
142+
}
143+
144+
afterEvaluate {
145+
publishing {
146+
/*
147+
repositories {
148+
maven {
149+
// change to point to your repo, e.g. http://my.org/repo
150+
url = uri("$buildDir/repo")
151+
}
152+
}*/
153+
publications {
154+
register("maven", MavenPublication::class) {
155+
from(components["java"])
156+
artifact(sourcesJar.get())
157+
artifact(javadocJar.get())
158+
159+
this.groupId = groupId
160+
this.artifactId = artifactId
161+
this.version = project.version.toString()
162+
163+
pom {
164+
name.set(project.name)
165+
description.set(project.description)
166+
url.set(vcs)
167+
168+
licenses {
169+
license {
170+
name.set("Apache License 2.0")
171+
url.set("$vcs/blob/master/LICENSE.txt")
172+
}
165173
}
166-
}
167-
scm {
168-
url.set("https://github.com/bnorm/kotlin-power-assert")
169-
connection.set("scm:git:$git")
170-
}
171-
developers {
172-
developer {
173-
name.set("Him188")
174-
url.set("https://github.com/him188")
174+
scm {
175+
url.set(vcs)
176+
connection.set("scm:git:$git")
177+
}
178+
developers {
179+
developer {
180+
name.set("Him188")
181+
url.set("https://github.com/him188")
182+
}
175183
}
176184
}
177185
}

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
object Versions {
2-
const val project = "0.4.0"
2+
const val project = "0.4.1"
3+
const val idePlugin = "0.4.0"
34

45
const val kotlin = "1.4.0-rc"
56
const val coroutines = "1.3.8"
67

8+
79
const val bintray = "1.8.5"
810
}

compiler-plugin/src/main/kotlin/net/mamoe/kjbb/compiler/backend/ir/util.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ val JVM_BLOCKING_BRIDGE_FQ_NAME = FqName(JvmBlockingBridge::class.qualifiedName!
1919

2020
@Suppress(
2121
"INVISIBLE_REFERENCE",
22-
"EXPERIMENTAL_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_USE_EXPERIMENTAL"
22+
"EXPERIMENTAL_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_USE_EXPERIMENTAL",
23+
"DEPRECATION_ERROR"
2324
)
2425
val GENERATED_BLOCKING_BRIDGE_FQ_NAME = FqName(net.mamoe.kjbb.GeneratedBlockingBridge::class.qualifiedName!!)
2526

gradle-plugin/src/main/kotlin/net/mamoe/kjbb/JvmBlockingBridgeGradlePlugin.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.gradle.api.Project
55
import org.gradle.api.provider.Provider
66
import org.jetbrains.kotlin.gradle.plugin.*
77

8-
internal const val JBB_VERSION = "0.4.0"
8+
internal const val JBB_VERSION = "0.4.1"
99

1010
open class BlockingBridgePluginExtension {
1111
var enabled: Boolean = true
@@ -58,14 +58,17 @@ private val pluginArtifact = SubpluginArtifact(
5858
groupId = PLUGIN_ID.substringBeforeLast('.'),
5959
artifactId = PLUGIN_ID.substringAfterLast('.'),
6060
version = JBB_VERSION
61-
).also { log("pluginArtifact=" + it.groupId + ":${it.artifactId}:${it.version}") }
61+
) // .also { log("Adding: " + it.groupId + ":${it.artifactId}:${it.version}") }
6262

6363

6464
open class JvmBlockingBridgeGradlePlugin : KotlinCompilerPluginSupportPlugin {
6565
override fun apply(target: Project) {
66-
log("JvmBlockingBridgeGradlePlugin installed.")
66+
// log("JvmBlockingBridgeGradlePlugin installed.")
6767

6868
target.dependencies.add("implementation", "net.mamoe:kotlin-jvm-blocking-bridge:$JBB_VERSION")
69+
target.repositories.maven {
70+
it.setUrl("https://dl.bintray.com/mamoe/kotlin-jvm-blocking-bridge")
71+
}
6972

7073
//target.afterEvaluate { p ->
7174
// p.dependencies.add("kotlinCompilerClasspath", "net.mamoe:kotlin-jvm-blocking-bridge-compiler:$JBB_VERSION")
@@ -93,7 +96,7 @@ open class JvmBlockingBridgeGradlePlugin : KotlinCompilerPluginSupportPlugin {
9396
KotlinPlatformType.jvm,
9497
KotlinPlatformType.androidJvm -> true
9598
else -> false
96-
}.also { log("Application to ${kotlinCompilation.name}: $it") }
99+
}//.also { log("Application to ${kotlinCompilation.name}: $it") }
97100
}
98101
}
99102

ide-plugin/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ dependencies {
2828
compileOnly(files("libs/ide-common.jar"))
2929
}
3030

31+
version = Versions.idePlugin
32+
3133
// See https://github.com/JetBrains/gradle-intellij-plugin/
3234
intellij {
3335
version = "2020.2"
3436
isDownloadSources = true
35-
updateSinceUntilBuild = false
37+
// updateSinceUntilBuild = false
3638

3739
/*
3840
setPlugins(

ide-plugin/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040
implementation="net.mamoe.kjbb.ide.JvmBlockingBridgeCallResolutionInterceptorExtension"/>
4141
</extensions>
4242

43-
<idea-version since-build="183" until-build="203.*"/>
43+
<idea-version since-build="191.*" until-build="203.*"/>
4444

4545
</idea-plugin>

runtime/build.gradle.kts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ plugins {
66
`maven-publish`
77
signing
88
id("com.jfrog.bintray")
9+
// id("com.bmuschko.nexus")
10+
// id("io.codearte.nexus-staging")
911
}
1012

1113
dependencies {
@@ -21,4 +23,22 @@ dependencies {
2123
setupPublishing(
2224
groupId = "net.mamoe",
2325
artifactId = "kotlin-jvm-blocking-bridge"
24-
)
26+
)
27+
28+
/*
29+
nexus {
30+
sign = true
31+
repositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
32+
snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
33+
}
34+
35+
nexusStaging {
36+
packageGroup = "net.mamoe" //optional if packageGroup == project.getGroup()
37+
// stagingProfileId = "yourStagingProfileId" //when not defined will be got from server using "packageGroup"
38+
}
39+
40+
extraArchive {
41+
sources = false
42+
tests = false
43+
javadoc = false
44+
}*/
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package net.mamoe.kjbb
22

3+
4+
private const val message = "This is generated to help Java callers, don't use in Kotlin."
5+
36
/**
4-
* The annotation that is added to the generated JVM blocking bridges by the compiler.
7+
* The annotation that is added to the generated JVM blocking bridges by the compiler
8+
* to help IntelliJ plugin to hide members correctly.
59
*/
6-
@RequiresOptIn("This is generated to help Java callers, don't use in Kotlin.", level = RequiresOptIn.Level.ERROR)
10+
@Deprecated(message, level = DeprecationLevel.HIDDEN)
11+
@RequiresOptIn(message, level = RequiresOptIn.Level.ERROR)
712
internal annotation class GeneratedBlockingBridge

0 commit comments

Comments
 (0)