Commit Graph

202 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
Matthew Haughton
e9d26d09af Disable Gradle's configuration cache by default (#4668)
There are issues that don't have workarounds at this stage. Check again when Gradle 7.5 released.
2022-04-03 10:40:47 -07:00
Matthew Haughton
7d87c80e24 Enable Gradle's configuration cache by default (#4576)
* Flag tasks known to be incompatible with Gradle's configuration cache

* Enable Gradle's configuration cache by default
2022-02-09 21:06:14 +11:00
Matthew Haughton
c84834165a GitHub Actions tweaks (#4194)
* Update to setup-java@v2

Missed in #3704

* Use consistent file encoding across builds

This changes to use the recommended config from
https://docs.gradle.org/7.0/userguide/common_caching_problems.html#system_file_encoding

* Don't disable build cache when generating JaCoCo merged report

* Don't set JDK_VERSION env var

This is unnecessary as it isn't used anywhere in the build.

* Remove redundant setup-java action from FOSSA scan workflow

* Ignore the whole FOSSA scan workflow in forks

This ignores the whole job instead of just the fossa-scan action, since we
don't need to run any part of the job in forks of detekt.
2021-10-21 18:58:54 +11:00
Chao Zhang
0721351b9e Upscale JVM settings (#4057) 2021-08-19 09:49:56 -07:00
Matthew Haughton
294c408cb4 (Try to) improve CI build reliability (#3703)
* Only test a single older Gradle version

All other tests are run on the current Gradle wrapper version, so there's
no need to also test a recent version in this test.

* Don't spawn more workers than # CPUs

There are only 2 CPUs on Linux & Windows CI hosts, 3 on macOS, and
unknown on contributor's machines. Let Gradle pick an appropriate
default.

* Remove unneeded Gradle cache cleanup task

Issue https://github.com/detekt/detekt/pull/2547#issuecomment-605611809
has been fixed.
2021-05-06 11:56:51 +10:00
Artur Bosch
a04171a1d8 Update Kotlin to 1.4.21 (#3254)
* Update Kotlin to 1.4.20

* Update assertj to 3.18.1

* Fix type V but V!! expected compilation errors with 1.4.20

* Remove workaround for old dokka plugin

* Update to Kotlin 1.4.21

* Use jdk8 compatible mockk version

* Update mock to version 1.10.4

* Specify source and target 1.8 java version for KotlinCompile tasks

* Remove shadowJarExecutable as it does not work with newest Kotlin compiler (1.4.20+)

* Simplify copying jars for CI by reusing copy task

* Update cli guide to always use the zip distribution

* fixup! Simplify copying jars for CI by reusing copy task

Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
2021-01-19 21:17:58 +01:00
Nicola Corti
096883fd74 Enabled publishing of sha256 and sha512 signatures (#3249) 2020-11-26 17:10:27 +01:00
Artur Bosch
ee49144114 Support Kotlin 1.4 (#2981)
* Update to Gradle 6.6

* Update to Kotlin 1.4

* Upgrade to prerelease of KtLint 0.38

* Fix testcase by unwrapping the original descriptor

* Increase max heap for dokka on Java 11

* Update minimal supported Gradle version to 5.3

* Do not run warningsAsErrors on CI due to Gradle not supporting Kotlin 1.4

* Remove new line testing as it fails on windows

* Require Gradle 5.4 to reflect Kotlin's required version from their website
2020-08-20 20:00:38 +02:00
Artur Bosch
c526ec63f5 Test performance improvements (#2921)
* Use max 4 workers, test discovery slows down parallel workers

* Use a spek snapshot to improve test discovery time

* Introduce an api test fixture for modules needing just an analysis result

* Use api test fixture in html module

* Use api test fixtures in report-xml module

* Use api test fixtures in metrics module

* Use api test fixtures in core module

* Use single-threaded classpath scanning

* Do not create a kotlin environment upfront

* Move mockk usage to execution phase

* Move KtCompiler creation to execution phase

* Move setup code to execution phase in api module

* Move setup code to execution phase in core module

* Move setup code to execution phase in rules-empty module
2020-08-02 12:32:29 +02:00
Nicola Corti
b24851df38 Publish to Bintray using maven-publish (#2885)
* Publish to Bintray using maven-publish

* Removed unused variable
2020-07-21 17:23:59 +02:00
Artur Bosch
84fb690ffe Run in parallel by default (#2773)
* Run in parallel by default

* Remove --parallel and --build-cache flags from ci as they are now handled by gradle.properties
2020-06-05 20:26:35 +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
Nicola Corti
c5aa152ced Kotlin to 1.3.72 (#2619)
Let's keep Kotlin up-to-date
2020-04-19 11:44:45 +02:00
Artur Bosch
b037a5534c Prepare 1.7.4 release (#2577) 2020-04-03 22:23:16 +02:00
Artur Bosch
c19a2a73e5 Prepare 1.7.3 release (#2569) 2020-04-02 11:59:12 +02:00
Artur Bosch
61e1882d8c Prepare 1.7.2 release (#2543) 2020-03-28 14:45:48 +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
34ccbc434f Update Kotlin to 1.3.71 (#2507) 2020-03-26 16:51:26 +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
1870d0ba37 Prepare 1.7.0 release (#2481) 2020-03-22 12:27:14 +01:00
Artur Bosch
90d426a332 Prepare 1.7.0-beta2 release (#2434)
* Prepare 1.7.0-beta2 release

* Prepare 1.7.0-beta2 Gradle plugin release
2020-03-15 20:56:10 +01:00
M Schalk
e2da7bab8f Update Spek version to 2.0.10 (#2418)
Release notes:
https://github.com/spekframework/spek/releases/tag/2.0.10
2020-03-09 00:50:11 +11:00
Artur Bosch
4ea5873cde Release 1.7.0 beta (#2409)
* Prepare 1.7.0-beta1 release

* Use 1.7.0-beta1 for self analysis
2020-03-05 14:26:40 +01:00
Artur Bosch
f0e1fab1a7 Update to Kotlin v1.3.70 (#2396)
* Update to Kotlin v1.3.70

ChangeLog
https://github.com/JetBrains/kotlin/blob/1.3.70/ChangeLog.md

* Update Gradle plugins Kotlin version to 1.3.70

* Fix Kotlin 1.3.70 compiler deprecations

Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
2020-03-04 09:49:56 +01:00
Artur Bosch
23d172e22f Update Gradle to 6.2.1 (#2390) 2020-03-03 11:27:13 +01:00
Artur Bosch
4bb96f714a Prepare 1.6.0 release (#2373) 2020-02-26 20:04:40 +01:00
Igor Manushin
25a8555c03 Bump versions (#2346)
* bump versions

* fix deprecation warnings
2020-02-15 22:47:28 +01:00
Artur Bosch
58d59a213a Prepare 1.5.1 release (#2313) 2020-02-05 09:44:28 +01:00
Artur Bosch
6cdc57538f Prepare 1.5.0 gradle (#2297)
* Prepare 1.5.0 gradle plugin release

* Use 1.5.0 for self analysis

* Do not assert number of classes messages on the output anymore

As we have changed detekt to be silent by default, the number of classes in not printed anymore.
We are testing the multi module integration and assert if detekt creates all different kind of reports. Testing the number of classes should not be the primary goal of this test cases.

* Update gradle to 6.1.1
2020-01-28 21:46:39 +01:00
Artur Bosch
54044072b7 Prepare 1.5.0 release (#2296)
* Prepare 1.5.0 release

* Update docs/pages/changelog 1.x.x.md

Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com>

* Update docs/pages/changelog 1.x.x.md

Co-Authored-By: M Schalk <30376729+schalkms@users.noreply.github.com>

Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
2020-01-28 18:30:11 +01:00
Artur Bosch
eda63c621d Prepare 1.4.0 release (#2251) 2020-01-12 19:22:18 +01:00
Matthew Haughton
bb69ec1928 Bump dependencies (#2225) 2020-01-07 11:54:26 +01:00
Artur Bosch
33d454ddb0 Prepare 1.3.1 release (#2211) 2019-12-29 10:31:45 +01:00
Artur Bosch
e8ec25b99b Prepare 1.3.0 release (#2165) 2019-12-22 11:58:02 +01:00
M Schalk
280eab8adb Update Spek to v2.0.9 (#2173)
Changelog:
https://github.com/spekframework/spek/releases/tag/2.0.9
2019-12-12 15:46:24 +11:00
M Schalk
074c06548a Update to Kotlin v1.3.61 (#2147)
Release notes:
https://github.com/JetBrains/kotlin/releases/tag/v1.3.61
2019-12-01 15:23:49 +11:00
Artur Bosch
e67025d60d Prepare 1.2.1 release (#2145) 2019-11-30 10:26:31 +01:00
Matthew Haughton
55560bb9b4 Kotlin 1.3.60 with fix for "Unable to load JNA library" warning (#2129)
* Update KotlinEnvironmentUtils.kt

* Kotlin 1.3.60

* Kotlin 1.3.60

* Update KotlinEnvironmentUtils.kt
2019-11-26 07:52:11 +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
Artur Bosch
30952b3214 Prepare 1.2.0 release (#2092)
* Update dependencies for 1.2.0

* Generate release notes for 1.2.0

* Checkin cyclomatic complexity documentation

* Update changelog to actual master and consider reverting formatting baseline changes

* Downgrade kotlin version to 1.3.50 to strange JNA warnings which may confuse users
2019-11-23 22:14:23 +01:00
M Schalk
d5e5e3bd53 Update to Kotlin v1.3.60 (#2109)
Changelog:
https://github.com/JetBrains/kotlin/blob/1.3.60/ChangeLog.md
2019-11-21 12:43:15 +11:00
Matthew Haughton
f5a8086bd1 Update dependencies (#2031)
* Update dependencies

* Remove usage of deprecated `before` method

* Regenerate docs
2019-10-29 07:34:51 +01:00
M Schalk
675fd12feb Introduces mocking library 'mockk' (#2055)
This removes some boilerplate code from the HtmlOuputFormatTest
introduced by #1975.
2019-10-27 12:20:36 +01: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
13637bf868 Prepare 1.1.1 bugfix release (#2004) 2019-10-10 10:56:19 +02:00
Artur Bosch
1a2be5156a Prepare 1.1.0 release (#1919) 2019-10-05 16:24:11 +02:00
M Schalk
76c2bd2c02 Fix TimeoutCancellationException - downgrade Spek (#1903)
Spek 2.0.3 introduced test timeouts.
(https://github.com/spekframework/spek/releases/tag/2.0.3)

The default timeout is 10 seconds per test case.
Detekt's rule-tests easily reach this limit when

1. setting up 8 `KotlinScriptEngine's` for compiling test snippets.
2. the (CI) machines are under heavy load

This results in the following exception as happened in commit 9691e0d.
kotlinx.coroutines.TimeoutCancellationException: 
Timed out waiting for 10000 ms

Unfortunately, Spek doesn't allow to set a global timeout (yet).
See: https://github.com/spekframework/spek/issues/769
Setting a custom timeout on each test block is not what we want.
Therefore, this commit downgrades Spek to version 2.0.2.
2019-09-08 23:20:47 +10:00
M Schalk
9691e0d8bc Update dependencies (#1901)
* Update Spek version

* Update AssertJ version
2019-09-08 19:23:32 +10:00