-
Notifications
You must be signed in to change notification settings - Fork 197
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
Update publication artifact collection logic #306
Changes from all commits
cadfcf8
ec45a61
2ff8422
a5c47eb
7820a25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,8 @@ | |
build | ||
|
||
gradle.properties | ||
|
||
build/ | ||
.gradle/ | ||
|
||
.idea/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,22 +23,21 @@ repositories { | |
} | ||
|
||
dependencies { | ||
compile gradleApi() | ||
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.7.2') { | ||
implementation gradleApi() | ||
implementation('org.codehaus.groovy.modules.http-builder:http-builder:0.7.2') { | ||
exclude(module: 'groovy') | ||
} | ||
compile('org.apache.maven.resolver:maven-resolver-ant-tasks:1.2.0') | ||
// provided by Gradle | ||
compileOnly('org.apache.maven:maven-project:2.0.11') | ||
testRuntime('org.apache.maven:maven-project:2.0.11') | ||
testCompile('org.spockframework:spock-core:0.7-groovy-2.0') { | ||
implementation('org.apache.maven.resolver:maven-resolver-ant-tasks:1.2.0') | ||
implementation('org.apache.maven:maven-core:3.0.5') | ||
|
||
testImplementation('org.spockframework:spock-core:0.7-groovy-2.0') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be a good idea to update this dependency to a version that closely matches the Groovy version provided by |
||
exclude(module: 'groovy-all') | ||
} | ||
testCompile('com.jfrog.bintray.client:bintray-client-java-api:0.4') | ||
testCompile('com.jfrog.bintray.client:bintray-client-java-service:0.4') | ||
testCompile('com.jfrog.bintray.client:bintray-client-java-impl:0.1.1') | ||
testCompile('org.codehaus.gpars:gpars:1.2.1') | ||
testCompile('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1') | ||
testImplementation('com.jfrog.bintray.client:bintray-client-java-api:0.4') | ||
testImplementation('com.jfrog.bintray.client:bintray-client-java-service:0.4') | ||
testImplementation('com.jfrog.bintray.client:bintray-client-java-impl:0.1.1') | ||
testImplementation('org.codehaus.gpars:gpars:1.2.1') | ||
testImplementation('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1') | ||
} | ||
|
||
test { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ import org.gradle.api.file.CopySpec | |
import org.gradle.api.publish.Publication | ||
import org.gradle.api.publish.PublishingExtension | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.Optional | ||
import org.gradle.api.tasks.TaskAction | ||
|
@@ -539,34 +540,21 @@ class BintrayUploadTask extends DefaultTask { | |
} | ||
|
||
Artifact[] collectArtifacts(Publication publication) { | ||
if (!publication instanceof MavenPublication) { | ||
if (!publication instanceof MavenPublicationInternal) { | ||
logger.info "{} can only use maven publications - skipping {}.", path, publication.name | ||
return [] | ||
} | ||
def artifacts = publication.artifacts.findResults { | ||
boolean signedArtifact = (it instanceof org.gradle.plugins.signing.Signature) | ||
def signedExtension = signedArtifact ? it.toSignArtifact.getExtension() : null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question - With the new API, we no longer need this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. toSignArtifact was deprecated and removed, this PR would also fix #300 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I confirm as well that these changes still properly publish the signature files. |
||
def artifacts = publication.asNormalisedPublication().allArtifacts.findResults { | ||
new Artifact( | ||
name: publication.artifactId, | ||
groupId: publication.groupId, | ||
version: publication.version, | ||
extension: it.extension, | ||
type: it.extension, | ||
classifier: it.classifier, | ||
file: it.file, | ||
signedExtension: signedExtension | ||
file: it.file | ||
) | ||
} | ||
|
||
// Add the pom file | ||
artifacts << new Artifact( | ||
name: publication.artifactId, | ||
groupId: publication.groupId, | ||
version: publication.version, | ||
extension: 'pom', | ||
type: 'pom', | ||
file: publication.asNormalisedPublication().pomFile | ||
) | ||
artifacts | ||
} | ||
|
||
|
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.
I'd exchange
implementation
forapi
(except forgradleApi()
) as those dependencies are required for compilation & consumers that extend the plugin