-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
132 lines (111 loc) · 3.52 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
ext {
project_version = '0.3.1-SNAPSHOT'
github_org = 'edgedb'
project_name = 'edgedb-java'
artifact_group = 'com.edgedb'
project_description = 'Java binding for the EdgeDB database'
project_url = "https://edgedb.com"
project_jdk = '11'
jdk = JavaVersion.current().majorVersion
jdk_javadoc = "https://docs.oracle.com/javase/$jdk/docs/api/".toString()
if (JavaVersion.current().isJava11Compatible()) {
jdk_javadoc = "https://docs.oracle.com/en/java/javase/$jdk/docs/api/".toString()
}
// dependencies
jackson_version = '2.15.2'
slf4j_version = '2.0.5'
netty_version = '4.1.89.Final'
joou_version = '0.9.4'
reflections_version = '0.10.2'
// test dependencies
junit_version = '5.9.2'
assertj_version = '3.24.2'
logback_version = '1.4.5'
isRelease = !project_version.toString().endsWith('-SNAPSHOT')
}
allprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
if (isRelease) {
apply plugin: 'signing'
}
group = artifact_group
version = project_version
description = project_description
sourceCompatibility = project_jdk
targetCompatibility = project_jdk
dependencies {
implementation platform("io.netty:netty-bom:$netty_version")
}
repositories {
mavenLocal()
mavenCentral()
}
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 60, 'seconds'
}
tasks.withType(Javadoc).configureEach {
options {
encoding = 'UTF-8'
tags = ["apiNote:a:API Note:",
"implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:"]
addStringOption 'Xdoclint:none', '-quiet'
addStringOption 'encoding', 'UTF-8'
}
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.incremental = true
}
tasks.register('downloadDependencies') {
description 'Download all dependencies to the Gradle cache'
doLast {
configurations.findAll { it.canBeResolved }.files
}
}
java {
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
}
subprojects {
archivesBaseName = "com.edgedb.$project.name"
tasks.withType(Javadoc).configureEach {
title = "$archivesBaseName ${version} API"
options.windowTitle = "$archivesBaseName ($version)"
}
publishing {
repositories {
maven {
if (isRelease) {
url 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
} else {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}
def sonatypeUsername = findProperty('sonatypeUsername')
def sonatypePassword = findProperty('sonatypePassword')
if (sonatypeUsername != null && sonatypePassword != null) {
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
}
}