-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
144 lines (117 loc) · 4.41 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
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
/*
* Copyright [2022] [valantic CEC Schweiz AG]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Written by Fabian Hüsig, February, 2022
*/
plugins {
id "java"
id "org.jetbrains.intellij" version "$intellijPluginVersion"
id "info.solidsoft.pitest" version "$pitGradleVersion"
id "jacoco"
id "org.sonarqube" version "$sonarqubeVersion"
}
group "com.valantic"
version "$pluginVersion"
sourceCompatibility = "$javaSourceCompatibility"
repositories {
mavenCentral()
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version = "$intellijVersion"
plugins = ["JUnit", "com.intellij.java"]
}
pitest {
timestampedReports = false
pitestVersion = "$pitVersion"
jvmArgs.add("--add-opens")
jvmArgs.add("java.base/java.io=ALL-UNNAMED")
}
sonarqube {
properties {
property "sonar.projectKey", "valantic_mutation-tester"
property "sonar.organization", "valantic-cx-ch"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.tests", "src/test"
property "sonar.scm.disabled", "true"
}
}
configurations {
libImplementation
implementation.extendsFrom(libImplementation)
}
jar {
from {
configurations.libImplementation.collect { it.isDirectory() ? it : zipTree(it) }
}
dependsOn "instrumentTestCode"
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}
test {
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.enabled true
}
}
test.finalizedBy jacocoTestReport
dependencies {
// https://mvnrepository.com/artifact/org.pitest/pitest
libImplementation group: "org.pitest", name: "pitest", version: "$pitVersion"
// https://mvnrepository.com/artifact/org.pitest/pitest-entry
libImplementation group: "org.pitest", name: "pitest-entry", version: "$pitVersion"
// https://mvnrepository.com/artifact/org.pitest/pitest-command-line
libImplementation group: "org.pitest", name: "pitest-command-line", version: "$pitVersion"
// TODO: UPDATE pitest-junit5-plugin when dependencies get updated
// Current release of pitest-junit5-plugin uses pitest-1.9.0 as dependency.
// That uses classes which are incompatible with IntelliJ Marketplace dependencies
// 1.2.1 is the official 1.2.0 release with modified dependency to use pitest 1.14.2
// Created issue for this: https://github.com/pitest/pitest-junit5-plugin/issues/101
libImplementation files('lib/pitest-junit5-plugin-1.2.1.jar')
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: "$junitVersion"
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testImplementation group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "$junitVersion"
// https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher
testImplementation group: "org.junit.platform", name: "junit-platform-launcher", version: "$junitPlatformVersion"
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testImplementation group: "org.mockito", name: "mockito-junit-jupiter", version: "$mockitoVersion"
// https://mvnrepository.com/artifact/org.mockito/mockito-inline
testImplementation group: "org.mockito", name: "mockito-inline", version: "$mockitoInlineVersion"
}
buildSearchableOptions {
enabled = false
}
patchPluginXml {
version = project.version
intellij.updateSinceUntilBuild = false
sinceBuild = "212.4746.92"
}
publishPlugin {
token = System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken")
}
pitest {
junit5PluginVersion = "$pitJunit5Version"
pitestVersion = "$pitVersion"
}
task deleteOldReports(type: Delete) {
delete "samples/pitreport"
}
task copyPitestReport(type: Copy) {
from "$buildDir/reports/pitest"
into "samples/pitreport"
}