[Git][java-team/apiguardian][upstream] New upstream version 1.1.2

Tony Mancill (@tmancill) gitlab at salsa.debian.org
Thu Jul 14 05:11:24 BST 2022



Tony Mancill pushed to branch upstream at Debian Java Maintainers / apiguardian


Commits:
67a1e702 by tony mancill at 2022-07-12T20:29:55-07:00
New upstream version 1.1.2
- - - - -


9 changed files:

- + .github/workflows/main.yml
- − .travis.yml
- README.md
- − build.gradle
- + build.gradle.kts
- gradle.properties
- − settings.gradle
- + settings.gradle.kts
- src/main/java/org/apiguardian/api/API.java


Changes:

=====================================
.github/workflows/main.yml
=====================================
@@ -0,0 +1,57 @@
+name: CI
+
+on:
+  push:
+    branches:
+      - main
+      - 'releases/*'
+  pull_request:
+    branches:
+      - '*'
+
+jobs:
+
+  gradle:
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-latest]
+    runs-on: ${{ matrix.os }}
+    steps:
+      - uses: actions/checkout at v1
+      - uses: actions/setup-java at v1
+        with:
+          java-version: 11
+      - uses: eskatos/gradle-command-action at v1
+        with:
+          arguments: --stacktrace build
+
+  publish_artifacts:
+    name: Publish Snapshot Artifacts
+    needs: gradle
+    runs-on: ubuntu-latest
+    if: github.event_name == 'push' && github.repository == 'apiguardian-team/apiguardian' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main')
+    steps:
+      - uses: actions/checkout at v2
+      - uses: actions/setup-java at v1
+        with:
+          java-version: 11
+      - name: 'Publish'
+        env:
+          ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
+          ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
+        run: ./gradlew publish -x check
+
+  update_documentation:
+    name: Update Snapshot Documentation
+    needs: gradle
+    runs-on: ubuntu-latest
+    if: github.event_name == 'push' && github.repository == 'apiguardian-team/apiguardian' && github.ref == 'refs/heads/main'
+    steps:
+      - uses: actions/checkout at v2
+      - uses: actions/setup-java at v1
+        with:
+          java-version: 11
+      - name: 'Upload Documentation'
+        env:
+          GRGIT_USER: ${{ secrets.GH_TOKEN }}
+        run: ./gradlew gitPublishPush -x check


