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
LUCENE-9488 Assemble source tar, with checksum and signing #353
Conversation
First attempt on a solution, and it works. But I'm pretty sure there is a more optimal organization of the code, i.e. the task definition could perhaps live somewhere else. Also, the sha512 hash generation is a raw copy/paste of some lines from elsewhere, probably some smart way to factor that out and make it DRY. Happy for suggestions. |
It's quite terrible gradle code, but it works! :) I will get back to clean this up some day, promise. I just don't have any ready to use solutions to copy from - the projects I have worked on just signed/ distributed maven artifacts, that's it. I filed LUCENE-10152 to look into this one day. For the moment being, just feel free to move ahead. |
def sourceTarFile = file("build/distributions/lucene-${version}-src.tgz") | ||
import org.apache.commons.codec.digest.DigestUtils | ||
|
||
task assembleSourceDist() { |
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.
This would be typically an internal task attached to convention-style assemble:
assemble.dependsOn assembleSourceDist
Since we're using an external tool (git) and the whole process may be costly, I wouldn't worry about this.
task assembleSourceDist() { | ||
def target = sourceTarFile | ||
|
||
outputs.files target |
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.
An input to this task could be the head commit's sha... this way it wouldn't re-run archiving of the same commit. Again - not important for now.
… default from buildAndPushRelease
lucene/packaging/build.gradle
Outdated
checksum(sourceTarFile) | ||
} | ||
} | ||
tasks.findByName("assembleDist").dependsOn(assembleSourceDist) |
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.
What's 'assembleDist'? Where is it defined? findByName is not needed - if it's a known task, you can just say
assembleDist.dependsOn(assembleSourceDist)
but I can't find this task anywhere.
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 think it is defined by the distribution plugin. It will by default do distTar and distZip. I'll simplify the line..
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.
Ah... right - can be. I never used this plugin, so I'm not familiar with it.
Thanks @janhoy ! |
I'm looking at this and seeing
Added in this PR by @dweiss shown by git blame. |
Because back in the day it didn't work for me and broke downstream maven builds. If you'd like to check whether things work without it, please remove it and file a pr. I don't care. |
https://issues.apache.org/jira/browse/LUCENE-9488
Creates the source tar, with checksum and gpg signing. Usage: