forked from tomzo/gocd-yaml-config-plugin
/
build.gradle
120 lines (98 loc) · 3.26 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
import cd.go.plugin.buildsrc.license.NoticeFileGenerator
import cd.go.plugin.buildsrc.license.TeeRenderer
import com.github.jk1.license.render.SimpleHtmlReportRenderer
plugins {
id "com.github.jk1.dependency-license-report"
}
group 'cd.go.plugin.config.yaml'
apply plugin: 'java'
apply plugin: "com.github.jk1.dependency-license-report"
project.ext {
pluginDesc = [
version: project.version,
goCdVersion: '20.4.0'
]
pluginApiVersion = '20.3.0'
}
sourceCompatibility = 1.11
targetCompatibility = 1.11
repositories {
mavenCentral()
}
dependencies {
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.1'
implementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
implementation group: 'org.apache.ant', name: 'ant', version: '1.10.12'
implementation group: 'com.beust', name: 'jcommander', version: '1.82'
implementation group: 'com.esotericsoftware.yamlbeans', name: 'yamlbeans', version: '1.15'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.32'
compileOnly group: 'cd.go.plugin', name: 'go-plugin-api', version: project.pluginApiVersion
testImplementation group: 'cd.go.plugin', name: 'go-plugin-api', version: project.pluginApiVersion
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.8.0'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from("src/main/resource-templates") {
filesMatching('*') {
expand project.pluginDesc
}
}
}
sourceSets {
main {
java {
srcDirs = ["src/main/java"]
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDirs = ["src/test/java"]
}
resources {
srcDir 'src/test/resources'
}
}
}
task copyTestResources(type: Copy) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
processTestResources {
dependsOn copyTestResources
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardOut"
}
}
// create a fat jar with all dependencies
jar {
archiveBaseName = project.name
preserveFileTimestamps = false
reproducibleFileOrder = true
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes 'Main-Class': 'cd.go.plugin.config.yaml.cli.YamlPluginCli'
}
from(generateLicenseReport) {
into "dependency-license-report"
exclude "NOTICE.txt"
}
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
licenseReport {
renderers = [new NoticeFileGenerator(new TeeRenderer(new SimpleHtmlReportRenderer()), "${project.buildDir}/reports/dependency-license/")]
}