-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
150 lines (125 loc) · 4.55 KB
/
build.gradle.kts
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
plugins {
java
`maven-publish`
signing
}
group = "com.factset.sdk.eventdriven"
version = "2.0.0-SNAPSHOT"
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.factset.sdk:utils:1.+")
implementation("com.fasterxml.jackson.core:jackson-core:2.15.3")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.17.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("org.slf4j:slf4j-api:2.0.9")
testRuntimeOnly("org.slf4j:slf4j-simple:2.0.9")
testImplementation("org.mockito:mockito-inline:4.11.0")
testImplementation(platform("org.junit:junit-bom:5.10.2"))
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
compileOnly("org.projectlombok:lombok:1.18.30")
annotationProcessor("org.projectlombok:lombok:1.18.30")
testCompileOnly("org.projectlombok:lombok:1.18.30")
testAnnotationProcessor("org.projectlombok:lombok:1.18.30")
}
tasks.test {
useJUnitPlatform()
}
tasks.compileJava {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
tasks.jar {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
}
// https://docs.gradle.org/current/userguide/publishing_maven.html
publishing {
publications {
create<MavenPublication>("mavenJava") {
// dependencies
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("FactSet Trading event-driven client library for Java")
description.set("Event-driven api client for the FactSet Trading API")
url.set("https://github.com/factset/enterprise-sdk-eventdriven-factsettrading-java")
licenses {
license {
name.set("The Apache License, Version 2.0'")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("enterprisesdk")
organization.set("FactSet")
organizationUrl.set("https://developer.factset.com")
}
}
scm {
connection.set("scm:git:git://github.com/factset/enterprise-sdk-eventdriven-factsettrading-java.git")
developerConnection.set("scm:git:ssh://factset/enterprise-sdk-eventdriven-factsettrading-java.git")
url.set("https://github.com/factset/enterprise-sdk-eventdriven-factsettrading-java/")
}
}
}
}
repositories {
maven {
var releasesRepoUrlEnv = System.getenv("MAVEN_RELEASES_URL")
var snapshotsRepoUrlEnv = System.getenv("MAVEN_SNAPSHOTS_URL")
var usernameEnv = System.getenv("MAVEN_USERNAME")
var passwordEnv = System.getenv("MAVEN_PASSWORD")
if (releasesRepoUrlEnv == null) {
releasesRepoUrlEnv = ""
project.logger.error("MAVEN_RELEASES_URL not set")
}
if (snapshotsRepoUrlEnv == null) {
snapshotsRepoUrlEnv = ""
project.logger.error("MAVEN_SNAPSHOTS_URL not set")
}
if (usernameEnv == null) {
usernameEnv = ""
project.logger.error("MAVEN_USERNAME not set")
}
if (passwordEnv == null) {
passwordEnv = ""
project.logger.error("MAVEN_PASSWORD not set")
}
val releasesRepoUrl = uri(releasesRepoUrlEnv)
val snapshotsRepoUrl = uri(snapshotsRepoUrlEnv)
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = usernameEnv
password = passwordEnv
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
signing {
sign(publications["mavenJava"])
}
}