-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
88 lines (75 loc) · 2.17 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
plugins {
id 'java-library'
id 'jacoco'
id 'de.undercouch.download' version '4.1.1'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'com.adarshr.test-logger' version '2.1.1'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.ongres:fluent-process:1.0.1'
implementation 'com.google.code.gson:gson:2.8.6'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.0'
testImplementation 'org.assertj:assertj-core:3.18.1'
testImplementation 'com.google.guava:guava:30.1-jre'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
tasks.withType(Test) {
useJUnitPlatform()
testlogger {
showPassedStandardStreams false
slowThreshold 5000
}
finalizedBy jacocoTestReport
}
jacocoTestReport {
reports {
xml.enabled true
}
}
task downloadBinaries {
doLast {
def onePasswordVersion = file("${sourceSets.test.resources.srcDirs.first()}/op.version").text
def teamscaleUploadVersion = "2.0.0"
def buildBinDir = file("$buildDir/bin")
def os = "linux"
if (System.properties['os.name'].toLowerCase().contains('windows')) {
os = "windows"
}
download {
src ([
"https://cache.agilebits.com/dist/1P/op/pkg/v${onePasswordVersion}/op_${os}_amd64_v${onePasswordVersion}.zip",
"https://github.com/cqse/teamscale-upload/releases/download/v${teamscaleUploadVersion}/teamscale-upload-${os}.zip",
])
dest buildBinDir
overwrite false
}
fileTree(dir: buildBinDir).include("op_${os}_amd64_v${onePasswordVersion}.zip").include("teamscale-upload-${os}.zip").each { zip ->
copy {
from zipTree(zip)
into buildBinDir
}
}
if (os == 'linux') {
project.exec {
commandLine('chmod', '+x', "$buildBinDir/teamscale-upload")
}
}
}
}
task bootstrap(dependsOn: ["downloadBinaries"])
processTestResources.dependsOn += ["downloadBinaries"]
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = 'one.password.shadow'
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar