aaschmid / gradle-cpd-plugin

Gradle plugin to find duplicate code using PMDs copy/paste detection (= CPD).
Apache License 2.0
96 stars 12 forks source link

Use Gradles "Task Configuration Avoidance" which requires Gradle >= 4.9 #30

Closed larsgrefer closed 5 years ago

larsgrefer commented 5 years ago

I hereby agree to the terms of the Gradle CPD plugin Contributor License Agreement.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.2%) to 85.897% when pulling 3a460327b88f8db0f4062d0b840a1b7bb5292690 on larsgrefer:update/gradle/4.10.3 into 15fd47ac0fba28cec2a0a7bb6749669884e9e06b on aaschmid:master.

aaschmid commented 5 years ago

@larsgrefer thanks for PR. What's the purpose of this change? I tried to have the minimal working Gradle verison in the wrapper and your changes does not require any update here - as far as I could see?

larsgrefer commented 5 years ago

Updating to 4.10.3 allows the plugin to be built on Java 11.

aaschmid commented 5 years ago

Correct, but the pre-build and provided jar runs with Java 11 and Gradle > 3.5.1. Therefore this is only an issue for the travis-ci build, right?

larsgrefer commented 5 years ago

Gradle 3.5.1 is nearly two years old. I thought it might be time to move things a bit forward.

Updating to a newer Gradle version paves the way for new Gradle API's like

The Java 11 issue also affected my local machine. I've had to install Java 8 in order to work on #31

aaschmid commented 5 years ago

Understood, to work on this plugin you need to have Java 8 right now. To run it Java 11 is perfectly OK.

Do you have any use-cases for "lazy configuration" and "task configuration avoidance" which you would like to introduce in this plugin? Edit: I just want to support old version as long as possible because there are a lot customers out there which are not upgrading that fast. This might also be possible if upgrading wrapper and just don't use the new APIs but using the old wrapper versions it is much easier for me. However, if there are good reasons for new features, I am fine to upgrade :-)

Travis build: The Java 11 build is unfortunately still broken. Upon first view it seems to be an issue on JaCoCo: Caused by: java.lang.NoSuchFieldException: $jacocoAccess

aaschmid commented 5 years ago

Thanks for your effort @larsgrefer. I like the changes and I would like to merge them :-)

Do you have an idea about the Java 11 build problems? Could it be that PMD support Java 11 from 6.6.0 on?

aaschmid commented 5 years ago

Hi @larsgrefer, thanks for your PR. Even if creation of Cpd tasks is not very expensive it might be a valid feature to use configuration avoidance.