Arthur McGibbon
09/16/2024, 5:30 PMgradlew classes after a gradlew clean and I get java warnings in my code. Then I run gradlew classes again and I get no warnings. How do I get Gradle to re-report the warnings on the 2nd (incremental) compile? To me it looks as though Gradle is saying that I've fixed the warnings. Is there a command line arg to make sure all outstanding warnings are displayed on the incremental compile?Vampire
09/16/2024, 9:09 PMVampire
09/16/2024, 9:09 PM--rerun to the task in questionVampire
09/16/2024, 9:09 PM--rerun-tasks to rerun all tasks.Arthur McGibbon
09/16/2024, 10:28 PM--rerun doesn't appear to output the warnings again, it seems only clean classes will redisplay them. I guess there's no kind of "problems state" stored to be able to reprint warnings. I notice this in Intellij when the build is delegated to Gradle. If I do a Rebuild Project then I'll get the warnings/errors from all projects. If I change something in 1 subproject and run Build project then all those previous warnings on other subprojects disappear even though they are still issues. Feels like they shouldn't disappear and that Gradle should be keeping them as the output of the task and reprinting that output when the task says up to date.Vampire
09/17/2024, 7:48 AM--rerun does not help.
I just tried it.
I used a deprecated symbol in a class and did compilation and got the deprecated warning.
I changed a different class and did compilation and got no warning.
I ran the task with --rerun without any source changes and I got the deprecated warning again.Vampire
09/17/2024, 7:49 AM--rerun, otherwise you might either have did something wrong or found a bug.Vampire
09/17/2024, 7:49 AMThomas Broyer
09/17/2024, 9:48 AM-Werror (for JavaCompile; other languages have equivalent functionality).Arthur McGibbon
09/17/2024, 10:52 AM--rerun reports the warnings and creates new class files if I use gradlew compileJava --rerun but not gradlew classes --rerun. Is that a bug?Arthur McGibbon
09/17/2024, 10:54 AM-Werror info - I like the "temporary" promotion idea.Thomas Broyer
09/17/2024, 10:59 AMIs that a bug?No, it's how
--rerun works: it only applies to the exact task named on the command line. Alternatively, use --rerun-tasks to rerun all tasks.Arthur McGibbon
09/17/2024, 11:03 AM