=====================================
.travis.yml deleted
=====================================
@@ -1,37 +0,0 @@
-language: java
-
-# Specify which branches/tags that we do not want to be built: r5.0.0-M5
-branches:
-  except:
-    - /^r\d.*$/
-
-before_install:
-  - unset _JAVA_OPTIONS # https://github.com/travis-ci/travis-ci/issues/8408
-
-install:
-  - ./gradlew --version # Display Gradle, Groovy, JVM and other versions
-
-jdk:
-  - oraclejdk11
-
-stages:
-  - test
-  - name: deploy
-    if: (branch = master) AND (NOT type IN (pull_request))
-
-jobs:
-  include:
-    - script: ./gradlew --stacktrace build
-    - stage: deploy
-      name: "Publish snapshot artifacts"
-      env:
-        # ORG_GRADLE_PROJECT_ossrhUsername
-        - secure: vOVNqJ3ECL5W6X9M/MC7wUnZIDBOaleIsoAVQXajaL2U/B9I0HNNqjjeCmWoiUO8HViKBzDsJB2lo1+qiySgCsDeYW+6Rv1riFTyqGTv3PK4fiFKPzZXhh38EDkJa59hPwIs6yQm5UvClNZEEtnkiV1eOMS28UgWVeqbHhBwoJxRcj5rEExyxbFcEtCkfCGVRLuaJXTdI1wfZ/Dv3Cxe4yPo0FC8JW8p3kG6kstK+t3IpkjIVjX7NL2o0Zini/WFrIvHayrGIiliXijwcU9PxljVvtJkAh5gNbN15FmeIbG5PkUvzVam3pIAOMk3VhJJUu1cfJqcuILgKDbj8Pv3+G9mXD0Mpb5cbLBfCHQskp/k8vAGhURyoALyALpCW2DE03VUKv5X8kMop5o//5KHXxkAq6dzGunqeJy4sKIPBzcfWv6QVEtJJNROJKPe6R9DEqGvMM3D6Qc0QG3FBSKeiY18hWsSPS7j6qB0rnmHRq2tUa+63+wnabRLEptLumO/22bjxZQ6Xi3t7kGqy92AZcCPYUzHzb24BKgEr6NybfCP8PZgzeuFixUVYVxyZD7yRvtGSg49BT5O5OM+rrNOJfbySGuosjo+MuBvXt04t8/8SYJiJ1qbsFZXeVI3nq28VKgxOCjk6QYs3vcrS+KP1MIbAdMg7L2hO9goWxxH1Gs=
-        # ORG_GRADLE_PROJECT_ossrhPassword
-        - secure: CLrncz3oysmbaVSdYBzFp4zncpEGjyWKfTSDFVS4kfR6BtbX/3g1aSMpnxR91WysL0jB7N3Rd3WZrxIvMA28EMGo5tEXG3ow5Q8KeI4e8cET+gnvLS1z1+wP+/TqhcU9rBofLi46L7JzTs+PsCaRrzQc5YLW/aIqbGrA003Lo4tJ9cBHwmNa7YPUDE1zwmSpkMJp3CutUL1EzPm8Rx27vc13SSYCkxAsxShWSiRCCBb0803KOk/kWXpAu607rBy2seV5ltaVV+d7yc89bS96q8KpPSNuhBScCYwjHP3V9s05NGab7ErhEKpmcyGK/alCJXRGZUSZR4hRhdIwE/P1155f8mpaQCXk+acPL22QZHTXmp4y5FJlW4bsI/lyWyKtKT70r+ZCKbbZ+fXNB2TOQ7uMZpM5nfdOC6GcWnM/2WMDtZLNEwJ9Kg5PReiqy7ymvmUTxgd44/OH7fqgvoNATwQlbLc8nOU0vUbA2WWgCcLr+eLsLTjUQVlgxf6dQxa0fOud7APaKHdJwWQLYjIcm5mlMYBz445BnO4mylfSLHDTVyhK8xxfXRzi2PhTQb99Kh7z5Q0XWDtBjBcyE8Y75Crz4ayAW5hzDPzCTyPUCI+3BJoDDE6jE3qYzxETuPNojnhEFPb5DA5P2pPw4a2p5QMeoY430dtJsxyn/SQ9Voo=
-      script: ./gradlew --stacktrace uploadArchives -x check
-    - name: "Update snapshot documentation"
-      env:
-        # ORG_GRADLE_PROJECT_githubToken
-        - secure: YvgOsZ7Dsc04xVM14FCleSpKflRzVo48Wmg+gr783sPhS1yocRE7yATZyeadzs9k13zTKLCMcRpx5URI5hvEMtjuq413by4aPEwSL97U4LiomSqXupTT1Vs5XKzJqeZuSJt5jVuu/uS0VewJgne4wxb8TCjEO7jMgE2wpaF1O7s+0iWzLrflCdRETuH6aoH8VEK89Ao8eQQuLWTS6XUkDSUhs0ojV+2m1TF2j4JpTdOjsDv/lEP9p7HsY7p1otCgbalzUFZzPNhQzCpebHzWV6SGXdPbolU+0rn7k+f4wnvr62C5j1NPb4y/P7r+0tEhDszJAwjcAkaS878iFRsvEwewV8pLxKlLNN92/+bTYG93rifBpbNC7VQ4z7w+sSgHAtE8CvNq4wkBtOiHdc2iNL63QVufTJfuoKzgxhJjG4hLNbdXGo2WLwTRBXUJit73wnLlzgBgTJb8/Bv59KPM57it94XRiCph5hLnobRaOpEoqoHROnHXBQoKBWkDMGgY3fwEXvQDOIZdr+XcLytwWaMky3GaaCaOjvF5v3IgLrYgfEy9oFOM/IGI15AvqyXU9Xkk/FmFeU2pQhLjLrBRoEqaicz5VskNW22yZqk+yv5K1o5aGFS+6AbJMj97aETxshlQ21UasR8taYntz3AtqItUTAOKhDJL2VWKRi3mllg=
-      script: ./gradlew --stacktrace publishGhPages


=====================================
README.md
=====================================
@@ -1,22 +1,29 @@
 # @API Guardian
 
