Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Update samples with the latest changes. #123

Merged
merged 1 commit into from Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions sample-multi-module/build.gradle
@@ -1,21 +1,22 @@
buildscript {
ext.kotlin_version = '1.2.30'
ext.kotlin_version = '1.2.60'

repositories {
google()
maven { url "https://plugins.gradle.org/m2/" }
gradlePluginPortal()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC6-3"
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC8'
classpath 'gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:5.0.0'
}
}

apply from: "$rootDir/team-props/tasks.gradle"
apply from: rootProject.file('team-props/tasks.gradle')

subprojects { subproject ->
subprojects {

buildscript {
repositories {
Expand All @@ -26,5 +27,6 @@ subprojects { subproject ->
repositories {
google()
mavenCentral()
jcenter()
}
}
Binary file modified sample-multi-module/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions sample-multi-module/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Mon Mar 12 18:00:46 GMT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
11 changes: 0 additions & 11 deletions sample-multi-module/team-props/detekt-config.yml
@@ -1,5 +1,4 @@
autoCorrect: true
failFast: false

test-pattern:
active: true
Expand All @@ -19,16 +18,6 @@ test-pattern:
- 'SpreadOperator'
- 'TooManyFunctions'

build:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong and already something we mention in the advanced docs

warningThreshold: 5
failThreshold: 500
maxIssues: 500
weights:
complexity: 2
LongParameterList: 1
style: 1
comments: 1

processors:
active: true

Expand Down
4 changes: 0 additions & 4 deletions sample-multi-module/team-props/findbugs-excludes.xml
Expand Up @@ -9,8 +9,4 @@
</Or>
</Match>

<Match>
<Source name="~.*\.kt" />
</Match>

</FindBugsFilter>
1 change: 0 additions & 1 deletion sample-multi-module/team-props/pmd-rules.xml
Expand Up @@ -5,7 +5,6 @@
<description>Mandatory PMD rules description.</description>

<!--region File exclusions-->
<exclude-pattern>.*\.kt</exclude-pattern>
<exclude-pattern>.*\.R\$.*</exclude-pattern>
<!--endregion-->

Expand Down
6 changes: 5 additions & 1 deletion sample-multi-module/team-props/static-analysis.gradle
@@ -1,5 +1,6 @@
apply plugin: com.novoda.staticanalysis.StaticAnalysisPlugin
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: "org.jlleitschuh.gradle.ktlint"

staticAnalysis {

Expand All @@ -8,7 +9,6 @@ staticAnalysis {
checkstyle {
toolVersion '8.8'
exclude project.fileTree('src/test/java')
exclude '**/*.kt'
configFile rootProject.file('team-props/checkstyle-modules.xml')
includeVariants { variant -> variant.name.contains('debug') }
}
Expand Down Expand Up @@ -41,4 +41,8 @@ staticAnalysis {
output = project.file("build/reports/detekt")
}
}

ktlint {
includeVariants { variant -> variant.name.contains('debug') }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come? I understand this may be ok to speed up sample builds but I fear people will just copy-paste this into their own projects and end up not having coverage for release sourcesets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha 🙂 just copy pasted from above.

I do believe that people copy paste these. But keep in mind that this is the variant. So debug and main source folders are checked.

I would say let's merge this and create a new issue overall to discuss what is the best practice here and update all of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but that means release is not checked :P Anyway if we're doing this above too let's just ship it for now, please create an issue to track that we need a better approach (even just a comment would help I think)

}
}
11 changes: 7 additions & 4 deletions sample/app/build.gradle
@@ -1,5 +1,6 @@
plugins {
id 'io.gitlab.arturbosch.detekt' version '1.0.0.RC6-3'
id 'io.gitlab.arturbosch.detekt' version '1.0.0.RC8'
id "org.jlleitschuh.gradle.ktlint" version "5.0.0"
}

apply plugin: 'com.android.application'
Expand All @@ -9,7 +10,6 @@ apply plugin: com.novoda.staticanalysis.StaticAnalysisPlugin

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
applicationId 'com.novoda.staticanalysis.sample'
Expand All @@ -30,7 +30,7 @@ android {
}

dependencies {
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
}
Expand All @@ -42,7 +42,6 @@ staticAnalysis {
checkstyle {
toolVersion '8.8'
exclude project.fileTree('src/test/java')
exclude '**/*.kt'
configFile rootProject.file('team-props/checkstyle-modules.xml')
includeVariants { variant -> variant.name.contains('debug') }
}
Expand Down Expand Up @@ -76,4 +75,8 @@ staticAnalysis {
}
}

ktlint {
android true
includeVariants { variant -> variant.name.contains('debug') }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here

}
}
7 changes: 4 additions & 3 deletions sample/build.gradle
@@ -1,13 +1,13 @@
buildscript {
ext.kotlin_version = '1.2.30'
ext.kotlin_version = '1.2.60'

repositories {
google()
maven { url "https://plugins.gradle.org/m2/" }
gradlePluginPortal()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -16,5 +16,6 @@ subprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
Binary file modified sample/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions sample/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Mon Mar 12 18:00:46 GMT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
11 changes: 0 additions & 11 deletions sample/team-props/detekt-config.yml
@@ -1,5 +1,4 @@
autoCorrect: true
failFast: false

test-pattern:
active: true
Expand All @@ -19,16 +18,6 @@ test-pattern:
- 'SpreadOperator'
- 'TooManyFunctions'

build:
warningThreshold: 5
failThreshold: 10
maxIssues: 10
weights:
complexity: 2
LongParameterList: 1
style: 1
comments: 1

processors:
active: true

Expand Down
4 changes: 0 additions & 4 deletions sample/team-props/findbugs-excludes.xml
Expand Up @@ -9,8 +9,4 @@
</Or>
</Match>

<Match>
<Source name="~.*\.kt" />
</Match>

</FindBugsFilter>
1 change: 0 additions & 1 deletion sample/team-props/pmd-rules.xml
Expand Up @@ -5,7 +5,6 @@
<description>Mandatory PMD rules description.</description>

<!--region File exclusions-->
<exclude-pattern>.*\.kt</exclude-pattern>
<exclude-pattern>.*\.R\$.*</exclude-pattern>
<!--endregion-->

Expand Down