Commit Graph

139 Commits

Author SHA1 Message Date
Matthew Haughton
1258c2fe82 Add dependency-analysis plugin and implement some recommendations (#4798)
Co-authored-by: schalkms <30376729+schalkms@users.noreply.github.com>
2022-06-02 13:19:44 +01:00
Nicola Corti
0380716649 Move detekt-gradle-plugin to be a composite build (#4751) 2022-04-25 02:24:45 +01:00
Matthew Haughton
8939aedb42 Drop Spek (#4670)
Co-authored-by: Goooler <wangzongler@gmail.com>
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
2022-04-12 00:12:58 +01:00
Chao Zhang
6c3c28df3a Housekeep Gradle scripts (#4589)
* Housekeep Gradle scripts

* Revert changes in settings.gradle
2022-02-21 21:48:00 +11:00
Brais Gabín
c79d36048a Add to the documentation how to configure Baseline task with type resolution (#4285) 2021-11-18 11:01:57 +01:00
Matthew Haughton
36741ce64e Fix typo in Gradle lib definition (#4255)
See "Lifted restrictions for alias names" in https://docs.gradle.org/7.3/release-notes.html#new-features-and-usability-improvements
2021-11-09 18:18:36 -08:00
Matthew Haughton
755a15035b Refactor so detekt-gradle-plugin can be added as an included build (#4094)
* Refactor publishing build config

This removes the use of `subprojects` block as it can't be used effectively
with composite builds.

* Make it easy to use detekt-gradle-plugin in a composite build

Replace `include("detekt-gradle-plugin")` with
`includeBuild("detekt-gradle-plugin")` in settings.gradle.kts

* Move nexus-staging-plugin config back to build-logic
2021-10-13 16:39:48 +11:00
Matthew Haughton
fd0cb9096e Migrate buildSrc to composite build (#4090)
This will help reduce build times when changes are made to the precompiled
script plugins used in the build. This is because a change in buildSrc
causes the whole project to become out-of-date [0]. Using an included build
instead works around this problem.

[0] https://docs.gradle.org/7.2/userguide/organizing_gradle_projects.html#sec:build_sources
2021-09-04 23:09:59 +10:00
Matthew Haughton
026066f280 Gradle 7.2 (#4056)
* Gradle 7.2
* Declare plugins in version catalog where possible
2021-08-20 11:49:30 -07:00
Matthew Haughton
6040fdc31b Kotlin 1.5.10 (#3826) 2021-05-24 22:36:09 +10:00
Matthew Haughton
f5fe1d1e50 Merge JaCoCo coverage reports the "right" way (#3650)
* Merge JaCoCo coverage reports the "right" way

* Generate code coverage report when "check" lifecycle task is run
2021-05-21 20:29:51 +10:00
Eliezer Graber
22eec6322c Update Kotlin to 1.5 (#3718)
* Update Kotlin to 1.5
* Add workaround for Kotlin 1.5 memory leak in Gradle
* API changes
* Don't treat warnings as errors on the detekt-gradle-plugin module
2021-05-20 23:14:16 -07:00
Matthew Haughton
4ee28ac074 Enable version catalogs (#3741) 2021-05-06 08:46:30 +10:00
Matthew Haughton
a847869951 Support Gradle config cache in detekt's build (#3574)
* Gradle 6.8.3

* Shadow 6.1.0

* Gradle Enterprise Gradle plugin 3.6

* Don't apply detekt plugin to detekt-bom module

* Simplify detekt-generator custom tasks
2021-03-22 20:41:50 +11:00
Matthew Haughton
866eb2b2f3 Gradle tweaks (#3575)
* Use idiomatic repository declarations

* Prefer Maven Central to JCenter
* Limit JCenter to kotlinx-html-jvm module only
* Remove unnecessary repository declarations

* Agree to build scan T&Cs in settings where the plugin is applied

* Refactor

* Fix some issues in the build config examples

* Apply binary-compatibility-validator plugin only in subprojects that need it

* Don't configure Java source/target compatibility

There's no Java source code in the repository

* Don't unnecessarily declare plugins in root project build
2021-03-20 10:56:57 +01:00
Chao Zhang
425b67c9cf Fix maven publish (#3392) 2021-01-20 23:05:06 +01:00
Chao Zhang
44ad8d92b8 Fix build script to avoid jvm plugin applied (#3389) 2021-01-19 21:39:57 +01:00
Brais Gabín
945f075af1 Simplify our buildSrc (#3322)
* Move cli gradle configuration to its build.gradle.kts

* Create plugin module so we can add it to each module
2021-01-05 00:06:10 +01:00
Chao Zhang
a0029d4e12 Generate API validation for detekt-psu-utils (#3338) 2021-01-01 15:09:46 +01:00
Chao Zhang
ff655d2a4e Apply binary compatibility plugin to Detekt (#3320)
* Apply binary compatibility plugin to Detekt

* Exclude internal api

* Add an additional new line

* Fix comment to point out the problem in gradle setup

* Remove TODO as forbidden comment
2020-12-30 22:03:45 +01:00
Artur Bosch
58575daddb Faster documentation generation (#2722)
* Get rid of cli and core dependency for generator

* Remove generic argument parsing made for sharing but introduced complexity

* Do not use expensive shadow plugin on internal generator module

* Apply shadow plugin for cli in packaging

* Generate documentation after compilation of rules

* Trigger generateDocumentation when formatting rules are changed

* Further reduce complexity of parsing args

* Start generateDocumentation directly from gradle

* Test additional error paths of CliArgs
2020-05-24 11:03:26 +02:00
Artur Bosch
502a14cee0 Modularize build script by introducing buildSrc module (#2621)
* Extract detekt related build logic to own script in buildSrc

* Add buildSrc/build folder to excludes

* Extract github release to own releasing build file

* Extract common and publishing build part

* Extract versions and sonar plugins to housekeeping script

* Move dokka plugin to buildSrc

* Move jacoco setup to commons plugin

* Automate version updates

* Rename publishing to packaging to avoid conflict with org.gradle.publishing

* Do not increment the version on build configuration phase

* State why build scan is left in settings build file

* Implement task to generate the doc version

* Implement task to update the self analysis version

* Revert dryRun
2020-04-20 16:02:31 +02:00
Artur Bosch
d55cdbfb06 Run code coverage as an own action (#2622)
* Run code coverage as an own action

* Apply jacoco to all sub projects
2020-04-19 20:34:01 +02:00
Brais Gabín
35068c1737 Generate the cli as a stand alone executable (#2607)
* Generate the cli as a stand alone executable

* Add stand-alone executable in the githubRelease
2020-04-18 15:26:54 +02:00
Artur Bosch
06260b1e62 Include statistics for our custom detekt tasks (#2554)
* Run detektFormat

* Activate statistics for custom detekt tasks
2020-03-31 20:52:08 +02:00
Artur Bosch
8a4855189b Refactor build file to sections (#2541)
* Move everything self analysis related to an own section

* Split top level gradle build file into more readable sections

* Extract common detekt configuration properties to constants

* Move jacoco config to own section
2020-03-28 21:15:22 +01:00
Artur Bosch
4008be3f5f Use kotlin-stdlib-jdk8 to reduce dependency conflicts - #2527 (#2538)
* Use kotlin-stdlib-jdk8 to reduce dependency conflicts - #2527

* Exclude transitive kotlin dependencies from html jvm lib - #2527
2020-03-28 13:33:52 +01:00
Artur Bosch
d5a59f3331 Prepare 1.7.1 release (#2517)
* Update dependencies for 1.7.1 release

* Delete obsolete ROADMAP file

* Update gradle wrapper to 6.3 supporting JDK14

* Use github-release plugin to publish changelogs to GitHub

* Use 1.7.1 gradle plugin for self analysis

* Use findProperty to force null on missing
2020-03-26 20:37:35 +01:00
Artur Bosch
eb9cf274fd Make the gradle plugin a sub project again (#2493)
* Convert the gradle plugin to a sub project

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

* Setup for easy local gradle plugin changes
2020-03-23 19:51:33 +01:00
Artur Bosch
74e86ccaa0 Add License rule (#2429)
* #1515. Add rule to check license header.

* TODO. Tests.

* Add location to `Config`.

* Set Config location.

* Implement license header caching based on a FileProcessListener

* Introduce new SetupContext api which is able to provide rule authors with processing settings like the configuration path

* Revert yaml config change

Co-authored-by: Denys M <dector9@gmail.com>
2020-03-15 09:05:20 +01:00
Artur Bosch
313632ba54 Stop compiling with experimental flag (#2404) 2020-03-05 12:08:00 +01:00
Artur Bosch
3275e8e124 Simplify test dependency setup in build files (#2278) 2020-01-19 21:00:07 +01:00
Artur Bosch
e827575288 Sanitize gradle build scripts (#2271) 2020-01-19 17:54:23 +01:00
Artur Bosch
239656f81f Document how to create a common baseline file for multi module gradle projects - Closes #2100 (#2140) 2019-12-28 21:37:10 +01:00
Igor Manushin
6816da044a Extract common jvm target value, add jvmTarget into documentation. Close #2157 (#2183) 2019-12-17 23:10:13 +01:00
Brais Gabín
d3b1de24b1 Don't compile test snippets (#2105)
* Don't compile the snippet codes in the test by default

If you want to check that your code in the snippets compiles you can use the flag
-Pcompile-test-snippets=true in gradle

* Configure travis and appvenyor to compile the snippets
2019-11-26 08:13:27 +01:00
Matthew Haughton
b75cf4227a Migrate to Gradle 6 (#1902)
* Gradle 6

* Remove ProjectLayout.fileProperty usage

Removed in Gradle 6

* Remove deprecated inputs

* Fix validateTaskProperties issues

* Remove unnecessary extension

* Use new plugin validation task name

* Simplify docs
2019-11-25 20:11:08 +01:00
Matthew Haughton
72f2225d7f Fix issues running detektMain/detektTest tasks (#2069) 2019-10-30 09:07:02 +11:00
M Schalk
b048c6bbfd Upgrade Spek to v2.0.8 (#1992)
* Upgrade Spek to v2.0.8

* Disable Spek timeouts

* Fix Spek exceptions with by memoized clause

'subject' can not be accessed in this context.
java.lang.AssertionError: 'subject' can not be accessed in this context.

* Use a Spek fixture for holding the result

The tests don't use memoized for holding the result of subject.lint().
Instead the tests use a fixture for holding the linted code.
https://www.spekframework.org/core-concepts/#scope-values
2019-10-12 23:26:08 +11:00
Artur Bosch
ed77f0c9eb Remove debug flag as console reports and configuration are stable (#1857) 2019-08-29 11:12:42 +02:00
Matthew Haughton
383a1e0246 Gradle 5.6 (#1833)
* Gradle 5.6

* Define plugin versions in gradle.properties

* Work around Gradle 6 behaviour change

In Gradle 6 the default DuplicateStrategy is FAIL. This reverts to previous
behaviour to avoid an error due to two ktlint rulesets declaring a
RuleSetProvider service which, when merged, results in duplicate paths.
These files have no effect in detekt so the duplication can be ignored.

The duplicate path is "META-INF/services/com.pinterest.ktlint.core.RuleSetProvider"

* Fix issues found by :detekt-gradle-plugin:validateTaskProperties
2019-08-25 16:00:14 +10:00
M Schalk
09e7a143de Update Kotlin to v1.3.50 (#1841) 2019-08-25 08:34:13 +10:00
Matthew Haughton
aabbcd8899 Tidy the build files (#1814)
* Remove explicit dependency on compiler-embeddable

* Remove unnneeded task dependency

* Tidy up setting the Bintray user/pass

* Use type-safe accessors where possible

* Use tidy syntax

* Remove unused lines

* Remove unused repositories

* Avoid task configuration
2019-08-13 19:54:07 +02:00
M Schalk
e087d221de Update dependency versions (#1815) 2019-08-13 19:49:59 +02:00
Matthew Haughton
acf2e3b7b0 Gradle plugin: Set default path for "config" parameter (#1801)
* Generate default config at user-specified path

* Set a default path for detekt's config file

* Write default config file to default config path

* Update config to use new config layout convention

* Update baseline file location

* Catch possible error if `config` collection is not expected size
2019-08-04 14:18:26 +02:00
Matthew Haughton
d055765272 Gradle plugin: Fix visibility of internal properties (#1789)
* Correct visibility of internal properties

* Ensure validateTaskProperties task passes during build

* Correct issues flagged by validateTaskProperties task
2019-07-30 20:20:41 +02:00
Matthew Haughton
a84f1a30d7 Provide default value for ignoreFailures (#1787)
* Use Property's setter instead of using an extra one

* ignoreFailures isn't Optional

It must always have a value.

* Remove explicit setting for ignoreFailures
2019-07-28 11:19:48 +02:00
Nuno Caro
ee0ebca174 Adds TXT report support on gradle plugin (#1742)
* Adds support for TXT report on gradle plugin

* Updates changelog file

* Adds TXT report to the documentation md
2019-07-16 12:51:59 +02:00
Nicola Corti
b5844819d1 Update Kotlin to 1.3.41 (#1759) 2019-07-08 11:44:51 +10:00
Matthew Haughton
5948565c07 Use Codecov's recommended JaCoCo config (#1739)
https://github.com/codecov/example-gradle
2019-06-30 13:14:09 +02:00