-[![Travis CI build status](https://travis-ci.org/apiguardian-team/apiguardian.svg?branch=master)](https://travis-ci.org/apiguardian-team/apiguardian)
+[![CI Status](https://github.com/apiguardian-team/apiguardian/workflows/CI/badge.svg)](https://github.com/apiguardian-team/apiguardian/actions)
 
 Library that provides the `@API` annotation that is used to annotate public types, methods, constructors, and fields within a framework or application in order to publish their status and level of stability and to indicate how they are intended to be used by consumers of the API.
 
 ## How to use it
 
-The @API Guardian library is deployed to maven central. You can simply add it as a dependency:
+The @API Guardian library is deployed to Maven Central. You can simply add it as a dependency:
 
 ### Apache Maven
 ```xml
 <dependency>
     <groupId>org.apiguardian</groupId>
     <artifactId>apiguardian-api</artifactId>
-    <version>1.1.0</version>
+    <version>1.1.2</version>
 </dependency>
 ```
-### Gradle/Grails
-```
-compile 'org.apiguardian:apiguardian-api:1.1.0'
+
+### Gradle
+
+```gradle
+repositories {
+    mavenCentral()
+}
+dependencies {    
+    compileOnlyApi("org.apiguardian:apiguardian-api:1.1.2")
+}
 ```


=====================================
build.gradle deleted
=====================================
@@ -1,206 +0,0 @@
-import java.text.SimpleDateFormat
-
-plugins {
-	id 'java'
-	id 'eclipse'
-	id 'idea'
-	id 'maven'
-	id 'signing'
-	id 'net.nemerosa.versioning' version '2.6.1'
-	id 'org.ajoberstar.github-pages' version '1.7.2'
-}
-
-Date buildTimeAndDate = new Date()
-ext {
-	buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
-	buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
-	builtByValue = project.hasProperty('builtBy') ? project.builtBy : project.defaultBuiltBy
-}
-
-description = '@API Guardian'
-def moduleName = 'org.apiguardian.api'
-
-repositories {
-	mavenCentral()
-}
-
-compileJava {
-	options.compilerArgs = ['--release', '6']
-}
-
-task compileModule(type: JavaCompile) {
-	def moduleSrcDir = file('src/module/java')
-	source(moduleSrcDir)
-	destinationDir = file("$buildDir/classes/java/modules")
-	classpath = compileJava.classpath
-	inputs.property("moduleName", moduleName)
-	inputs.property("moduleVersion", project.version)
-	options.compilerArgs = [
-			'--release', '9',
-			'--module-version', project.version as String,
-			'--module-source-path', moduleSrcDir.toString(),
-			'--patch-module', "$moduleName=${sourceSets.main.allJava.srcDirs.join(':')}",
-			'--module', moduleName
-	]
-}
-
-def normalizeVersion = { versionLiteral ->
-	try {
-		(versionLiteral =~ /(\d+)\.(\d+)\.(\d+).*/)[0][1..3].join('.')
-	} catch (e) {
-		throw new GradleException("Version '$versionLiteral' does not match version pattern, e.g. 1.0.0-QUALIFIER", e)
-	}
-}
-
-jar {
-	manifest {
-		attributes(
-			'Created-By': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString(),
-			'Built-By': builtByValue,
-			'Build-Date': buildDate,
-			'Build-Time': buildTime,
-			'Build-Revision': versioning.info.commit,
-			'Specification-Title': project.name,
-			'Specification-Version': normalizeVersion(project.version),
-			'Specification-Vendor': 'apiguardian.org',
-			'Implementation-Title': project.name,
-			'Implementation-Version': project.version,
-			'Implementation-Vendor': 'apiguardian.org'
-		)
-	}
-	from(files("${compileModule.destinationDir}/$moduleName").builtBy(compileModule)) {
-		include('module-info.class')
-	}
-}
-
-javadoc {
-	options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
-	options.author = true
-	options.header = '@API Guardian'
-	options.addStringOption('Xdoclint:html,syntax,reference', '-quiet')
-	options.links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
-}
-
-task sourcesJar(type: Jar, dependsOn: classes) {
-	classifier = 'sources'
-	from sourceSets.main.allSource
-}
-
-task javadocJar(type: Jar) {
-	classifier = 'javadoc'
-	from javadoc
-}
-
-artifacts {
-	archives sourcesJar
-	archives javadocJar
-}
-
-def signArtifacts = !project.version.contains('SNAPSHOT')
-
-if (signArtifacts) {
-	signing {
-		sign configurations.archives
-	}
-}
-
-uploadArchives {
-
-	dependsOn check
-
-	repositories {
-		mavenDeployer {
-
-			if (signArtifacts) {
-				beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-			}
-
-			def ossrhUsername = rootProject.hasProperty('ossrhUsername') ? rootProject.ossrhUsername : ''
-			def ossrhPassword = rootProject.hasProperty('ossrhPassword') ? rootProject.ossrhPassword : ''
-
-			repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
-				authentication(userName: ossrhUsername, password: ossrhPassword)
-			}
-
-			snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
-				authentication(userName: ossrhUsername, password: ossrhPassword)
-			}
-
-			pom.project {
-				name "${project.group}:${project.name}"
-				packaging 'jar'
-				description "@API Guardian"
-				url 'https://github.com/apiguardian-team/apiguardian'
-
-				scm {
-					connection 'scm:git:git://github.com/apiguardian-team/apiguardian.git'
-					developerConnection 'scm:git:git://github.com/apiguardian-team/apiguardian.git'
-					url 'https://github.com/apiguardian-team/apiguardian'
-				}
-
-				licenses {
-					license {
-						name 'The Apache License, Version 2.0'
-						url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-					}
-				}
-
-				developers {
-					developer {
-						id 'apiguardian'
-						name '@API Guardian Team'
-						email 'team at apiguardian.org'
-					}
-				}
-			}
-
-			pom.whenConfigured { p ->
-				p.dependencies = p.dependencies.findAll { dep -> dep.scope != 'test' }
-			}
-		}
-	}
-}
-
-def docsVersion = project.version.contains('SNAPSHOT') ? 'snapshot' : project.version
-def docsDir = new File(buildDir, 'ghpages-docs')
-
-task prepareDocsForUploadToGhPages(dependsOn: [javadoc], type: Copy) {
-	outputs.dir docsDir
-
-	from("$buildDir/docs") {
-		include 'javadoc/**'
-	}
-	into "${docsDir}/${docsVersion}"
-	filesMatching('javadoc/**') { fileCopyDetails ->
-		fileCopyDetails.path = fileCopyDetails.path.replace('javadoc/', 'api/')
-	}
-	includeEmptyDirs = false
-}
-
-task createCurrentDocsFolder(dependsOn: prepareDocsForUploadToGhPages, type: Copy) {
-	outputs.dir "${docsDir}/current"
-
-	from "${docsDir}/${docsVersion}"
-	into "${docsDir}/current"
-}
-
-createCurrentDocsFolder.onlyIf { project.hasProperty('replaceCurrentDocs') }
-
-githubPages {
-	repoUri = 'https://github.com/apiguardian-team/apiguardian.git'
-
-	credentials {
-		username = project.hasProperty('githubToken') ? project.githubToken : ''
-		password = ''
-	}
-
-	pages {
-		from docsDir
-		into "docs"
-	}
-
-	deleteExistingFiles = false
-}
-
-prepareGhPages.dependsOn(prepareDocsForUploadToGhPages)
-prepareGhPages.dependsOn(createCurrentDocsFolder)


=====================================
build.gradle.kts
=====================================
@@ -0,0 +1,218 @@
+import java.time.OffsetDateTime
+import java.time.format.DateTimeFormatter
+
+plugins {
+	id("java")
+	id("eclipse")
+	id("idea")
+	id("maven-publish")
+	id("signing")
+	id("biz.aQute.bnd.builder") version "5.3.0"
+	id("net.nemerosa.versioning") version "2.14.0"
+	id("org.ajoberstar.git-publish") version "3.0.0"
+	id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
+}
+
+val buildTimeAndDate = OffsetDateTime.now()
+val buildDate = DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate)
+val buildTime = DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate)
+val builtByValue = project.findProperty("builtBy") ?: project.property("defaultBuiltBy")
+
+val isSnapshot = project.version.toString().contains("SNAPSHOT")
+val docsVersion = if (isSnapshot) "snapshot" else project.version
+val docsDir = File(buildDir, "ghpages-docs")
+val replaceCurrentDocs = project.hasProperty("replaceCurrentDocs")
+
+description = "@API Guardian"
+val moduleName = "org.apiguardian.api"
+
+repositories {
+	mavenCentral()
+}
+
+java {
+	withJavadocJar()
+	withSourcesJar()
+}
+
+val moduleSourceDir = file("src/module/java")
+
+tasks {
+	compileJava {
+		options.release.set(6)
+	}
+
+	val compileModule by registering(JavaCompile::class) {
+		source(moduleSourceDir)
+		destinationDir = file("$buildDir/classes/java/modules")
+		classpath = files(compileJava.map { it.classpath })
+		inputs.property("moduleName", moduleName)
+		inputs.property("moduleVersion", project.version)
+		options.release.set(9)
+		options.compilerArgs = listOf(
+			"--module-version", project.version as String,
+			"--module-source-path", moduleSourceDir.toString(),
+			"--patch-module", "$moduleName=${sourceSets.main.get().allJava.srcDirs.joinToString(":")}",
+			"--module", moduleName
+		)
+	}
+
+	jar {
+		fun normalizeVersion(versionLiteral: String): String {
+			val regex = Regex("(\\d+\\.\\d+\\.\\d+).*")
+			val match = regex.matchEntire(versionLiteral)
+			require(match != null) {
+				"Version '$versionLiteral' does not match version pattern, e.g. 1.0.0-QUALIFIER"
+			}
+			return match.groupValues[1]
+		}
+		manifest {
+			attributes(
+				"Created-By" to "${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${System.getProperty("java.vm.version")})",
+				"Built-By" to builtByValue,
+				"Build-Date" to buildDate,
+				"Build-Time" to buildTime,
+				"Build-Revision" to versioning.info.commit,
+				"Specification-Title" to project.name,
+				"Specification-Version" to normalizeVersion(project.version.toString()),
+				"Specification-Vendor" to "apiguardian.org",
+				"Implementation-Title" to project.name,
+				"Implementation-Version" to project.version,
+				"Implementation-Vendor" to "apiguardian.org",
+				"Bundle-Name" to project.name,
+				"Bundle-Description" to project.description,
+				"Bundle-DocURL" to "https://github.com/apiguardian-team/apiguardian",
+				"Bundle-Vendor" to "apiguardian.org",
+				"-exportcontents" to "org.apiguardian.api",
+				"Bundle-SymbolicName" to moduleName
+			)
+		}
+		from(files(compileModule.map { "${it.destinationDir}/${moduleName}" })) {
+			include("module-info.class")
+		}
+	}
+
+	javadoc {
+		(options as StandardJavadocDocletOptions).apply {
+			memberLevel = JavadocMemberLevel.PROTECTED
+			isAuthor = true
+			header = "@API Guardian"
+			addStringOption("Xdoclint:html,syntax,reference", "-quiet")
+			links("https://docs.oracle.com/en/java/javase/11/docs/api/")
+		}
+	}
+
+	named<Jar>("sourcesJar") {
+		from("${moduleSourceDir}/${moduleName}") {
+			include("module-info.java")
+		}
+	}
+
+	named<Jar>("javadocJar") {
+		from(javadoc.map { File(it.destinationDir, "element-list") }) {
+			// For compatibility with older tools, e.g. NetBeans 11
+			rename { "package-list" }
+		}
+	}
+
+	withType<Jar>().configureEach {
+		from(rootDir) {
+			include("LICENSE")
+			into("META-INF")
+		}
+	}
+
+	val prepareDocsForUploadToGhPages by registering(Copy::class) {
+		dependsOn(javadoc)
+		outputs.dir(docsDir)
+
+		from("$buildDir/docs") {
+			include("javadoc/**")
+		}
+		from("$buildDir/docs/javadoc") {
+			// For compatibility with pre JDK 10 versions of the Javadoc tool
+			include("element-list")
+			rename { "api/package-list" }
+		}
+		into("${docsDir}/${docsVersion}")
+		filesMatching("javadoc/**") {
+			path = path.replace("javadoc/", "api/")
+		}
+		includeEmptyDirs = false
+	}
+
+	val createCurrentDocsFolder by registering(Copy::class) {
+		dependsOn(prepareDocsForUploadToGhPages)
+		enabled = replaceCurrentDocs
+		outputs.dir("${docsDir}/current")
+
+		from("${docsDir}/${docsVersion}")
+		into("${docsDir}/current")
+	}
+
+	gitPublishCommit {
+		dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder)
+	}
+}
+
+if (!isSnapshot) {
+	signing {
+		sign(publishing.publications)
+	}
+}
+
+nexusPublishing {
+	packageGroup.set(group.toString())
+	repositories {
+		sonatype()
+	}
+}
+
+publishing {
+	publications {
+		create<MavenPublication>("maven") {
+			from(components["java"])
+			pom {
+				name.set("${project.group}:${project.name}")
+				description.set("@API Guardian")
+				url.set("https://github.com/apiguardian-team/apiguardian")
+				scm {
+					connection.set("scm:git:git://github.com/apiguardian-team/apiguardian.git")
+					developerConnection.set("scm:git:git://github.com/apiguardian-team/apiguardian.git")
+					url.set("https://github.com/apiguardian-team/apiguardian")
+				}
+				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("apiguardian")
+						name.set("@API Guardian Team")
+						email.set("team at apiguardian.org")
+					}
+				}
+			}
+		}
+	}
+}
+
+gitPublish {
+	repoUri.set("https://github.com/apiguardian-team/apiguardian.git")
+	branch.set("gh-pages")
+
+	contents {
+		from(docsDir)
+		into("docs")
+	}
+
+	preserve {
+		include("**/*")
+		exclude("docs/$docsVersion/**")
+		if (replaceCurrentDocs) {
+			exclude("docs/current/**")
+		}
+	}
+}


=====================================
gradle.properties
=====================================
@@ -1,5 +1,5 @@
 group          = org.apiguardian
-version        = 1.1.0
+version        = 1.1.2
 
 defaultBuiltBy = @API Guardian Team
 releaseBranch  = master


=====================================
settings.gradle deleted
=====================================
@@ -1,7 +0,0 @@
-rootProject.name = 'apiguardian-api'
-
-// Require Java 11
-if (!JavaVersion.current().java11) {
-    throw new GradleException('The @API Guardian build requires Java 11. ' +
-            "Currently executing with Java ${JavaVersion.current()}.")
-}


=====================================
settings.gradle.kts
=====================================
@@ -0,0 +1,5 @@
+rootProject.name = "apiguardian-api"
+
+require(JavaVersion.current().isJava11) {
+    "The @API Guardian build requires Java 11. Currently executing with Java ${JavaVersion.current()}."
+}


=====================================
src/main/java/org/apiguardian/api/API.java
=====================================
@@ -19,6 +19,7 @@ package org.apiguardian.api;
 import static java.lang.annotation.ElementType.CONSTRUCTOR;
 import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PACKAGE;
 import static java.lang.annotation.ElementType.TYPE;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
@@ -38,9 +39,13 @@ import java.lang.annotation.Target;
  * a class annotated with {@code @API(status = STABLE)} may declare a constructor
  * for internal usage that is annotated with {@code @API(status = INTERNAL)}.
  *
+ * <p>If {@code @API} is present on a package, it is considered to hold for all
+ * public types in its package. The same rules for lowered stability apply as
+ * if they were specified on a type.
+ *
  * @since 1.0
  */
- at Target({ TYPE, METHOD, CONSTRUCTOR, FIELD })
+ at Target({ TYPE, METHOD, CONSTRUCTOR, FIELD, PACKAGE })
 @Retention(RUNTIME)
 @Documented
 public @interface API {
@@ -83,6 +88,12 @@ public @interface API {
 
 		/**
 		 * Should no longer be used. Might disappear in the next minor release..
+		 *
+		 * <p>This status is usually used in combination with the standard annotation
+		 * {@link Deprecated @Deprecated} because that annotation is recognized by
+		 * IDEs and the compiler. However, there are also cases where this status
+		 * can be used on its own, for example when transitioning a {@link #MAINTAINED}
+		 * feature to an {@link #INTERNAL} one.
 		 */
 		DEPRECATED,
 



View it on GitLab: https://salsa.debian.org/java-team/apiguardian/-/commit/67a1e7021d747693f63935311eaca5c299c37db8

-- 
View it on GitLab: https://salsa.debian.org/java-team/apiguardian/-/commit/67a1e7021d747693f63935311eaca5c299c37db8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20220714/cb07997d/attachment.htm>


More information about the pkg-java-commits mailing list