GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — objectbox-java/objectbox-java/build.gradle.kts at main · chaozhouzhang/objectbox-java

Expand file tree

/

build.gradle.kts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
178 lines (154 loc) · 6.97 KB
/

build.gradle.kts

Copy path

File metadata and controls

178 lines (154 loc) · 6.97 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import kotlin.io.path.appendText
import kotlin.io.path.readText
import kotlin.io.path.writeText
plugins {
id("java-library")
id("objectbox-publish")
id("com.github.spotbugs")
}
// Note: use release flag instead of sourceCompatibility and targetCompatibility to ensure only JDK 8 API is used.
// https://docs.gradle.org/current/userguide/building_java_projects.html#sec:java_cross_compilation
tasks.withType<JavaCompile> {
options.release.set(8)
}
val javadocForWebDir = layout.buildDirectory.dir("docs/web-api-docs")
val essentialsVersion: String by rootProject.extra
dependencies {
api(project(":objectbox-java-api"))
implementation("org.greenrobot:essentials:$essentialsVersion")
api("com.google.code.findbugs:jsr305:3.0.2")
// https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md
compileOnly("com.github.spotbugs:spotbugs-annotations:4.8.6")
}
spotbugs {
ignoreFailures.set(true)
showStackTraces.set(true)
excludeFilter.set(file("spotbugs-exclude.xml"))
}
tasks.spotbugsMain {
reports.create("html") {
required.set(true)
}
}
// Note: used for the Maven javadoc artifact, a separate task is used to build API docs to publish online
tasks.javadoc {
// Internal Java APIs
exclude("**/io/objectbox/Cursor.java")
exclude("**/io/objectbox/InternalAccess.java")
exclude("**/io/objectbox/KeyValueCursor.java")
exclude("**/io/objectbox/ModelBuilder.java")
exclude("**/io/objectbox/Properties.java")
exclude("**/io/objectbox/Transaction.java")
exclude("**/io/objectbox/ideasonly/**")
exclude("**/io/objectbox/internal/**")
exclude("**/io/objectbox/query/InternalAccess.java")
exclude("**/io/objectbox/reactive/DataPublisherUtils.java")
exclude("**/io/objectbox/reactive/WeakDataObserver.java")
exclude("**/io/objectbox/sync/server/ClusterPeerInfo.java")
// Repackaged FlatBuffers distribution
exclude("**/io/objectbox/flatbuffers/**")
// FlatBuffers generated files only used internally (note: some are part of the public API)
exclude("**/io/objectbox/model/**")
exclude("**/io/objectbox/sync/Credentials.java")
exclude("**/io/objectbox/sync/CredentialsType.java")
exclude("**/io/objectbox/sync/server/ClusterPeerConfig.java")
exclude("**/io/objectbox/sync/server/JwtConfig.java")
exclude("**/io/objectbox/sync/server/SyncServerOptions.java")
}
// Note: use packageJavadocForWeb to get as ZIP.
val javadocForWeb by tasks.registering(Javadoc::class) {
group = "documentation"
description = "Builds Javadoc incl. objectbox-java-api classes with web tweaks."
javadocTool.set(javaToolchains.javadocToolFor {
// Note: the style changes only work if using JDK 10+, 17 is the LTS release used to publish this
languageVersion.set(JavaLanguageVersion.of(17))
})
val srcApi = project(":objectbox-java-api").file("src/main/java/")
if (!srcApi.isDirectory) throw GradleException("Not a directory: $srcApi")
// Hide internal API from javadoc artifact.
val filteredSources = sourceSets.main.get().allJava.matching {
// Internal Java APIs
exclude("**/io/objectbox/Cursor.java")
exclude("**/io/objectbox/InternalAccess.java")
exclude("**/io/objectbox/KeyValueCursor.java")
exclude("**/io/objectbox/ModelBuilder.java")
exclude("**/io/objectbox/Properties.java")
exclude("**/io/objectbox/Transaction.java")
exclude("**/io/objectbox/ideasonly/**")
exclude("**/io/objectbox/internal/**")
exclude("**/io/objectbox/query/InternalAccess.java")
exclude("**/io/objectbox/reactive/DataPublisherUtils.java")
exclude("**/io/objectbox/reactive/WeakDataObserver.java")
exclude("**/io/objectbox/sync/server/ClusterPeerInfo.java")
// Repackaged FlatBuffers distribution
exclude("**/io/objectbox/flatbuffers/**")
// FlatBuffers generated files only used internally (note: some are part of the public API)
exclude("**/io/objectbox/model/**")
exclude("**/io/objectbox/sync/Credentials.java")
exclude("**/io/objectbox/sync/CredentialsType.java")
exclude("**/io/objectbox/sync/server/ClusterPeerConfig.java")
exclude("**/io/objectbox/sync/server/JwtConfig.java")
exclude("**/io/objectbox/sync/server/SyncServerOptions.java")
}
source = filteredSources + fileTree(srcApi)
classpath = sourceSets.main.get().output + sourceSets.main.get().compileClasspath
setDestinationDir(javadocForWebDir.get().asFile)
title = "ObjectBox Java ${project.version} API"
(options as StandardJavadocDocletOptions).apply {
overview = "$projectDir/src/web/overview.html"
bottom = "Available under the Apache License, Version 2.0 - <i>Copyright &#169; 2017-2025 <a href=\"https://objectbox.io/\">ObjectBox Ltd</a>. All Rights Reserved.</i>"
}
doLast {
// Note: frequently check the vanilla stylesheet.css if values still match.
val stylesheetPath = "$destinationDir/stylesheet.css"
// Adjust the CSS stylesheet
// Change some color values
// The stylesheet file should be megabytes at most, so read it as a whole
val stylesheetFile = kotlin.io.path.Path(stylesheetPath)
val originalContent = stylesheetFile.readText()
val replacedContent = originalContent
.replace("#4D7A97", "#17A6A6") // Primary background
.replace("#F8981D", "#7DDC7D") // "Active" background
.replace("#bb7a2a", "#E61955") // Hover
stylesheetFile.writeText(replacedContent)
// Note: in CSS stylesheets the last added rule wins, so append to default stylesheet.
// Make code blocks scroll instead of stick out on small width
stylesheetFile.appendText("pre {\n overflow-x: auto;\n}\n")
println("Javadoc for web created at $destinationDir")
}
}
tasks.register<Zip>("packageJavadocForWeb") {
dependsOn(javadocForWeb)
group = "documentation"
description = "Packages Javadoc incl. objectbox-java-api classes with web tweaks as ZIP."
archiveFileName.set("objectbox-java-web-api-docs.zip")
val distDir = layout.buildDirectory.dir("dist")
destinationDirectory.set(distDir)
from(file(javadocForWebDir))
doLast {
println("Javadoc for web packaged to ${distDir.get().file("objectbox-java-web-api-docs.zip")}")
}
}
val javadocJar by tasks.registering(Jar::class) {
dependsOn(tasks.javadoc)
archiveClassifier.set("javadoc")
from("build/docs/javadoc")
}
val sourcesJar by tasks.registering(Jar::class) {
from(sourceSets.main.get().allSource)
archiveClassifier.set("sources")
}
// Set project-specific properties.
publishing {
publications {
getByName<MavenPublication>("mavenJava") {
from(components["java"])
artifact(sourcesJar)
artifact(javadocJar)
pom {
name.set("ObjectBox Java (only)")
description.set("ObjectBox is a fast NoSQL database for Objects")
}
}
}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.