-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
125 lines (104 loc) · 3.47 KB
/
build.gradle
File metadata and controls
125 lines (104 loc) · 3.47 KB
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
plugins {
id "java"
id "java-library"
id "checkstyle"
id "jacoco"
id "signing"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "maven-publish"
id "io.github.gradle-nexus.publish-plugin" version '1.2.0'
id "idea"
}
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenLocal()
mavenCentral()
// Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots:
maven { url "https://oss.sonatype.org/content/groups/public/" }
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
showStandardStreams = true
exceptionFormat = 'full'
}
dependsOn 'cleanTest'
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
checkstyle {
toolVersion = "9.3"
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
checkstyleTest.enabled = false
}
task generateJava(type: Copy) {
// This updates Version.java
from 'src/templates/java'
into "src/main/java"
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [VERSION: version.toString()])
}
compileJava.dependsOn 'generateJava'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = 'launchdarkly-openfeature-serverprovider'
pom {
name = 'LaunchDarkly OpenFeature provider for the Server-Side SDK for Java'
packaging = 'jar'
description = 'Official LaunchDarkly OpenFeature provider for the Server-Side SDK for Java'
url = 'https://github.com/launchdarkly/openfeature-java-server'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'LaunchDarkly SDK Team'
email = 'sdks@launchdarkly.com'
}
}
scm {
connection = 'scm:git:git://github.com/launchdarkly/openfeature-java-server'
developerConnection = 'scm:git:ssh:git@github.com:launchdarkly/openfeature-java-server.git'
url = 'https://github.com/launchdarkly/openfeature-java-server'
}
}
}
}
repositories {
mavenLocal()
}
}
signing {
required { findProperty("skipSigning") != "true" }
sign publishing.publications.mavenJava
}
nexusPublishing {
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
repositories {
sonatype()
}
}
dependencies {
implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: '[7.1.0, 8.0.0)'
implementation 'dev.openfeature:sdk:[1.13.0,2.0.0)'
// Use JUnit test framework
testImplementation(platform('org.junit:junit-bom:5.10.0'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation "org.mockito:mockito-core:3.+"
testImplementation 'org.awaitility:awaitility:4.2.0'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}