-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
134 lines (116 loc) · 3.1 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
import com.github.jk1.license.filter.*
plugins {
id 'java-library'
id 'maven-publish'
id 'distribution'
id 'com.github.jk1.dependency-license-report' version '2.0'
id "com.diffplug.spotless" version "6.25.0"
}
description "JLab Kafka Connect transform from epics2kafka to JAWS"
group 'org.jlab'
version new File("${projectDir}/VERSION").text.trim()
ext.releaseDate = new Date().format('MMM dd yyyy')
tasks.withType(JavaCompile).configureEach {
options.release = 11
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
repositories {
mavenCentral()
maven {
url "https://packages.confluent.io/maven/"
}
}
configurations {
testImplementation.extendsFrom(compileOnly)
}
dependencies {
compileOnly 'org.apache.kafka:connect-transforms:3.5.0'
implementation 'org.apache.avro:avro:1.11.2',
'io.confluent:kafka-connect-avro-data:7.4.0',
'org.jlab:jaws-libj:5.0.0'
testImplementation 'junit:junit:4.13.2'
}
build {
dependsOn(installDist)
}
installDist.dependsOn(generateLicenseReport)
distTar.dependsOn(generateLicenseReport)
distZip.dependsOn(generateLicenseReport)
distributions {
main {
contents {
from jar
/*We only include jars not already provided in Kafka/libs dir (or should be in kafka/libs)*/
/*Example, we exclude log4j, slf4j, jackson, kafka, avro, confluent */
from (project.configurations.runtimeClasspath).with {
include('jaws-epics2kafka*')
include('kafka-common*')
include('jaws-libj*')
}
}
}
}
test {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
def pomConfig = {
licenses {
license {
name "MIT License"
url "http://www.opensource.org/licenses/mit-license"
distribution "repo"
}
}
developers {
developer {
id "slominskir"
name "Ryan Slominski"
email "ryans@jlab.org"
}
}
scm {
url "https://github.com/JeffersonLab/jaws-epics2kafka"
}
}
publishing {
publications {
ProjectPublication(MavenPublication) {
from components.java
groupId group
artifactId project.name
version version
pom.withXml {
def root = asNode()
root.appendNode('description', project.description)
root.appendNode('name', project.name)
root.children().last() + pomConfig
}
}
}
}
tasks.named('jar') {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version)
}
}
jar {
from ('./') {
include 'LICENSE'
into 'META-INF'
}
}
licenseReport {
filters = [new LicenseBundleNormalizer()]
excludeOwnGroup = false
allowedLicensesFile = new File("$projectDir/gradle/allowed-licenses.json")
}
spotless {
java {
googleJavaFormat()
}
}