Adjusting to Gradle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Adjusting to Gradle

Erick Erickson
Some things to understand about the Gradle build. Note, I’ve assembled these here: https://cwiki.apache.org/confluence/display/SOLR/Building+Solr+with+Gradle

- "gradlew assemble”, “gradlew dev" and “gradlew classes” do _not_ compile the test classes. Use “gradlew testClasses” to compile the test classes independently if you have a need. Executing these from within IntelliJ provides convenient clickable links to problems.

- “gradlew check” will do all of the checks (equivalent of “ant precommit” plus), compile all the classes, including the test classes, and run all the tests. I have been seeing some issues where this will blow up memory, I have no clue why but it can be worked around sometimes by issuing “gradlew —stop” to kill all the daemon(s). Another strategy is to change gradle.properties in your home directory, there’s an obvious line for allocating memory to Gradle.

- the gradle build has some additional checks built in to catch logging calls that use certain logging patterns. There’s extensive help in if you execute “gradlew helpValidateLogCalls”, this is entirely new.

Feel free to ping me on Slack if you’re puzzled by an of this or need any hints. Or just edit the confluence page if you’ve a mind.

Erick
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adjusting to Gradle

Dawid Weiss-2
> - "gradlew assemble”, “gradlew dev" and “gradlew classes” do _not_ compile the test classes. Use “gradlew testClasses” to compile the test classes independently if you have a need. Executing these from within IntelliJ provides convenient clickable links to problems.

Hi Erick. These tasks are rather internal - classes, testClasses...
why would you need to call them explicitly? Typically you'd need to
run tests (test or check tasks) which calls (depends on) appropriate
tasks before. If you need a JAR, invoke assemble (which, correctly,
doesn't compile test classes). It's better to explain tasks that serve
high-level goals rather than low-level intermediate steps?

D.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adjusting to Gradle

Erick Erickson
I used them  a _lot_ from inside IntelliJ when I was working on the
warnings, they run faster than assemble. So I guess they were on my mind.

testClasses in particular because, as you say, assemble doesn’t
compile the test classes (that lead to another 3,000 warnings just
when I thought I was through, siiiiggghhhh).

Otherwise I don’t use them externally.

Feel free to edit them out if you’d like.

Erick

> On Jul 5, 2020, at 5:19 PM, Dawid Weiss <[hidden email]> wrote:
>
>> - "gradlew assemble”, “gradlew dev" and “gradlew classes” do _not_ compile the test classes. Use “gradlew testClasses” to compile the test classes independently if you have a need. Executing these from within IntelliJ provides convenient clickable links to problems.
>
> Hi Erick. These tasks are rather internal - classes, testClasses...
> why would you need to call them explicitly? Typically you'd need to
> run tests (test or check tasks) which calls (depends on) appropriate
> tasks before. If you need a JAR, invoke assemble (which, correctly,
> doesn't compile test classes). It's better to explain tasks that serve
> high-level goals rather than low-level intermediate steps?
>
> D.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adjusting to Gradle

Dawid Weiss-2
> I used them  a _lot_ from inside IntelliJ when I was working on the
> warnings, they run faster than assemble. So I guess they were on my mind.

I don't use IntelliJ's gradle at all, actually. The gradle panel has
an option to switch to the built-in IntelliJ compiler and this works
best for me (even if they
say it's not recommended, it works just fine).

> testClasses in particular because, as you say, assemble doesn’t
> compile the test classes (that lead to another 3,000 warnings just
> when I thought I was through, siiiiggghhhh).

When you run a test they should be compiled automatically. Does
intellij try to run
assemble for tests? That would be weird.


D.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Adjusting to Gradle

Erick Erickson
I didn’t explain my use-case very well.

compile with fail on warnings
fix a bunch of warnings
repeat.

The overhead of running a test just to get the file to fail to compile was
what I was avoiding. Even “assemble” was noticeably slower than
just “classes” for the mainline code.

All that said, it was a weird use case so I’ve no objection to removing
those bits, I doubt many other people will have use for classes and testClasses.

> On Jul 6, 2020, at 3:34 AM, Dawid Weiss <[hidden email]> wrote:
>
>> I used them  a _lot_ from inside IntelliJ when I was working on the
>> warnings, they run faster than assemble. So I guess they were on my mind.
>
> I don't use IntelliJ's gradle at all, actually. The gradle panel has
> an option to switch to the built-in IntelliJ compiler and this works
> best for me (even if they
> say it's not recommended, it works just fine).
>
>> testClasses in particular because, as you say, assemble doesn’t
>> compile the test classes (that lead to another 3,000 warnings just
>> when I thought I was through, siiiiggghhhh).
>
> When you run a test they should be compiled automatically. Does
> intellij try to run
> assemble for tests? That would be weird.
>
>
> D.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]