-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
148 lines (128 loc) · 4.34 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
145
146
147
148
plugins {
id 'com.github.johnrengelman.shadow' version "7.1.2"
id 'java'
id 'java-library'
id 'project-report'
id 'maven-publish'
id 'idea'
}
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
sourceCompatibility = 11
group = 'jtlreporter'
version = '0.4'
def title = 'JtlReporterBackendListener'
def archiveName = 'jmeter-plugins-jtlreporter-listener'
// There's a bug in JMeter leaving extra metadata right now. This is a workaround.
class JMeterRule implements ComponentMetadataRule {
void execute(ComponentMetadataContext context) {
context.details.allVariants {
withDependencies {
removeAll { it.group == "org.apache.jmeter" && it.name == "bom" }
}
}
}
}
String jMeterVersion = '5.6.2'
dependencies {
compileOnly group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: jMeterVersion
compileOnly group: 'org.apache.jmeter', name: 'ApacheJMeter_java', version: jMeterVersion
compileOnly group: 'org.apache.jmeter', name: 'ApacheJMeter_components', version: jMeterVersion
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.11.0'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
components {
withModule("org.apache.jmeter:ApacheJMeter_core", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_java", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_components", JMeterRule)
withModule("org.apache.jmeter:jorphan", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_http", JMeterRule)
}
}
jar {
manifest {
attributes 'Implementation-Title': title,
'Implementation-Version': archiveVersion,
'Main-Class': 'jtlreporter.JtlReporterBackendClient'
}
// Sets Classifier as sources.
archiveClassifier.set("sources")
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
shadowJar {
// Removes of the useless links.
minimize()
// Fix of the Class path contains multiple SLF4J bindings.
minimize
{
exclude(dependency('org.slf4j:.*:.*'))
}
archiveBaseName.set(archiveName)
manifest {
inheritFrom project.tasks.jar.manifest
}
// Removes the 'All' in Classifier to have downloadable artifact by default.
archiveClassifier.set(null)
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ludeknovy/jtl-reporter-jmeter-backend-listener")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
publications {
mavenJava(MavenPublication) {
groupId = 'jtlreporter'
artifactId = archiveName
version = version
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = archiveName
description = 'JtlReporter Backend Listener'
url = 'https://jtlreporter.site'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'ludeknovy'
name = 'Luděk Nový'
}
}
scm {
connection = 'scm:git:git:github.com:ludeknovy/jtl-reporter-jmeter-plugin.git'
url = 'https://github.com/ludeknovy/jtl-reporter-jmeter-plugin'
}
}
}
}
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}