From ff712787c1502aa11666c26e3535a775e5426d42 Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Fri, 9 Nov 2018 23:02:25 +0100 Subject: [PATCH 1/4] Prepare for release 0.7 --- CHANGELOG.md | 11 ++++++++++- README.md | 4 ++-- gradle/publish.gradle | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c01ea1..ef51e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,19 @@ Change Log ========== +[Version 0.7](https://github.com/novoda/gradle-static-analysis-plugin/releases/tag/v0.7) +-------------------------- + +- Fix Detekt RC9.x and RC10 integrations [PR#144](https://github.com/novoda/gradle-static-analysis-plugin/pull/144) +- Fix Ktlint integration [PR#145](https://github.com/novoda/gradle-static-analysis-plugin/pull/145) + - 6.1.0 and 6.2.1 versions are broken for Android plugins because of [a bug in Ktlint](https://github.com/JLLeitschuh/ktlint-gradle/issues/153#issuecomment-437176852) +- Use Gradle composite builds in sample projects [PR#142](https://github.com/novoda/gradle-static-analysis-plugin/pull/142) +- Improve docs [PR#128](https://github.com/novoda/gradle-static-analysis-plugin/pull/128), [PR#132](https://github.com/novoda/gradle-static-analysis-plugin/pull/132) + [Version 0.6](https://github.com/novoda/gradle-static-analysis-plugin/releases/tag/v0.6) -------------------------- -- Fix release to plugin portal ([PR#82](https://github.com/novoda/gradle-static-analysis-plugin/pull/82),[PR#83](https://github.com/novoda/gradle-static-analysis-plugin/pull/83)) +- Fix release to plugin portal ([PR#82](https://github.com/novoda/gradle-static-analysis-plugin/pull/82), [PR#83](https://github.com/novoda/gradle-static-analysis-plugin/pull/83)) - Improve plugin documentation and samples ([PR#85](https://github.com/novoda/gradle-static-analysis-plugin/pull/85), [PR#97](https://github.com/novoda/gradle-static-analysis-plugin/pull/97), [PR#99](https://github.com/novoda/gradle-static-analysis-plugin/pull/99), diff --git a/README.md b/README.md index 5c29744..be9e7de 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.novoda:gradle-static-analysis-plugin:0.6' + classpath 'com.novoda:gradle-static-analysis-plugin:0.7' } } @@ -52,7 +52,7 @@ or from the [Gradle Plugins Repository](https://plugins.gradle.org/): ```gradle plugins { - id 'com.novoda.static-analysis' version '0.6' + id 'com.novoda.static-analysis' version '0.7' } ``` diff --git a/gradle/publish.gradle b/gradle/publish.gradle index f3effe5..473f561 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -2,7 +2,7 @@ ext { websiteUrl = 'https://github.com/novoda/gradle-static-analysis-plugin' } -version = '0.6' +version = '0.7' String tag = "v$project.version" groovydoc.docTitle = 'Static Analysis Plugin' From de3f115c62700b1abe9fb00fc1c61ea4c69a6013 Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Fri, 9 Nov 2018 23:26:55 +0100 Subject: [PATCH 2/4] update samples to use the new plugin --- sample-multi-module/app/build.gradle | 1 - sample-multi-module/build.gradle | 9 +++++---- sample-multi-module/core/build.gradle | 10 ---------- .../team-props/static-analysis.gradle | 4 +++- sample/app/build.gradle | 17 ++++++----------- sample/build.gradle | 5 +++-- 6 files changed, 17 insertions(+), 29 deletions(-) diff --git a/sample-multi-module/app/build.gradle b/sample-multi-module/app/build.gradle index 263b25d..4513420 100644 --- a/sample-multi-module/app/build.gradle +++ b/sample-multi-module/app/build.gradle @@ -4,7 +4,6 @@ apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 27 - buildToolsVersion '27.0.3' defaultConfig { applicationId 'com.novoda.staticanalysis.sample' diff --git a/sample-multi-module/build.gradle b/sample-multi-module/build.gradle index 4267b26..70628e7 100644 --- a/sample-multi-module/build.gradle +++ b/sample-multi-module/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.2.60' + ext.kotlin_version = '1.3.0' repositories { google() @@ -7,13 +7,14 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.novoda:gradle-static-analysis-plugin:local' - classpath 'gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC9' - classpath 'gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:5.0.0' + classpath 'io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0-RC10' + classpath 'gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:5.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } +ext.ReporterType = org.jlleitschuh.gradle.ktlint.reporter.ReporterType apply from: rootProject.file('team-props/tasks.gradle') diff --git a/sample-multi-module/core/build.gradle b/sample-multi-module/core/build.gradle index 2d9c112..b989299 100644 --- a/sample-multi-module/core/build.gradle +++ b/sample-multi-module/core/build.gradle @@ -1,16 +1,6 @@ apply plugin: 'java-library' apply plugin: 'kotlin' -buildscript { - ext.kotlin_version = '1.2.30' - repositories { - mavenCentral() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - repositories { mavenCentral() } diff --git a/sample-multi-module/team-props/static-analysis.gradle b/sample-multi-module/team-props/static-analysis.gradle index e5f1a5e..3a9f7be 100644 --- a/sample-multi-module/team-props/static-analysis.gradle +++ b/sample-multi-module/team-props/static-analysis.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.novoda.static-analysis' apply plugin: 'io.gitlab.arturbosch.detekt' -apply plugin: "org.jlleitschuh.gradle.ktlint" +apply plugin: 'org.jlleitschuh.gradle.ktlint' staticAnalysis { @@ -39,6 +39,8 @@ staticAnalysis { } ktlint { + reporters = [ReporterType.CHECKSTYLE] + includeVariants { variant -> variant.name.contains('debug') } } } diff --git a/sample/app/build.gradle b/sample/app/build.gradle index 70bd65d..3743065 100755 --- a/sample/app/build.gradle +++ b/sample/app/build.gradle @@ -1,6 +1,8 @@ +import org.jlleitschuh.gradle.ktlint.reporter.ReporterType + plugins { - id 'io.gitlab.arturbosch.detekt' version '1.0.0.RC9' - id "org.jlleitschuh.gradle.ktlint" version "5.0.0" + id 'io.gitlab.arturbosch.detekt' version '1.0.0-RC10' + id "org.jlleitschuh.gradle.ktlint" } apply plugin: 'com.android.application' @@ -18,15 +20,6 @@ android { versionCode 1 versionName '1.0' } - - buildTypes { - debug { - } - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } } dependencies { @@ -73,6 +66,8 @@ staticAnalysis { ktlint { android true + reporters = [ReporterType.CHECKSTYLE] + includeVariants { variant -> variant.name.contains('debug') } } } diff --git a/sample/build.gradle b/sample/build.gradle index b31044a..e806ef9 100755 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.2.60' + ext.kotlin_version = '1.3.0' repositories { google() @@ -7,9 +7,10 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.novoda:gradle-static-analysis-plugin:local' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:5.1.0' } } From c667a8e13733b8f8120fd33126828d687aca5a28 Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Sat, 10 Nov 2018 11:43:22 +0100 Subject: [PATCH 3/4] Update changelog with info about the cache --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef51e67..bd77785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Change Log - Fix Detekt RC9.x and RC10 integrations [PR#144](https://github.com/novoda/gradle-static-analysis-plugin/pull/144) - Fix Ktlint integration [PR#145](https://github.com/novoda/gradle-static-analysis-plugin/pull/145) - 6.1.0 and 6.2.1 versions are broken for Android plugins because of [a bug in Ktlint](https://github.com/JLLeitschuh/ktlint-gradle/issues/153#issuecomment-437176852) +- Make Findbugs Html report generation cacheable [PR#148](https://github.com/novoda/gradle-static-analysis-plugin/pull/148) - Use Gradle composite builds in sample projects [PR#142](https://github.com/novoda/gradle-static-analysis-plugin/pull/142) - Improve docs [PR#128](https://github.com/novoda/gradle-static-analysis-plugin/pull/128), [PR#132](https://github.com/novoda/gradle-static-analysis-plugin/pull/132) From ab3c47ef8234c57a793536b06e44d54344d535d5 Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Sat, 10 Nov 2018 11:49:16 +0100 Subject: [PATCH 4/4] Added known issues section --- CHANGELOG.md | 2 +- docs/tools/ktlint.md | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd77785..98a3d2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Change Log - Fix Detekt RC9.x and RC10 integrations [PR#144](https://github.com/novoda/gradle-static-analysis-plugin/pull/144) - Fix Ktlint integration [PR#145](https://github.com/novoda/gradle-static-analysis-plugin/pull/145) - - 6.1.0 and 6.2.1 versions are broken for Android plugins because of [a bug in Ktlint](https://github.com/JLLeitschuh/ktlint-gradle/issues/153#issuecomment-437176852) + - 6.1.0 and 6.2.1 versions are broken for Android projects because of [a bug in Ktlint](https://github.com/JLLeitschuh/ktlint-gradle/issues/153#issuecomment-437176852) - Make Findbugs Html report generation cacheable [PR#148](https://github.com/novoda/gradle-static-analysis-plugin/pull/148) - Use Gradle composite builds in sample projects [PR#142](https://github.com/novoda/gradle-static-analysis-plugin/pull/142) - Improve docs [PR#128](https://github.com/novoda/gradle-static-analysis-plugin/pull/128), [PR#132](https://github.com/novoda/gradle-static-analysis-plugin/pull/132) diff --git a/docs/tools/ktlint.md b/docs/tools/ktlint.md index f804859..9232242 100644 --- a/docs/tools/ktlint.md +++ b/docs/tools/ktlint.md @@ -1,11 +1,11 @@ # ktlint [Ktlint](https://github.com/shyiko/ktlint) is a linter for Kotlin with a built-in formatter. It does not support Java. Adding -this tool only makes sense when you have Kotlin sources in your project. In fact, it will fail to run if you have 0 Kotlin -files. +this tool only makes sense when you have Kotlin sources in your project. ## Table of contents * [IMPORTANT: setup Ktlint](#important-setup-ktlint) * [Configure Ktlint](#configure-ktlint) + * [Known Issues](#known-issues) --- ## IMPORTANT: setup Ktlint @@ -25,7 +25,7 @@ In most common cases, adding Ktlint to a project boils down to these simple step 1. Add this statement to your root `build.gradle` project (change the version according to your needs): ```gradle plugins { - id 'org.jlleitschuh.gradle.ktlint' version '5.0.0' + id 'org.jlleitschuh.gradle.ktlint' version '5.1.0' // ... } ``` @@ -56,3 +56,9 @@ For other configuration options and adding custom rules, refer to the **Note:** Failures and threshold detection is handled by Static Analysis plugin. That is why `ignoreFailures = true` is set by the plugin. Please do not manually override `ignoreFailures` property. + +## Known Issues + +6.1.0 and 6.2.1 versions are broken for Android projects because of [a bug in Ktlint](https://github.com/JLLeitschuh/ktlint-gradle/issues/153#issuecomment-437176852) + +Because of a behavior change, the `main` sourceSet is not checked. We recommend to use the version 5.1.0 and before.