-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
101 lines (84 loc) · 3.47 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
import java.text.SimpleDateFormat
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id 'net.nemerosa.versioning' version '3.1.0'
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
mavenCentral()
mavenLocal()
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
mainClassName = 'org.domiot.p1.pmagent.PowerMeterApplication'
shadowJar {
archiveBaseName.set(project.name)
archiveClassifier.set(project.classifier)
mergeServiceFiles()
mainClassName = mainClassName
exclude('logback.xml')
}
jar {
manifest {
attributes(
'Implementation-Title': 'Powermeter Application',
'Implementation-Version': archiveVersion,
'Implementation-Classifier': project.classifier,
'Built-By': System.properties['user.name'],
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Revision': versioning.info.commit,
'Created-By': "Gradle ${gradle.gradleVersion}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
)
}
exclude('*.log')
}
jacoco {
toolVersion = "0.8.11"
reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir')
}
publishing {
publications {
maven(MavenPublication) {
groupId group
artifactId project.name
version version
from components.java
}
}
}
dependencies {
implementation group: 'org.lankheet.domiot', name: 'domiot-datatypes', version: '0.8.2-SNAPSHOT'
implementation group: 'org.lankheet.domiot', name: 'domiot-rest-api', version: '1.2.0-SNAPSHOT'
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.17.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.17.0-rc1'
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.16'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.11'
implementation('com.github.oshi:oshi-core:6.6.1')
annotationProcessor 'org.projectlombok:lombok:1.18.34'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.34'
testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: '1.10.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.10.2'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.11.0'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '5.2.0'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
}
test {
ignoreFailures = !project.hasProperty('release')
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
}