Skip to content

Commit cfef96c

Browse files
committed
move annotations from fdb-extensions to fdb-java-annotations package
1 parent 24d11eb commit cfef96c

File tree

14 files changed

+92
-27
lines changed

14 files changed

+92
-27
lines changed

.idea/compiler.xml

+16-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fdb-extensions/fdb-extensions.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
apply from: rootProject.file('gradle/publishing.gradle')
2222

2323
dependencies {
24+
api(project(":fdb-java-annotations")) {
25+
exclude(group: "com.squareup", module: "javapoet")
26+
}
2427
api "org.foundationdb:fdb-java:${fdbVersion}"
2528
implementation "com.google.guava:guava:${guavaVersion}"
2629
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
27-
api "com.squareup:javapoet:${javaPoetVersion}"
2830
compileOnly "com.google.code.findbugs:jsr305:${jsr305Version}"
29-
compileOnly "com.google.auto.service:auto-service:undefined"
30-
annotationProcessor "com.google.auto.service:auto-service:undefined"
3131

3232
testCompileOnly "com.google.code.findbugs:jsr305:${jsr305Version}"
3333
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* fdb-java-annotations.gradle
3+
*
4+
* This source file is part of the FoundationDB open source project
5+
*
6+
* Copyright 2015-2025 Apple Inc. and the FoundationDB project authors
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
apply from: rootProject.file('gradle/publishing.gradle')
22+
23+
dependencies {
24+
// Note: the Java Poet dependency is only really required for annotation processing,
25+
// so downstream projects should only require it if they use import this project as
26+
// an annotationProcessor dependency (e.g., they use @GenerateVisitor). Ideally,
27+
// we'd only include this as a dependency if it's being used in that case, but
28+
// barring that, we can exclude it as a transitive dependency when importing
29+
implementation "com.squareup:javapoet:${javaPoetVersion}"
30+
compileOnly "com.google.auto.service:auto-service:undefined"
31+
annotationProcessor "com.google.auto.service:auto-service:undefined"
32+
}
33+
34+
publishing {
35+
publications {
36+
library(MavenPublication) {
37+
pom {
38+
description = 'Common annotations used by FDB related Java projects.'
39+
}
40+
}
41+
}
42+
}

fdb-extensions/src/main/java/com/apple/foundationdb/annotation/API.java fdb-java-annotations/src/main/java/com/apple/foundationdb/annotation/API.java

+6
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,22 @@
2929
/**
3030
* An annotation used on public types, fields, and methods to indicate their level of stability for consumers of the API.
3131
*
32+
* <p>
3233
* If a class or interface is annotated with {@code API}, all of its fields and methods are considered to have that same
3334
* level of stability by default. However, this may be changed by annotating a member explicitly.
35+
* </p>
3436
*
37+
* <p>
3538
* An API may have its stability status become more stable (see {@link Status}) at any time, including before the next
3639
* minor release. However, an API must not become less stable in the next minor release. Each stability status must
3740
* specify how API elements with that status may become less stable (e.g., with the next minor release, with next major
3841
* release).
42+
* </p>
3943
*
44+
* <p>
4045
* The key words "must", "must not", "require", "shall", "shall not", "should", "should not", and "may" in this document
4146
* are to be interpreted as described in RFC 2119.
47+
* </p>
4248
*/
4349
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
4450
@Retention(RetentionPolicy.CLASS)

fdb-extensions/src/main/java/com/apple/foundationdb/annotation/SpotBugsSuppressWarnings.java fdb-java-annotations/src/main/java/com/apple/foundationdb/annotation/SpotBugsSuppressWarnings.java

+2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
/**
2424
* Suppress warnings from FindBugs / SpotBugs tools.
2525
*
26+
* <p>
2627
* Avoids introducing another transitive dependency.
28+
* </p>
2729
*/
2830
@API(API.Status.UNSTABLE)
2931
public @interface SpotBugsSuppressWarnings {

fdb-extensions/src/main/java/com/apple/foundationdb/annotation/package-info.java fdb-java-annotations/src/main/java/com/apple/foundationdb/annotation/package-info.java

+13-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@
1919
*/
2020

2121
/**
22-
* Annotations defined for use with FoundationDB. Currently, this only includes the {@link com.apple.foundationdb.annotation.API API}
23-
* stability annotations, but more could be added in the future.
22+
* Annotations defined for use with FoundationDB. Currently, this includes:
23+
*
24+
* <ul>
25+
* <li> {@link com.apple.foundationdb.annotation.API API} for specifying API stability levels.</li>
26+
* <li> {@link com.apple.foundationdb.annotation.SpotBugsSuppressWarnings SpotBugsSuppressWarnings} for suppressing
27+
* static analysis warnings.</li>
28+
* <li> {@link com.apple.foundationdb.annotation.GenerateVisitor GenerateVisitor} for automatically generating visitor
29+
* interfaces of class hierarchies</li>
30+
* </ul>
31+
*
32+
* <p>
33+
* None of the annotations have dependencies on
34+
* </p>
2435
*/
2536
package com.apple.foundationdb.annotation;

fdb-record-layer-core/fdb-record-layer-core.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ configurations {
2929
}
3030

3131
dependencies {
32+
annotationProcessor project(':fdb-java-annotations')
3233
api project(':fdb-extensions')
33-
annotationProcessor project(':fdb-extensions')
3434

3535
api "com.google.protobuf:protobuf-java:${protobufVersion}"
3636
implementation "org.slf4j:slf4j-api:${slf4jVersion}"

fdb-relational-api/fdb-relational-api.gradle

+3-4
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ buildHost=${InetAddress.getLocalHost().getCanonicalHostName()}
5353
}
5454

5555
dependencies {
56-
api project(':fdb-extensions')
57-
annotationProcessor project(':fdb-extensions')
58-
56+
api(project(':fdb-java-annotations')) {
57+
exclude(group: "com.squareup", module: "javapoet")
58+
}
5959
api "com.google.protobuf:protobuf-java:${protobufVersion}"
6060
compileOnly "com.google.code.findbugs:jsr305:${jsr305Version}"
6161
implementation "com.google.guava:guava:${guavaVersion}"
6262

6363
testCompileOnly "com.google.code.findbugs:jsr305:${jsr305Version}"
64-
testImplementation project(path: ':fdb-extensions', configuration: 'tests')
6564
testImplementation "org.assertj:assertj-core:${assertjVersion}"
6665
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
6766
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"

fdb-relational-core/fdb-relational-core.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ apply from: rootProject.file('gradle/publishing.gradle')
2828

2929
def coreProject = ":${ext.coreProjectName}"
3030
dependencies {
31-
api project(':fdb-extensions')
32-
annotationProcessor project(':fdb-extensions')
33-
3431
implementation(project(coreProject))
3532
implementation project(":fdb-relational-api")
3633

@@ -44,7 +41,6 @@ dependencies {
4441
implementation("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
4542
implementation("com.github.ben-manes.caffeine:guava:${caffeineVersion}")
4643

47-
testImplementation project(path: ':fdb-extensions', configuration: 'tests')
4844
testImplementation project(path: coreProject, configuration: 'tests')
4945
testImplementation(testFixtures(project(":fdb-relational-api")))
5046
testImplementation "org.assertj:assertj-core:${assertjVersion}"

fdb-relational-server/fdb-relational-server.gradle

+4-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ publishing {
8282

8383
def coreProject = ":${ext.coreProjectName}"
8484
dependencies {
85-
api project(':fdb-extensions')
86-
annotationProcessor project(':fdb-extensions')
85+
annotationProcessor project(':fdb-java-annotations')
8786
// TODO: Why I have to do this when I've included core below..Why is it not
8887
// transitively included? Is this how gradle works?
8988
implementation project(coreProject)
@@ -102,8 +101,10 @@ dependencies {
102101
// Pull in the client for the fixture and httpserver
103102
def prometheusVersion = '0.16.0'
104103
implementation "io.prometheus:simpleclient_httpserver:${prometheusVersion}"
104+
testFixturesImplementation(project(":fdb-java-annotations")) {
105+
exclude(group: "com.squareup", module: "javapoet")
106+
}
105107
testFixturesImplementation "io.prometheus:simpleclient:${prometheusVersion}"
106-
testImplementation project(path: ':fdb-extensions', configuration: 'tests')
107108
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
108109
implementation "io.dropwizard.metrics:metrics-core:${dropwizardVersion}"
109110
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
rootProject.name='fdb-record-layer'
2222

23+
include 'fdb-java-annotations'
2324
include 'fdb-extensions'
2425
include 'fdb-record-layer-core'
2526
include 'fdb-record-layer-core-shaded'

0 commit comments

Comments
 (0)