-
Notifications
You must be signed in to change notification settings - Fork 5
Support override return type generic #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ForteScarlet
wants to merge
10
commits into
dev
Choose a base branch
from
try-support-annotation-generics
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
eadeffb
feat: try to support generic in annotation and some tests
ForteScarlet 03ca25e
feat: Introduce `ExperimentalReturnTypeOverrideGenericApi`, add suppo…
ForteScarlet a4d7773
test: Remove `JvmBlockingWithType` annotation, cleanup related config…
ForteScarlet 83095c0
refactor: Extract platform-checking logic into `PlatformUtils`, adjus…
ForteScarlet 837cc81
奇怪。为什么只要被获取的注解,它原本的范型类型就会被破坏呢?
ForteScarlet 816820c
refactor: (WIP) Extract internal data classes to separate files for b…
ForteScarlet 11c2177
Gotcha! The first tricky problem is solved.
ForteScarlet dbb52ef
problem: It seemed that there was a problem with using inline value c…
ForteScarlet 9f452bb
feat: Previous issues resolved
ForteScarlet 890ae5a
test: Fix tests, upgrade yarn lockfile.
ForteScarlet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,6 @@ | ||
import org.gradle.api.Action | ||
import org.gradle.api.DomainObjectCollection | ||
import org.gradle.api.Project | ||
import org.gradle.api.publish.Publication | ||
import org.gradle.plugins.signing.SigningExtension | ||
import utils.systemProperty | ||
|
||
fun SigningExtension.setupSigning(publications: DomainObjectCollection<Publication>) { | ||
val keyId = systemProperty("GPG_KEY_ID") | ||
val secretKey = systemProperty("GPG_SECRET_KEY") | ||
val password = systemProperty("GPG_PASSWORD") | ||
|
||
if (keyId != null) { | ||
useInMemoryPgpKeys(keyId, secretKey, password) | ||
} | ||
|
||
setRequired(project.provider { project.gradle.taskGraph.hasTask("publish") }) | ||
sign(publications) | ||
} | ||
|
||
internal fun Project.`signing`(configure: Action<SigningExtension>): Unit = | ||
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("signing", configure) | ||
// import org.gradle.api.Action | ||
// import org.gradle.api.Project | ||
// import org.gradle.plugins.signing.SigningExtension | ||
// | ||
// internal fun Project.`signing`(configure: Action<SigningExtension>): Unit = | ||
// (this as org.gradle.api.plugins.ExtensionAware).extensions.configure("signing", configure) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
244 changes: 122 additions & 122 deletions
244
buildSrc/src/main/kotlin/suspend-transform.jvm-maven-publish.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,122 @@ | ||
import love.forte.gradle.common.core.Gpg | ||
import love.forte.gradle.common.publication.configure.configPublishMaven | ||
import love.forte.gradle.common.publication.configure.publishingExtension | ||
import love.forte.gradle.common.publication.configure.setupPom | ||
import love.forte.gradle.common.publication.configure.signingExtension | ||
import utils.isMainPublishable | ||
|
||
plugins { | ||
id("signing") | ||
id("maven-publish") | ||
} | ||
|
||
//setup(IProject) | ||
|
||
//val (sonatypeUsername, sonatypePassword) = sonatypeUserInfoOrNull | ||
|
||
//val sonatypeContains = sonatypeUserInfoOrNull != null | ||
val gpgValue = Gpg.ofSystemPropOrNull() | ||
|
||
// see https://github.com/gradle/gradle/issues/26091#issuecomment-1681343496 | ||
|
||
val p = project | ||
|
||
if (isMainPublishable()) { | ||
val isSnapshot = project.version.toString().contains("SNAPSHOT") | ||
publishingExtension { | ||
repositories { | ||
mavenLocal() | ||
if (isSnapshot) { | ||
configPublishMaven(SnapshotRepository) | ||
} else { | ||
configPublishMaven(ReleaseRepository) | ||
} | ||
} | ||
val jarSources = tasks.register("${p.name}SourceJar", Jar::class) { | ||
archiveClassifier.set("sources") | ||
from(sourceSets["main"].allSource) | ||
} | ||
|
||
val jarJavadoc = tasks.register("${p.name}JavadocJar", Jar::class) { | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
publications { | ||
create<MavenPublication>("publicationDist") { | ||
from(components.getByName("java")) | ||
artifact(jarSources) | ||
artifact(jarJavadoc) | ||
version = p.version.toString() | ||
setupPom(p.name, IProject) | ||
} | ||
} | ||
|
||
signingExtension { | ||
val gpg = gpgValue ?: return@signingExtension | ||
|
||
val (keyId, secretKey, password) = gpg | ||
useInMemoryPgpKeys(keyId, secretKey, password) | ||
sign(publishingExtension.publications) | ||
} | ||
} | ||
// jvmConfigPublishing { | ||
// project = IProject | ||
// isSnapshot = project.version.toString().contains("SNAPSHOT", true) | ||
// | ||
// val jarSources = tasks.register("${p.name}SourceJar", Jar::class) { | ||
// archiveClassifier.set("sources") | ||
// from(sourceSets["main"].allSource) | ||
// } | ||
// | ||
// val jarJavadoc = tasks.register("${p.name}JavadocJar", Jar::class) { | ||
//// dependsOn(tasks.dokkaHtml) | ||
//// from(tasks.dokkaHtml.flatMap { it.outputDirectory }) | ||
// archiveClassifier.set("javadoc") | ||
// } | ||
// | ||
// tasks.withType<GenerateModuleMetadata> { | ||
// dependsOn(jarSources) | ||
// dependsOn(jarJavadoc) | ||
// } | ||
// | ||
// artifact(jarSources) | ||
// artifact(jarJavadoc) | ||
// | ||
// releasesRepository = ReleaseRepository | ||
// snapshotRepository = SnapshotRepository | ||
// | ||
// gpg = gpgValue | ||
// } | ||
|
||
} | ||
|
||
|
||
signing { | ||
isRequired = gpgValue != null | ||
if (gpgValue != null) { | ||
val (keyId, secretKey, password) = gpgValue | ||
useInMemoryPgpKeys(keyId, secretKey, password) | ||
sign(publishingExtension.publications) | ||
} | ||
} | ||
|
||
// TODO see https://github.com/gradle-nexus/publish-plugin/issues/208#issuecomment-1465029831 | ||
val signingTasks: TaskCollection<Sign> = tasks.withType<Sign>() | ||
tasks.withType<PublishToMavenRepository>().configureEach { | ||
mustRunAfter(signingTasks) | ||
} | ||
// see https://github.com/gradle/gradle/issues/26091#issuecomment-1722947958 | ||
//region Fix Gradle warning about signing tasks using publishing task outputs without explicit dependencies | ||
// https://github.com/gradle/gradle/issues/26091 | ||
//tasks.withType<AbstractPublishToMaven>().configureEach { | ||
// val signingTasks = tasks.withType<Sign>() | ||
// mustRunAfter(signingTasks) | ||
//} | ||
//endregion | ||
|
||
|
||
inline val Project.sourceSets: SourceSetContainer | ||
get() = extensions.getByName("sourceSets") as SourceSetContainer | ||
|
||
internal val TaskContainer.dokkaHtml: TaskProvider<org.jetbrains.dokka.gradle.DokkaTask> | ||
get() = named<org.jetbrains.dokka.gradle.DokkaTask>("dokkaHtml") | ||
// import love.forte.gradle.common.core.Gpg | ||
// import love.forte.gradle.common.publication.configure.configPublishMaven | ||
// import love.forte.gradle.common.publication.configure.publishingExtension | ||
// import love.forte.gradle.common.publication.configure.setupPom | ||
// import love.forte.gradle.common.publication.configure.signingExtension | ||
// import utils.isMainPublishable | ||
// | ||
// plugins { | ||
// id("signing") | ||
// id("maven-publish") | ||
// } | ||
// | ||
// //setup(IProject) | ||
// | ||
// //val (sonatypeUsername, sonatypePassword) = sonatypeUserInfoOrNull | ||
// | ||
// //val sonatypeContains = sonatypeUserInfoOrNull != null | ||
// val gpgValue = Gpg.ofSystemPropOrNull() | ||
// | ||
// // see https://github.com/gradle/gradle/issues/26091#issuecomment-1681343496 | ||
// | ||
// val p = project | ||
// | ||
// if (isMainPublishable()) { | ||
// val isSnapshot = project.version.toString().contains("SNAPSHOT") | ||
// publishingExtension { | ||
// repositories { | ||
// mavenLocal() | ||
// if (isSnapshot) { | ||
// configPublishMaven(SnapshotRepository) | ||
// } else { | ||
// configPublishMaven(ReleaseRepository) | ||
// } | ||
// } | ||
// val jarSources = tasks.register("${p.name}SourceJar", Jar::class) { | ||
// archiveClassifier.set("sources") | ||
// from(sourceSets["main"].allSource) | ||
// } | ||
// | ||
// val jarJavadoc = tasks.register("${p.name}JavadocJar", Jar::class) { | ||
// archiveClassifier.set("javadoc") | ||
// } | ||
// | ||
// publications { | ||
// create<MavenPublication>("publicationDist") { | ||
// from(components.getByName("java")) | ||
// artifact(jarSources) | ||
// artifact(jarJavadoc) | ||
// version = p.version.toString() | ||
// setupPom(p.name, IProject) | ||
// } | ||
// } | ||
// | ||
// signingExtension { | ||
// val gpg = gpgValue ?: return@signingExtension | ||
// | ||
// val (keyId, secretKey, password) = gpg | ||
// useInMemoryPgpKeys(keyId, secretKey, password) | ||
// sign(publishingExtension.publications) | ||
// } | ||
// } | ||
// // jvmConfigPublishing { | ||
// // project = IProject | ||
// // isSnapshot = project.version.toString().contains("SNAPSHOT", true) | ||
// // | ||
// // val jarSources = tasks.register("${p.name}SourceJar", Jar::class) { | ||
// // archiveClassifier.set("sources") | ||
// // from(sourceSets["main"].allSource) | ||
// // } | ||
// // | ||
// // val jarJavadoc = tasks.register("${p.name}JavadocJar", Jar::class) { | ||
// //// dependsOn(tasks.dokkaHtml) | ||
// //// from(tasks.dokkaHtml.flatMap { it.outputDirectory }) | ||
// // archiveClassifier.set("javadoc") | ||
// // } | ||
// // | ||
// // tasks.withType<GenerateModuleMetadata> { | ||
// // dependsOn(jarSources) | ||
// // dependsOn(jarJavadoc) | ||
// // } | ||
// // | ||
// // artifact(jarSources) | ||
// // artifact(jarJavadoc) | ||
// // | ||
// // releasesRepository = ReleaseRepository | ||
// // snapshotRepository = SnapshotRepository | ||
// // | ||
// // gpg = gpgValue | ||
// // } | ||
// | ||
// } | ||
// | ||
// | ||
// signing { | ||
// isRequired = gpgValue != null | ||
// if (gpgValue != null) { | ||
// val (keyId, secretKey, password) = gpgValue | ||
// useInMemoryPgpKeys(keyId, secretKey, password) | ||
// sign(publishingExtension.publications) | ||
// } | ||
// } | ||
// | ||
// // TODO see https://github.com/gradle-nexus/publish-plugin/issues/208#issuecomment-1465029831 | ||
// val signingTasks: TaskCollection<Sign> = tasks.withType<Sign>() | ||
// tasks.withType<PublishToMavenRepository>().configureEach { | ||
// mustRunAfter(signingTasks) | ||
// } | ||
// // see https://github.com/gradle/gradle/issues/26091#issuecomment-1722947958 | ||
// //region Fix Gradle warning about signing tasks using publishing task outputs without explicit dependencies | ||
// // https://github.com/gradle/gradle/issues/26091 | ||
// //tasks.withType<AbstractPublishToMaven>().configureEach { | ||
// // val signingTasks = tasks.withType<Sign>() | ||
// // mustRunAfter(signingTasks) | ||
// //} | ||
// //endregion | ||
// | ||
// | ||
// inline val Project.sourceSets: SourceSetContainer | ||
// get() = extensions.getByName("sourceSets") as SourceSetContainer | ||
// | ||
// internal val TaskContainer.dokkaHtml: TaskProvider<org.jetbrains.dokka.gradle.DokkaTask> | ||
// get() = named<org.jetbrains.dokka.gradle.DokkaTask>("dokkaHtml") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This file contains large sections of commented-out code. Consider removing unused comments or refactoring to keep the codebase clean and maintainable.
Copilot uses AI. Check for mistakes.