Skip to content
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

Make the gradle plugin a sub project again #2493

Merged
merged 2 commits into from
Mar 23, 2020

Conversation

arturbosch
Copy link
Member

@arturbosch arturbosch commented Mar 22, 2020

With the current setup adding a new feature like in #2492 is cumbersome.
Until a new cli version is published this feature cannot be merged or it will fail the build.
Our current approach is good for having the newest gradle plugin changes in a gradle detekt run. However it slows down build time and development time.
Fast feedback can still be provided with the new pluginManagement closure:

pluginManagement {
    repositories {
        maven { setUrl("https://plugins.gradle.org/m2/") }
        mavenLocal() // used to publish and test local gradle plugin changes
    }
...
}

All it needs is to run publishToMavenLocal.

I propose to change it back to a sub project. To verify newest changes we could move to following commands in our CI:

gradle build -x detekt
gradle publishToMavenLocal
gradle detekt

This PR leads to:

  • faster build file evaluate, no need to wait for the composite build file evaluation
  • cleaner build files, less duplications
  • more up-to-date tasks
  • faster builds, clean build is ~30 seconds faster

@arturbosch arturbosch added this to the 1.8.0 milestone Mar 22, 2020
@BraisGabin
Copy link
Member

Would this help with #2484?

This leads to:
- faster build file evaluate, no need to wait for the composite build file evaluation
- cleaner build files, less duplications
- more up-to-date tasks
- faster builds, clean build is ~30 seconds faster
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@f162996). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2493   +/-   ##
=========================================
  Coverage          ?   80.12%           
  Complexity        ?     2253           
=========================================
  Files             ?      378           
  Lines             ?     6648           
  Branches          ?     1176           
=========================================
  Hits              ?     5327           
  Misses            ?      741           
  Partials          ?      580
Impacted Files Coverage Δ Complexity Δ
.../main/kotlin/io/gitlab/arturbosch/detekt/Detekt.kt 34.21% <ø> (ø) 19 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f162996...27c463b. Read the comment docs.

@arturbosch
Copy link
Member Author

Would this help with #2484?

Yes, this should not happen as we use a stable detekt version for self analysis.

@arturbosch arturbosch merged commit eb9cf27 into master Mar 23, 2020
@arturbosch arturbosch deleted the make-gradle-a-sub-project branch March 23, 2020 18:51
@schalkms
Copy link
Member

@arturbosch did the test coverage noticeably go down after this commit or after the following one?

Setup for easy local gradle plugin changes

@arturbosch
Copy link
Member Author

@schalkms seems it was this PR -> https://codecov.io/gh/arturbosch/detekt/pull/2493/changes

The gradle plugin is now a sub project and provides coverage data. So it dropped by 3.14% :(

@schalkms
Copy link
Member

@arturbosch I also noticed this when I had a free minute. The only thing we can do is to provide separate unit tests for this sub project, I guess. Before, when it wasn't a sub-project, the analyzer went through the paths.

3flex added a commit to 3flex/detekt that referenced this pull request Aug 19, 2020
3flex added a commit to 3flex/detekt that referenced this pull request Aug 19, 2020
3flex added a commit to 3flex/detekt that referenced this pull request Aug 19, 2020
arturbosch pushed a commit that referenced this pull request Aug 19, 2020
* Stop declaring unnecessary dependency

* Correct the generated test Gradle build files so they're valid

The previous commit uncovers a problem with the Gradle build files that are
being generated for tests, since a default Kotlin version is no longer
declared on the classpath, and the Kotlin plugin cannot be applied without
a specific version.

Since the Kotlin plugin is not currently used in any tests, and hard coding
a Kotlin version adds an additional maintenance burden, it's better to
remove it for now.

The java-library plugin is added instead so the "implementation" and "api"
configurations will still be available for dependency declaration in tests.

* Remove unused file

See #2493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants