-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
executable file
·109 lines (92 loc) · 2.64 KB
/
build.gradle
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
import org.gradle.api.internal.classpath.ModuleRegistry
import org.gradle.api.internal.project.ProjectInternal
buildscript {
ext.kotlinVersion = '2.1.0'
ext.androidGradlePluginVersion = '8.7.3'
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.vanniktech:gradle-code-quality-tools-plugin:0.24.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.30.0'
}
}
apply plugin: 'java-library'
apply plugin: 'java-gradle-plugin'
apply plugin: 'kotlin'
apply plugin: 'com.vanniktech.code.quality.tools'
apply plugin: "com.vanniktech.maven.publish"
validatePlugins {
enableStricterValidation = true
}
codeQualityTools {
ktlint {
toolVersion = '1.2.1'
}
detekt {
enabled = false
}
pmd {
enabled = false
}
checkstyle {
enabled = false
}
cpd {
enabled = false
}
kotlin {
allWarningsAsErrors = false
}
}
gradlePlugin {
plugins {
codeQualityToolsPlugin {
id = 'com.vanniktech.code.quality.tools'
implementationClass = 'com.vanniktech.code.quality.tools.CodeQualityToolsPlugin'
}
}
}
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
configurations {
fixtureClasspath
}
// Append any extra dependencies to the test fixtures via a custom configuration classpath. This
// allows us to apply additional plugins in a fixture while still leveraging dependency resolution
// and de-duplication semantics.
tasks.getByName('pluginUnderTestMetadata').getPluginClasspath().from(configurations.fixtureClasspath)
dependencies {
api gradleApi()
api 'de.aaschmid:gradle-cpd-plugin:3.5'
compileOnly "com.android.tools.build:gradle:$androidGradlePluginVersion"
compileOnly "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
testImplementation "com.android.tools.build:gradle:$androidGradlePluginVersion"
testImplementation 'junit:junit:4.13.2'
testImplementation "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
fixtureClasspath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
fixtureClasspath "com.android.tools.build:gradle:$androidGradlePluginVersion"
// https://github.com/gradle/gradle/issues/16774#issuecomment-893493869
def toolingApiBuildersJar = (project as ProjectInternal).services.get(ModuleRegistry.class)
.getModule("gradle-tooling-api-builders")
.classpath
.asFiles
.first()
testRuntimeOnly(files(toolingApiBuildersJar))
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks.withType(Test) {
testLogging {
testLogging.exceptionFormat = 'full'
}
}