forked from TrueFit/GildedRose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
94 lines (79 loc) · 2.48 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
plugins {
id 'info.solidsoft.pitest' version '1.7.0'
}
defaultTasks 'clean', 'mainBuild'
task stage(dependsOn: [':server:copyToMainDist', ':web:copyToMainDist'])
task test(dependsOn: ['web:npm_run_test'])
task clean(type: Delete) {
files "$rootDir/build"
}
allprojects {
group 'com.moose'
version '0.0.0'
}
clean.doFirst {
delete "$rootDir/docs/"
}
configure(subprojects.findAll { !it.name.equalsIgnoreCase("web") }) {
apply plugin: 'java'
apply plugin: 'info.solidsoft.pitest'
apply plugin: 'pmd'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
vendor = JvmVendorSpec.ADOPTOPENJDK
}
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
testImplementation 'org.mockito:mockito-junit-jupiter:3.12.4'
}
test {
useJUnitPlatform()
}
pmd {
toolVersion = '6.39.0'
consoleOutput = true
incrementalAnalysis = true
ruleSetFiles = files("$rootDir/resources/pmd-exclusions.xml")
ruleSets = [/* Must Clear This In Order To Only Run Our Own Ruleset */]
}
build.dependsOn 'pitest'
pitest {
junit5PluginVersion = '0.15'
outputFormats.set(['HTML', 'XML'])
timestampedReports.set(false)
fullMutationMatrix.set(true)
enableDefaultIncrementalAnalysis.set(true)
targetClasses.set(['com.moose.gildedrose.inventory.*'])
// Using Gradle Toolchains we aren't guaranteed an appropriate JAVA_HOME variable, so manually specify the Java Instance.
jvmPath.set(javaToolchains.compilerFor({languageVersion = JavaLanguageVersion.of(11)}).get().metadata.installationPath.dir('bin').file('java.exe').asFile)
}
tasks.withType(Jar.class) {
manifest { attributes (
'Implementation-Title': rootProject.name + '-' + project.name,
'Implementation-Vendor': 'Mathew Moose',
'Implementation-Version': rootProject.version,
'Manifest-Version': '1.0',
'Description': 'GildedRose',
'Copyright': 'Mathew Moose, All Rights Reserved',
'Contact-Web': 'https://github.com/XMoose25X/GildedRose'
) }
}
}
subprojects {
repositories {
mavenCentral()
}
task copyToMainDist(type: Copy) {
dependsOn 'mainBuild'
from "$buildDir/libs"
into "$rootProject.buildDir/libs"
}
}