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.
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
Gradle pt 1: tests + coverage #722
Gradle pt 1: tests + coverage #722
Changes from all commits
c4bf84b
b871872
c5f3d89
6fdb23b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 are these two for?
org.ajoberstar.grgit
- some git jiggery-pokerycom.github.johnrengelman.shadow
- in place of using gradle to build the jaris that about right?
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.
First one will be for pulling the git commit for building into the server, so we don't have to rely on kb-sdk compile. Second one will be for building a shadow jar, which Gradle can't do out of the box
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.
They're both used in auth2 if you want to see examples
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.
Are these default env vars? They are not used elsewhere in this script.
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.
They're going to be required in Gradle 9 for non-default test tasks to work
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.
👍
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.
won't this automatically be included?
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.
That line is to exclude everything that's not in
**/test/**
. This whole block should go away later when I move the files around to match Gradle default expectationsThere 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.
Are these for future commits? There are not many files in the
test
folderThere 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.
These are all files currently used in tests, but all the tests are under the src folder
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 assume this part will be deleted once we move test folders out?
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.
yeah, I'll try to set things up like auth so we don't need the
sourceSets
section at all, but that comes lastThere 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.
does this check for directory existence first? You can do
dir.exists()
first if not.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.
It works regardless of whether the build directory exists or not, so presumably it's a
mkdir -p
situationThere 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 is this step for? L144
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.
https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#files-java.lang.Object...-
I believe it's that. I'm still a bit of a Gradle beginner so my understanding here is that it's converting a java
File
into a type that the Gradleimplementation
understandsThere 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 whole function is something I just found and copied, to be perfectly honest. It works though
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.
👍
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.
You can get it from Clojars. Alter the repo config to the following:
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.
In the next commit I get rid of the JNA dependency since it prevents the server from working in a shadowjar, so I don't actually want to pull it from a repo since that'll force the JNA dependency. Plus it's no harder to pull it from jars. Plus plus we need to get rid of sylog4j anyway so a janky pulldown makes that more obvious. I'll update the comment to be more accurate along those lines
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 clearer just to have all the deps together in alphabetical order instead of like this with all these extra comments. Gradle can figure out the dependency tree, so the comments just slow down finding the relevant lines in the gradle file and add cruft.
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.
The subsections and comments like this are for cases where Gradle can't figure out the dependency tree, e.g.
As such I want to group these sections together to make it clear where the dependencies are coming from and why they're in the list.