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
Port most of the build to gradle. #343
Conversation
7327900
to
725094b
Compare
This is still missing some stuff but I wanted to get feedback on if this was useful / interesting before sinking more time into it. Typical gradle subproject structure plus: - Multi-release jar for shims subproject - Move examples into typical `src/main/java` and set up tasks for each one, removing the need for a separate shell script - Move JMH benchmarks from `src/main/java` to `src/jmh/java` since that's how the JMH plugin prefers it. (This allows benchmarks to live in the same module as the normal code, if desired.) Missing things: - Deploying releases (use Bintray to avoid Sonatype Nexus pain?) - jxr - perhaps other subtleties I missed/forgot
This looks very promising. Regarding the multi release functionality, benchmarks still needs to be multi release so the right implementation gets loaded (maven-shade took care of this). The reason for targeting JDK11+ in shims was to simplify testing, as the functionality was introduced after JDK10 was officially retired. Since we couldn't build with JDK8 any more, the idea was that building with JDK10 would exercise the JDK8 implementation. There are probably other ways to achieve this effect. |
Ah, k. We can drop in the I imagine most people who are on Java > 8 and care about performance are on Java 11 by this point anyway, so while we could get fancy to enable multi-release shim for Java 9, that seems like rapidly diminishing ROI. |
JDK10 may die soon. |
Both 9 and 10 are not supported long term IIRC... 10 may continue to serve as "not java 8 but not java 11" for some time I suspect :) |
That's exactly what it's doing. The only question is how long Travis will make JDK10 available. By that time JDK11 may have more widespread adoption. |
Multi release jars may not be the best solution for using new features while supporting old ones. Multiple build targets may be a better option. |
Cedric has thoughts on the matter: https://blog.gradle.org/mrjars. Haven't tangled with them before personally. |
I just checked out your branch and ran ./gradlew build and the fuzz tests ran. Currently these are enabled only by a profile because it takes hours to run them. We'll need an environment variable to enable them. |
If this is looking good so far, the next step would be to set up deploying released artifacts. I suggest switching to Bintray:
If you're OK with that, I can drop in the setup I have here: https://bitbucket.org/marshallpierce/gcp-logging-enhancers/src/master/build.gradle. My workflow is |
I am fine with switching to a new release setup. |
For the moment publishing only works to maven local.
I've created a bintray org. Let me know your usernames and I can add you. |
I let it try to release a I did: Output (with think time for me to press enter at the right places):
In other words, it figured out that |
I have some reservations about publishing to jcenter via bintray - it’s usually impossible to pull in dependencies from jcenter within more security conscious organisations. Maven central is more widely trusted. |
If you give bintray your maven central credentials it can auto-push there. |
OK that sounds very reasonable to me. |
OK, to make sure I'm following:
|
I cannot sign with my keys, but I apparently can sign with bintray's keys. Or rather, I could sign with my keys, but that would require me writing a REST app.
You mean that at this stage, you run additional checks? What kind of checks?
I don't know how to do so. It seems that I have to go into the package, the exact version number, then click on maven central then click on sync... and I have to do with each "sub" package individually. There is no "do everything" button. I have to click, click, click... that's what I mean by the fact that it is not automated.
Correct. |
Ok. Now a new error...
That's when trying to sync RoaringBitmap (and not shims). |
I'll look around at the upload files for the new version and see that they look right (.jar, -sources.jar, etc). Nothing too heavy. I haven't gone this far down the path of trying to appease Nexus, but I can take a look at generating .md5s of all jars automatically. (MD5? really?) |
New error (after trying again):
|
That's weird... Sure looks like there's a sources jar: https://bintray.com/roaringbitmap/maven/org.roaringbitmap%3Ashims/0.8.9#files/org%2Froaringbitmap%2Fshims%2F0.8.9 |
Presumably, you have access to the page, right...? https://bintray.com/roaringbitmap/maven/org.roaringbitmap%3ARoaringBitmap#central |
My guess is that I can keep going all day, getting random errors one after the other. There is probably a fun script at the other end with a random message generator. |
Yep, I can see that page. Maybe hand off to bintray support again? The sources jar is definitely there. |
This kind of stuff is why I gave up on syncing to maven central for my own projects. :/ |
@marshallpierce Well... is it though? Because that's not the shim package, that's the RoaringBitmap package. Normally, in the maven release cycle, we upload everything in one go. There is one unified release. Now we have to proceed in two steps, but the steps are interdependent. |
@marshallpierce ... because the message comes from maven central. It is maven central saying that we are missing shims sources. |
Bintray has the sources jar for RB as well: https://bintray.com/roaringbitmap/maven/org.roaringbitmap%3ARoaringBitmap#files/org%2Froaringbitmap%2FRoaringBitmap%2F0.8.9 |
Ok. I'll open a new issue. |
Please see #345 |
@marshallpierce BTW the shims package is now on maven... |
Success... after trying all afternoon, everything is on maven, finally. @marshallpierce Can you merge the PR I have issued against your PR... ? Then we will merge your PR. We know that if we are very patient, we can issue a working release from bintray to maven central. And I have checked that it is functional. |
I guess that this is needed to keep things in sync.
@marshallpierce Can you merge once more? I have updated the docs. I have already sent a Roaring Bitmap sticker to @richardstartin , if you want one, just share your mailing address with me... |
Happy success guys ! |
@blacelle Want a Roaring sticker? https://twitter.com/lemire/status/1139649200222855169 |
Updating instructions...
Let us wait to make sure that the tests pass, and then we can merge... This must have been the hardest PR to merge, ever. |
Tests are failing. Restarting. |
Tests are passing. Merging. |
* Port most of the build to gradle. This is still missing some stuff but I wanted to get feedback on if this was useful / interesting before sinking more time into it. Typical gradle subproject structure plus: - Multi-release jar for shims subproject - Move examples into typical `src/main/java` and set up tasks for each one, removing the need for a separate shell script - Move JMH benchmarks from `src/main/java` to `src/jmh/java` since that's how the JMH plugin prefers it. (This allows benchmarks to live in the same module as the normal code, if desired.)
This is still missing some stuff but I wanted to get feedback on if this was useful / interesting before sinking more time into it.
Typical gradle subproject structure plus:
src/main/java
and set up tasks for each one, removing the need for a separate shell scriptsrc/main/java
tosrc/jmh/java
since that's how the JMH plugin prefers it. (This allows benchmarks to live in the same module as the normal code, if desired.)Missing things: