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

Lines changed: 16 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fdb-extensions/fdb-extensions.gradle

Lines changed: 3 additions & 3 deletions
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}"
Lines changed: 42 additions & 0 deletions
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 renamed to fdb-java-annotations/src/main/java/com/apple/foundationdb/annotation/API.java

Lines changed: 6 additions & 0 deletions
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 renamed to fdb-java-annotations/src/main/java/com/apple/foundationdb/annotation/SpotBugsSuppressWarnings.java

Lines changed: 2 additions & 0 deletions
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 renamed to fdb-java-annotations/src/main/java/com/apple/foundationdb/annotation/package-info.java

Lines changed: 13 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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}"

0 commit comments

Comments
 (0)