-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
151 lines (125 loc) · 4.51 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
object Dependencies {
const val javaPoet = "com.squareup:javapoet:1.12.1"
const val kotlinPoet = "com.squareup:kotlinpoet:1.5.0"
const val mockk = "io.mockk:mockk:1.9.3"
const val assertk = "com.willowtreeapps.assertk:assertk-jvm:0.21"
object Kotlin {
const val version = "1.3.51"
const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version"
const val test = "org.jetbrains.kotlin:kotlin-test"
const val junit = "org.jetbrains.kotlin:kotlin-test-junit"
const val reflect = "org.jetbrains.kotlin:kotlin-reflect:$version"
const val plugin = "kotlin"
}
object JUnit5 {
const val version = "5.3.2"
const val juniperApi = "org.junit.jupiter:junit-jupiter-api:$version"
const val juniperParams = "org.junit.jupiter:junit-jupiter-params:$version"
const val juniperEngine = "org.junit.jupiter:junit-jupiter-engine:$version"
const val vintageEngine = "org.junit.vintage:junit-vintage-engine:$version"
object PlatformLauncher {
const val version = "1.1.0"
const val lib = "org.junit.platform:junit-platform-launcher:$version"
}
}
object Android {
const val gradleBuildTools = "com.android.tools.build:gradle:3.6.0"
}
}
plugins {
kotlin("jvm") version "1.3.41"
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
id("jacoco")
id("com.gradle.plugin-publish") version "0.11.0"
id("org.sonarqube") version "2.7.1"
id("io.gitlab.arturbosch.detekt") version "1.0.0-RC14"
}
group = "com.github.utilx"
version = "0.11.1"
repositories {
mavenCentral()
jcenter()
google()
}
gradlePlugin {
plugins {
create("android-assets-journalist") {
id = "com.github.utilx.android-assets-journalist"
displayName ="Android Asset Files Listing Plugin"
description = "Plugin that generates android assets list as string resources or source code file"
implementationClass = "com.github.utilx.assetsjournalist.AssetsJournalistPlugin"
}
}
}
pluginBundle {
website = "http://github.com/karczews/android-assets-journalist"
vcsUrl = "http://github.com/karczews/android-assets-journalist"
tags = listOf("android", "assets", "file", "listing", "generator", "journaling")
}
// Add a source set for the functional test suite
val functionalTestSourceSet = sourceSets.create("functionalTest") {
}
sonarqube {
}
dependencies {
implementation(gradleApi())
implementation(Dependencies.javaPoet)
implementation(Dependencies.kotlinPoet)
compileOnly(Dependencies.Android.gradleBuildTools)
implementation(kotlin("stdlib-jdk8"))
testImplementation(Dependencies.Kotlin.test)
testImplementation(Dependencies.Kotlin.junit)
testImplementation(Dependencies.JUnit5.juniperApi)
testImplementation(Dependencies.JUnit5.juniperEngine)
testImplementation(Dependencies.JUnit5.PlatformLauncher.lib)
testImplementation(Dependencies.mockk)
testImplementation(Dependencies.Android.gradleBuildTools)
testImplementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21")
testImplementation(Dependencies.assertk)
}
gradlePlugin.testSourceSets(functionalTestSourceSet)
configurations.getByName("functionalTestImplementation").extendsFrom(configurations.getByName("testImplementation"))
// Add a task to run the functional tests
val functionalTest by tasks.creating(Test::class) {
testClassesDirs = functionalTestSourceSet.output.classesDirs
classpath = functionalTestSourceSet.runtimeClasspath
}
val check by tasks.getting(Task::class) {
// Run the functional tests as part of `check`
dependsOn(functionalTest)
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<Test> {
useJUnitPlatform {}
testLogging {
events = setOf ( TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED )
showStandardStreams = true
exceptionFormat = TestExceptionFormat.FULL
}
}
tasks.withType<JacocoReport> {
reports {
html.isEnabled = false
xml.isEnabled = true
csv.isEnabled = false
}
}
detekt {
config = files("detekt-config.yml")
reports {
html {
enabled = true
}
}
failFast = true
}