Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Commit

Permalink
2020-01-28 Version 1.0.1: Added CPD integration and updated Gradle ve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
fartem committed Jan 28, 2020
1 parent 236f290 commit c10dfbe
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 18 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ before_install:

script:
- ./gradlew detekt
- ./gradlew cpdCheck
- ./gradlew test
20 changes: 3 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply from: 'detekt.gradle'
apply from: 'cpd.gradle'

android {
compileSdkVersion 29
Expand All @@ -15,21 +16,6 @@ android {
}
}

detekt {
failFast = true

def detektConfig = new File("$rootDir/detekt-config.yml")
new URL(
"https://raw.githubusercontent.com/fartem/repository-rules/master/kotlin/detekt/detect.yml"
).withInputStream {
i -> detektConfig.withOutputStream {
it << i
}
}
config = files(detektConfig)
filters = ".*build.*,.*/resources/.*,.*/tmp/.*,*.java"
}

dependencies {
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

Expand All @@ -39,5 +25,5 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

// Unit tests
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13'
}
10 changes: 10 additions & 0 deletions app/cpd.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apply plugin: 'cpd'

cpd {
language = 'kotlin'
toolVersion = '6.21.0'
}

cpdCheck {
source = files('src/main/java/')
}
16 changes: 16 additions & 0 deletions app/detekt.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apply plugin: 'io.gitlab.arturbosch.detekt'

detekt {
failFast = true

def detektConfig = new File("$rootDir/detekt-config.yml")
new URL(
"https://raw.githubusercontent.com/fartem/repository-rules/master/kotlin/detekt/detect.yml"
).withInputStream {
i -> detektConfig.withOutputStream {
it << i
}
}
config = files(detektConfig)
filters = ".*build.*,.*/resources/.*,.*/tmp/.*,*.java"
}
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "de.aaschmid:gradle-cpd-plugin:3.1"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip

0 comments on commit c10dfbe

Please sign in to comment.