forked from logicmonitor/lm-telemetry-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
112 lines (95 loc) · 2.99 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
plugins {
id 'idea'
id 'java'
id 'com.diffplug.spotless' version '5.4.0'
id 'com.github.spotbugs' version '4.5.0' apply false
id 'java-library'
id 'maven-publish'
id 'jacoco'
}
apply from: "${scriptDir}/spotless.gradle"
//apply from: "${scriptDir}/jacoco.gradle"
allprojects {
group = "com.logicmonitor"
version = "0.0.4-alpha"
}
ext {
versions = [
opentelemetry : "1.20.1",
opentelemetryAlpha: "1.20.1-alpha",
]
}
//build.dependsOn spotlessApply
repositories {
mavenCentral()
}
dependencies {
api project(':otel-resource')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
api group: "io.opentelemetry", name: "opentelemetry-sdk", version: "${versions.opentelemetry}"
implementation group: "io.opentelemetry", name: "opentelemetry-api", version: "${versions.opentelemetry}"
api group: "io.opentelemetry", name: "opentelemetry-sdk-extension-autoconfigure", version: "${versions.opentelemetryAlpha}"
}
test {
useJUnitPlatform()
}
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
allprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/report.xml")
html.enabled false
csv.enabled false
}
}
codeCoverageReport.dependsOn {
getAllprojects()
.collect {
if(!it.name.equals("lm-agent")){
return it.getTasksByName("test",true);
}
}.findAll();
}
task jarSigner {
doLast {
def passwd = System.getenv("PASSWORD")
def app_alias = System.getenv("ALIAS")
def pfx_file = System.getenv("FILE")
def storetype = System.getenv("STORETYPE")
def exec_line = "jarsigner -storetype " + storetype + " -keystore " + pfx_file + " -tsa http://timestamp.comodoca.com/?td=sha256 -storepass " +
passwd + " -keypass "+ passwd + " " + jar.archivePath + " " + app_alias
def output=exec_line.execute()
output.waitFor()
println "Exit value: ${output.exitValue()}"
println "Output: ${output.text}"
}
}
jar.finalizedBy(jarSigner)
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'lm-telemetry-sdk'
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/logicmonitor/lm-telemetry-sdk-java"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
task copyToLib( type: Copy ) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
into "$buildDir/extra-libs"
from configurations.runtimeClasspath
}
jar { dependsOn copyToLib }