dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

Add support for type-safe project accessors

Open SimonMarquis opened this issue 3 years ago • 5 comments
trafficstars

Closes #480

SimonMarquis avatar Jun 06 '22 23:06 SimonMarquis

Sure, I was going to take a shot at this, but first I tried to run the test suite locally, and I encountered a lot of issues...

Certainly related to Windows AV (or Gradle itself) as many files were locked by a process (Gradle daemon?) and tests were failing while trying to delete jUnit tmp directories. I forced the --max-workers=4 but then it took ages to complete.

SimonMarquis avatar Jun 07 '22 17:06 SimonMarquis

I suppose you'd rather prefer functional tests (GradleBuildSrcConventionMultiConfigProject?) over unit tests on the Issue class?

SimonMarquis avatar Jun 07 '22 20:06 SimonMarquis

Hm, I could be open to a unit test of this class, if that test showed that the new method were equivalent to the others. I do tend to have more confidence in the functional test suite, though. Unit tests of Gradle plugins tend to involve a lot of mocking and/or stubbing, which limits their efficacy in my view.

I'm also open to any improvements to the functional test suite to make it run better on Windows. I admit I've never tried to run these tests in a Windows environment, only Linux and macOS.

One thing you can do is run a subset of the tests. So let's say you add a new functional test named TypeSafeProjectAccessorsSpec, you can then run that test with ./gradlew :functionalTest --tests TypeSafeProjectAccessorsSpec -DfuncTest.quick. The system property will ensure it only runs one iteration of your new spec, rather than against the whole set of supported Gradle versions. To the extent that your issue with running the tests is about the parallelization, that should help a lot.

autonomousapps avatar Jun 08 '22 02:06 autonomousapps

@SimonMarquis if you rebase this, I'd be open to writing a quick test case. Let me know.

autonomousapps avatar Jun 28 '22 02:06 autonomousapps

Hi, really sorry for not doing much here. I didn't had enough time to focus on this project lately.

SimonMarquis avatar Jun 28 '22 18:06 SimonMarquis