mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-14 00:17:15 +03:00
Add common configuration for kotlin modules.
This commit is contained in:
parent
4c0e55ccdd
commit
8f65b37605
@ -25,7 +25,7 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: unit-tests
|
name: unit-tests
|
||||||
command: |
|
command: |
|
||||||
./gradlew :subsonic-api:test :cache:test :subsonic-api-image-loader:testDebugUnitTest :ultrasonic:testDebugUnitTest
|
./gradlew ciTest :ultrasonic:testDebugUnitTest
|
||||||
./gradlew jacocoFullReport
|
./gradlew jacocoFullReport
|
||||||
bash <(curl -s https://codecov.io/bash)
|
bash <(curl -s https://codecov.io/bash)
|
||||||
- run:
|
- run:
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
apply from: 'dependencies.gradle'
|
apply from: 'dependencies.gradle'
|
||||||
|
|
||||||
|
ext.bootstrap = [
|
||||||
|
kotlinModule : "${project.rootDir}/gradle_scripts/kotlin-module-bootstrap.gradle",
|
||||||
|
]
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
google()
|
google()
|
||||||
|
35
cache/build.gradle
vendored
35
cache/build.gradle
vendored
@ -1,11 +1,7 @@
|
|||||||
apply plugin: 'java-library'
|
apply from: bootstrap.kotlinModule
|
||||||
apply plugin: 'kotlin'
|
|
||||||
apply plugin: 'jacoco'
|
|
||||||
apply from: '../gradle_scripts/code_quality.gradle'
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':domain')
|
api project(':domain')
|
||||||
api other.kotlinStdlib
|
|
||||||
api other.twitterSerial
|
api other.twitterSerial
|
||||||
|
|
||||||
testImplementation testing.junit
|
testImplementation testing.junit
|
||||||
@ -15,32 +11,3 @@ dependencies {
|
|||||||
testImplementation testing.mockitoKotlin
|
testImplementation testing.mockitoKotlin
|
||||||
testImplementation testing.kluent
|
testImplementation testing.kluent
|
||||||
}
|
}
|
||||||
|
|
||||||
jacoco {
|
|
||||||
toolVersion(versions.jacoco)
|
|
||||||
}
|
|
||||||
|
|
||||||
ext {
|
|
||||||
jacocoExclude = []
|
|
||||||
}
|
|
||||||
|
|
||||||
jacocoTestReport {
|
|
||||||
reports {
|
|
||||||
html.enabled true
|
|
||||||
csv.enabled false
|
|
||||||
xml.enabled true
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate {
|
|
||||||
classDirectories = files(classDirectories.files.collect {
|
|
||||||
fileTree(dir: it, excludes: jacocoExclude)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
test.finalizedBy jacocoTestReport
|
|
||||||
test {
|
|
||||||
jacoco {
|
|
||||||
excludes += jacocoExclude
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,38 +1,5 @@
|
|||||||
apply plugin: 'java-library'
|
apply from: bootstrap.kotlinModule
|
||||||
apply plugin: 'kotlin'
|
|
||||||
apply plugin: 'jacoco'
|
|
||||||
apply from: '../gradle_scripts/code_quality.gradle'
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api other.kotlinStdlib
|
|
||||||
api other.semver
|
api other.semver
|
||||||
}
|
}
|
||||||
|
|
||||||
jacoco {
|
|
||||||
toolVersion(versions.jacoco)
|
|
||||||
}
|
|
||||||
|
|
||||||
ext {
|
|
||||||
jacocoExclude = []
|
|
||||||
}
|
|
||||||
|
|
||||||
jacocoTestReport {
|
|
||||||
reports {
|
|
||||||
html.enabled true
|
|
||||||
csv.enabled false
|
|
||||||
xml.enabled true
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate {
|
|
||||||
classDirectories = files(classDirectories.files.collect {
|
|
||||||
fileTree(dir: it, excludes: jacocoExclude)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
test.finalizedBy jacocoTestReport
|
|
||||||
test {
|
|
||||||
jacoco {
|
|
||||||
excludes += jacocoExclude
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
53
gradle_scripts/kotlin-module-bootstrap.gradle
Normal file
53
gradle_scripts/kotlin-module-bootstrap.gradle
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
apply plugin: 'java-library'
|
||||||
|
apply plugin: 'kotlin'
|
||||||
|
apply plugin: 'jacoco'
|
||||||
|
apply from: "${project.rootDir}/gradle_scripts/code_quality.gradle"
|
||||||
|
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main.java.srcDirs += "${projectDir}/src/main/kotlin"
|
||||||
|
test.java.srcDirs += "${projectDir}/src/test/kotlin"
|
||||||
|
test.java.srcDirs += "${projectDir}/src/integrationTest/kotlin"
|
||||||
|
test.resources.srcDirs += "${projectDir}/src/integrationTest/resources"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api other.kotlinStdlib
|
||||||
|
}
|
||||||
|
|
||||||
|
jacoco {
|
||||||
|
toolVersion(versions.jacoco)
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
// override it in the module
|
||||||
|
jacocoExclude = []
|
||||||
|
}
|
||||||
|
|
||||||
|
jacocoTestReport {
|
||||||
|
reports {
|
||||||
|
html.enabled true
|
||||||
|
csv.enabled false
|
||||||
|
xml.enabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
classDirectories = files(classDirectories.files.collect {
|
||||||
|
fileTree(dir: it, excludes: jacocoExclude)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test.finalizedBy jacocoTestReport
|
||||||
|
test {
|
||||||
|
jacoco {
|
||||||
|
excludes += jacocoExclude
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task("ciTest", dependsOn: "test") {
|
||||||
|
group = "Verification"
|
||||||
|
description = "Special task for CI that calls all tests in pure kotlin modules"
|
||||||
|
}
|
@ -1,16 +1,6 @@
|
|||||||
apply plugin: 'kotlin'
|
apply from: bootstrap.kotlinModule
|
||||||
apply plugin: 'java-library'
|
|
||||||
apply plugin: 'jacoco'
|
|
||||||
apply from: '../gradle_scripts/code_quality.gradle'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main.java.srcDirs += "${projectDir}/src/main/kotlin"
|
|
||||||
test.java.srcDirs += "${projectDir}/src/integrationTest/kotlin"
|
|
||||||
test.resources.srcDirs += "${projectDir}/src/integrationTest/resources"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api other.kotlinStdlib
|
|
||||||
api other.retrofit
|
api other.retrofit
|
||||||
api other.jacksonConverter
|
api other.jacksonConverter
|
||||||
api other.koinCore
|
api other.koinCore
|
||||||
@ -31,10 +21,6 @@ dependencies {
|
|||||||
testImplementation testing.apacheCodecs
|
testImplementation testing.apacheCodecs
|
||||||
}
|
}
|
||||||
|
|
||||||
jacoco {
|
|
||||||
toolVersion(versions.jacoco)
|
|
||||||
}
|
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
// Excluding data classes
|
// Excluding data classes
|
||||||
jacocoExclude = [
|
jacocoExclude = [
|
||||||
@ -42,24 +28,3 @@ ext {
|
|||||||
'**/di/**'
|
'**/di/**'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
jacocoTestReport {
|
|
||||||
reports {
|
|
||||||
html.enabled true
|
|
||||||
csv.enabled false
|
|
||||||
xml.enabled true
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate {
|
|
||||||
classDirectories = files(classDirectories.files.collect {
|
|
||||||
fileTree(dir: it, excludes: jacocoExclude)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
test.finalizedBy jacocoTestReport
|
|
||||||
test {
|
|
||||||
jacoco {
|
|
||||||
excludes += jacocoExclude
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user