Skip to content

Commit

Permalink
fix(shadow): 修复ihub-shadow组件发布签名错误 (#813)
Browse files Browse the repository at this point in the history
Signed-off-by: henry <[email protected]>
  • Loading branch information
henry-hub authored Apr 24, 2024
1 parent 0e9055a commit 65143c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
import pub.ihub.plugin.IHubPlugin
import pub.ihub.plugin.IHubProjectPluginAware
import pub.ihub.plugin.java.IHubJavaPlugin
Expand Down Expand Up @@ -65,6 +67,11 @@ class IHubShadowPlugin extends IHubProjectPluginAware<IHubShadowExtension> {
withExtension(ShadowExtension).component withExtension(PublishingExtension)
.publications.maybeCreate(CONFIGURATION_NAME, MavenPublication)
}
if (hasPlugin(SigningPlugin)) {
withExtension(PublishingExtension).publications.named(CONFIGURATION_NAME).configure {
withExtension(SigningExtension).sign it
}
}
}

@CompileStatic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 the original author or authors.
* Copyright (c) 2023-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -70,6 +70,7 @@ class IHubShadowPluginTest extends IHubSpecification {
buildFile << '''
apply {
plugin 'maven-publish'
plugin 'signing'
plugin 'pub.ihub.plugin.ihub-shadow'
}
'''
Expand Down

0 comments on commit 65143c6

Please sign in to comment.