[Git][java-team/apiguardian][master] 7 commits: Update debian/watch to match path to source tarball on github.com
Tony Mancill (@tmancill)
gitlab at salsa.debian.org
Thu Jul 14 05:11:25 BST 2022
Tony Mancill pushed to branch master at Debian Java Maintainers / apiguardian
Commits:
ab28674f by tony mancill at 2022-07-12T20:28:33-07:00
Update debian/watch to match path to source tarball on github.com
- - - - -
5b206bf1 by tony mancill at 2022-07-12T20:29:15-07:00
Freshen years in debian/copyright
- - - - -
67a1e702 by tony mancill at 2022-07-12T20:29:55-07:00
New upstream version 1.1.2
- - - - -
5f496169 by tony mancill at 2022-07-12T20:29:55-07:00
Update upstream source from tag 'upstream/1.1.2'
Update to upstream version '1.1.2'
with Debian dir abed1afab2fe07de033ac5a34d76f1ee9f4f2049
- - - - -
c076a0fd by tony mancill at 2022-07-12T22:04:22-07:00
Add 01-build_gradle.patch for compilation without Kotlin
- - - - -
61f4ad08 by tony mancill at 2022-07-12T22:26:19-07:00
Add build-dep on bnd and invoke bnd plugin during build
- - - - -
21b630d1 by tony mancill at 2022-07-12T22:26:19-07:00
Prepare changelog for upload to unstable
- - - - -
20 changed files:
- + .github/workflows/main.yml
- − .travis.yml
- README.md
- − build.gradle
- + build.gradle.kts
- debian/changelog
- debian/control
- debian/copyright
- + debian/patches/01-build_gradle.patch
- − debian/patches/01-ignore-versioning-plugin.patch
- − debian/patches/02-ignore-github-pages-plugin.patch
- − debian/patches/03-reproducible-builds-timestamp.patch
- − debian/patches/04-build-on-java-17.patch
- debian/patches/series
- debian/rules
- debian/watch
- 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
-[](https://travis-ci.org/apiguardian-team/apiguardian)
+[](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/**")
+ }
+ }
+}
=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+apiguardian (1.1.2-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream version 1.1.2 (Closes: #1014825)
+ * Update debian/watch to match path to source tarball on github.com
+ * Freshen years in debian/copyright
+ * Patch build.gradle.kts to build.gradle until we have Kotlin support
+ * Add build-dep on bnd and invoke bnd plugin during build
+
+ -- tony mancill <tmancill at debian.org> Tue, 12 Jul 2022 22:23:42 -0700
+
apiguardian (1.1.0-4) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -4,6 +4,7 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: Emmanuel Bourg <ebourg at apache.org>
Build-Depends:
+ bnd,
debhelper-compat (= 13),
default-jdk,
gradle-debian-helper,
=====================================
debian/copyright
=====================================
@@ -5,7 +5,7 @@ Files-Excluded: gradlew*
gradle/wrapper
Files: *
-Copyright: 2017-2019, Marc Philipp
+Copyright: 2017-2021, Marc Philipp
2017, Sam Brannen
License: Apache-2.0
=====================================
debian/patches/01-build_gradle.patch
=====================================
@@ -0,0 +1,399 @@
+Description: patch build.gradle.kts to Groovy-based build.gradle for Debian
+Forwarded: not-needed
+Comment: this file is based on the build.gradle from apiguardian 1.1.0
+
+--- a/build.gradle.kts
++++ b/build.gradle.kts
+@@ -1,218 +1,206 @@
+-import java.time.OffsetDateTime
+-import java.time.format.DateTimeFormatter
++import java.text.SimpleDateFormat
++
++buildscript {
++ dependencies {
++ // Create OSGI bundles
++ classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1"
++ }
++}
+
+ 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")
++ id 'java'
++ id 'eclipse'
++ id 'idea'
++ id 'maven'
++ id 'signing'
++}
++
++apply plugin: 'biz.aQute.bnd.builder'
++
++// https://reproducible-builds.org/docs/source-date-epoch/
++String source_date_epoch = System.getenv("SOURCE_DATE_EPOCH");
++if (source_date_epoch != null) {
++ TimeZone.setDefault(TimeZone.getTimeZone("UTC"))
++}
++Date buildTimeAndDate = source_date_epoch == null ?
++ new Date() :
++ new Date(1000 * Long.parseLong(source_date_epoch))
++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"
+-val moduleName = "org.apiguardian.api"
++description = '@API Guardian'
++def 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")
+- }
+- }
++compileJava {
++ options.compilerArgs = ['--release', '8']
++}
+
+- 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")
+- }
++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)
+ }
++}
+
+- named<Jar>("javadocJar") {
+- from(javadoc.map { File(it.destinationDir, "element-list") }) {
+- // For compatibility with older tools, e.g. NetBeans 11
+- rename { "package-list" }
+- }
++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,
++ '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',
++ 'Bundle-Name': project.name,
++ 'Bundle-Description': project.description,
++ 'Bundle-DocURL': 'https://github.com/apiguardian-team/apiguardian',
++ 'Bundle-Vendor': 'apiguardian.org',
++ '-exportcontents': 'org.apiguardian.api',
++ 'Bundle-SymbolicName': moduleName
++ )
+ }
+-
+- withType<Jar>().configureEach {
+- from(rootDir) {
+- include("LICENSE")
+- into("META-INF")
+- }
++ from(files("${compileModule.destinationDir}/$moduleName").builtBy(compileModule)) {
++ include('module-info.class')
+ }
++}
+
+- 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
+- }
++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/'
++}
+
+- val createCurrentDocsFolder by registering(Copy::class) {
+- dependsOn(prepareDocsForUploadToGhPages)
+- enabled = replaceCurrentDocs
+- outputs.dir("${docsDir}/current")
++task sourcesJar(type: Jar, dependsOn: classes) {
++ classifier = 'sources'
++ from sourceSets.main.allSource
++}
+
+- from("${docsDir}/${docsVersion}")
+- into("${docsDir}/current")
+- }
++task javadocJar(type: Jar) {
++ classifier = 'javadoc'
++ from javadoc
++}
+
+- gitPublishCommit {
+- dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder)
+- }
++artifacts {
++ archives sourcesJar
++ archives javadocJar
+ }
+
+-if (!isSnapshot) {
++def signArtifacts = !project.version.contains('SNAPSHOT')
++
++if (signArtifacts) {
+ signing {
+- sign(publishing.publications)
++ sign configurations.archives
+ }
+ }
+
+-nexusPublishing {
+- packageGroup.set(group.toString())
++uploadArchives {
++
++ dependsOn check
++
+ repositories {
+- sonatype()
+- }
+-}
++ 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'
+
+-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")
++ 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.set("The Apache License, Version 2.0")
+- url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
++ name 'The Apache License, Version 2.0'
++ url '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")
++ id 'apiguardian'
++ name '@API Guardian Team'
++ email 'team at apiguardian.org'
+ }
+ }
+ }
++
++ pom.whenConfigured { p ->
++ p.dependencies = p.dependencies.findAll { dep -> dep.scope != 'test' }
++ }
+ }
+ }
+ }
+
+-gitPublish {
+- repoUri.set("https://github.com/apiguardian-team/apiguardian.git")
+- branch.set("gh-pages")
+-
+- contents {
+- from(docsDir)
+- into("docs")
+- }
++def docsVersion = project.version.contains('SNAPSHOT') ? 'snapshot' : project.version
++def docsDir = new File(buildDir, 'ghpages-docs')
+
+- preserve {
+- include("**/*")
+- exclude("docs/$docsVersion/**")
+- if (replaceCurrentDocs) {
+- exclude("docs/current/**")
+- }
++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') }
+--- a/settings.gradle.kts
++++ b/settings.gradle.kts
+@@ -1,5 +1,6 @@
+ rootProject.name = "apiguardian-api"
+
+-require(JavaVersion.current().isJava11) {
+- "The @API Guardian build requires Java 11. Currently executing with Java ${JavaVersion.current()}."
++if (!JavaVersion.current().isJava11Compatible()) {
++ throw new GradleException('The @API Guardian build requires Java 11. ' +
++ "Currently executing with Java ${JavaVersion.current()}.")
+ }
=====================================
debian/patches/01-ignore-versioning-plugin.patch deleted
=====================================
@@ -1,21 +0,0 @@
-Description: Disables the net.nemerosa.versioning plugin
-Author: Emmanuel Bourg <ebourg at apache.org>
-Forwarded: not-needed
---- a/build.gradle
-+++ b/build.gradle
-@@ -6,7 +6,6 @@
- id 'idea'
- id 'maven'
- id 'signing'
-- id 'net.nemerosa.versioning' version '2.6.1'
- id 'org.ajoberstar.github-pages' version '1.7.2'
- }
-
-@@ -59,7 +58,6 @@
- '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',
=====================================
debian/patches/02-ignore-github-pages-plugin.patch deleted
=====================================
@@ -1,36 +0,0 @@
-Description: Disables the github-pages plugin
-Author: Emmanuel Bourg <ebourg at apache.org>
-Forwarded: not-needed
---- a/build.gradle
-+++ b/build.gradle
-@@ -6,7 +6,6 @@
- id 'idea'
- id 'maven'
- id 'signing'
-- id 'org.ajoberstar.github-pages' version '1.7.2'
- }
-
- Date buildTimeAndDate = new Date()
-@@ -183,22 +182,3 @@
- }
-
- 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)
=====================================
debian/patches/03-reproducible-builds-timestamp.patch deleted
=====================================
@@ -1,25 +0,0 @@
-Add support for SOURCE_DATE_EPOCH to avoid embedding timestamp in .jar
-file.
-
-https://reproducible-builds.org/docs/source-date-epoch/
-
-Index: apiguardian/build.gradle
-===================================================================
---- apiguardian.orig/build.gradle
-+++ apiguardian/build.gradle
-@@ -8,7 +8,14 @@ plugins {
- id 'signing'
- }
-
--Date buildTimeAndDate = new Date()
-+// https://reproducible-builds.org/docs/source-date-epoch/
-+String source_date_epoch = System.getenv("SOURCE_DATE_EPOCH");
-+if (source_date_epoch != null) {
-+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"))
-+}
-+Date buildTimeAndDate = source_date_epoch == null ?
-+ new Date() :
-+ new Date(1000 * Long.parseLong(source_date_epoch))
- ext {
- buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
- buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
=====================================
debian/patches/04-build-on-java-17.patch deleted
=====================================
@@ -1,26 +0,0 @@
-Description: attempt build on Java versions >= 11
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011536
-Author: tony mancill <tmancill at debian.org>
-
---- a/settings.gradle
-+++ b/settings.gradle
-@@ -1,7 +1,7 @@
- rootProject.name = 'apiguardian-api'
-
- // Require Java 11
--if (!JavaVersion.current().java11) {
-+if (!JavaVersion.current().isJava11Compatible()) {
- throw new GradleException('The @API Guardian build requires Java 11. ' +
- "Currently executing with Java ${JavaVersion.current()}.")
- }
---- a/build.gradle
-+++ b/build.gradle
-@@ -30,7 +30,7 @@
- }
-
- compileJava {
-- options.compilerArgs = ['--release', '6']
-+ options.compilerArgs = ['--release', '8']
- }
-
- task compileModule(type: JavaCompile) {
=====================================
debian/patches/series
=====================================
@@ -1,4 +1 @@
-01-ignore-versioning-plugin.patch
-02-ignore-github-pages-plugin.patch
-03-reproducible-builds-timestamp.patch
-04-build-on-java-17.patch
+01-build_gradle.patch
=====================================
debian/rules
=====================================
@@ -2,3 +2,15 @@
%:
dh $@ --buildsystem=gradle --with maven-repo-helper
+
+override_dh_auto_clean:
+ dh_auto_clean
+ # Remove the build.gradle file we created during configure
+ -rm build.gradle settings.gradle
+
+override_dh_auto_configure:
+ # Until the Debian Gradle toolchain has Kotlin support,
+ # copy the (patched) build.gradle.kts to build.gradle
+ cp build.gradle.kts build.gradle
+ cp settings.gradle.kts settings.gradle
+ dh_auto_configure
=====================================
debian/watch
=====================================
@@ -1,3 +1,3 @@
version=4
opts="repack,compression=xz" \
-https://github.com/apiguardian-team/apiguardian/tags .*/archive/r at ANY_VERSION@\.tar\.gz
+https://github.com/apiguardian-team/apiguardian/tags .*/archive/refs/tags/r at ANY_VERSION@\.tar\.gz
=====================================
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/-/compare/d4804249e28fdc2f228bd56e88293298c34f77b3...21b630d1380ce9ae59f8268c0a8a2fae63e50b06
--
View it on GitLab: https://salsa.debian.org/java-team/apiguardian/-/compare/d4804249e28fdc2f228bd56e88293298c34f77b3...21b630d1380ce9ae59f8268c0a8a2fae63e50b06
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/3eed5110/attachment.htm>
More information about the pkg-java-commits
mailing list