diff -Nru annotation-indexer-1.12/debian/changelog annotation-indexer-1.13/debian/changelog --- annotation-indexer-1.12/debian/changelog 2018-06-06 13:03:54.000000000 +0000 +++ annotation-indexer-1.13/debian/changelog 2020-01-27 09:09:11.000000000 +0000 @@ -1,3 +1,13 @@ +annotation-indexer (1.13-1) unstable; urgency=medium + + * Team upload. + * New upstream release + - Set the compatibility level to Java 8 + * Standards-Version updated to 4.5.0 + * Removed the javadoc package + + -- Emmanuel Bourg Mon, 27 Jan 2020 10:09:11 +0100 + annotation-indexer (1.12-1) unstable; urgency=medium * Team upload. diff -Nru annotation-indexer-1.12/debian/control annotation-indexer-1.13/debian/control --- annotation-indexer-1.12/debian/control 2018-06-06 12:44:54.000000000 +0000 +++ annotation-indexer-1.13/debian/control 2020-01-27 09:08:06.000000000 +0000 @@ -6,14 +6,11 @@ Build-Depends: debhelper (>= 11), default-jdk, - default-jdk-doc, junit4, libmaven-compiler-plugin-java, - libmaven-javadoc-plugin-java, libmetainf-services-java, - libmetainf-services-java-doc, maven-debian-helper -Standards-Version: 4.1.4 +Standards-Version: 4.5.0 Vcs-Git: https://salsa.debian.org/java-team/annotation-indexer.git Vcs-Browser: https://salsa.debian.org/java-team/annotation-indexer Homepage: https://github.com/jenkinsci/lib-annotation-indexer @@ -27,20 +24,3 @@ with the @Indexed annotation at compile time and supports validation of indexes to allow for early error detection and querying of the indexed elements for specific annotations. - -Package: libannotation-indexer-java-doc -Architecture: all -Section: doc -Depends: - default-jdk-doc, - libmetainf-services-java-doc, - ${maven:DocDepends}, - ${misc:Depends} -Suggests: libannotation-indexer-java -Description: Documentation for libannotation-indexer-java - Annotation Indexer builds indices of Java code annotated - with the @Indexed annotation at compile time and supports - validation of indexes to allow for early error detection and - querying of the indexed elements for specific annotations. - . - This package provides the API documentation for libannotation-indexer-java. diff -Nru annotation-indexer-1.12/debian/libannotation-indexer-java-doc.doc-base.api annotation-indexer-1.13/debian/libannotation-indexer-java-doc.doc-base.api --- annotation-indexer-1.12/debian/libannotation-indexer-java-doc.doc-base.api 2018-06-06 12:38:09.000000000 +0000 +++ annotation-indexer-1.13/debian/libannotation-indexer-java-doc.doc-base.api 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -Document: libannotation-indexer-java -Title: API Javadoc for annotation-indexer -Author: annotation-indexer developers -Abstract: This is the API Javadoc provided for the - libannotation-indexer-java library. -Section: Programming - -Format: HTML -Index: /usr/share/doc/libannotation-indexer-java/api/index.html -Files: /usr/share/doc/libannotation-indexer-java/api/* diff -Nru annotation-indexer-1.12/debian/libannotation-indexer-java-doc.install annotation-indexer-1.13/debian/libannotation-indexer-java-doc.install --- annotation-indexer-1.12/debian/libannotation-indexer-java-doc.install 2018-06-06 12:38:09.000000000 +0000 +++ annotation-indexer-1.13/debian/libannotation-indexer-java-doc.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -target/apidocs/* usr/share/doc/libannotation-indexer-java/api diff -Nru annotation-indexer-1.12/debian/maven.properties annotation-indexer-1.13/debian/maven.properties --- annotation-indexer-1.12/debian/maven.properties 2018-06-06 12:38:09.000000000 +0000 +++ annotation-indexer-1.13/debian/maven.properties 2020-01-27 09:05:16.000000000 +0000 @@ -3,3 +3,5 @@ # maven.test.skip=true maven.test.skip=true + +maven.compiler.release=8 diff -Nru annotation-indexer-1.12/.github/release-drafter.yml annotation-indexer-1.13/.github/release-drafter.yml --- annotation-indexer-1.12/.github/release-drafter.yml 1970-01-01 00:00:00.000000000 +0000 +++ annotation-indexer-1.13/.github/release-drafter.yml 2019-12-27 08:57:32.000000000 +0000 @@ -0,0 +1,2 @@ +_extends: .github +tag-template: annotation-indexer-$NEXT_MINOR_VERSION diff -Nru annotation-indexer-1.12/pom.xml annotation-indexer-1.13/pom.xml --- annotation-indexer-1.12/pom.xml 2017-06-21 19:19:24.000000000 +0000 +++ annotation-indexer-1.13/pom.xml 2019-12-27 08:57:32.000000000 +0000 @@ -4,22 +4,27 @@ org.jenkins-ci jenkins - 1.37 + 1.46 annotation-indexer Annotation Indexer - 1.12 + 1.13 Creates index of annotations. + + 8 + 8 + + org.kohsuke.metainf-services metainf-services - 1.7 + 1.8 true @@ -39,7 +44,7 @@ scm:git:git://github.com/jenkinsci/lib-${project.artifactId}.git scm:git:git@github.com:jenkinsci/lib-${project.artifactId}.git - annotation-indexer-1.12 + annotation-indexer-1.13 diff -Nru annotation-indexer-1.12/README.md annotation-indexer-1.13/README.md --- annotation-indexer-1.12/README.md 1970-01-01 00:00:00.000000000 +0000 +++ annotation-indexer-1.13/README.md 2019-12-27 08:57:32.000000000 +0000 @@ -0,0 +1,12 @@ +# Annotation Indexer library + +The library creates an index of annotations which can be then accessed by other components. +It is used inside the [Jenkins project](http://jenkins.io), but it can be also used in other projects. + +## Javadoc + +To be published soon, see https://github.com/jenkins-infra/javadoc/pull/22 + +## Changelog + +For version 1.13 and above, see [GitHub Releases](https://github.com/jenkinsci/lib-annotation-indexer/releases) diff -Nru annotation-indexer-1.12/src/main/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImpl.java annotation-indexer-1.13/src/main/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImpl.java --- annotation-indexer-1.12/src/main/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImpl.java 2017-06-21 19:19:24.000000000 +0000 +++ annotation-indexer-1.13/src/main/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImpl.java 2019-12-27 08:57:32.000000000 +0000 @@ -9,6 +9,7 @@ import javax.lang.model.SourceVersion; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; +import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; import javax.lang.model.util.Elements; import javax.tools.Diagnostic.Kind; @@ -80,6 +81,10 @@ case CONSTRUCTOR: t = (TypeElement) elt.getEnclosingElement(); break; + case PACKAGE: + classes.add(((PackageElement)elt).getQualifiedName().toString()+".*"); + return; + default: // throw new AssertionError(elt.getKind()); return; diff -Nru annotation-indexer-1.12/src/main/java/org/jvnet/hudson/annotation_indexer/Index.java annotation-indexer-1.13/src/main/java/org/jvnet/hudson/annotation_indexer/Index.java --- annotation-indexer-1.12/src/main/java/org/jvnet/hudson/annotation_indexer/Index.java 2017-06-21 19:19:24.000000000 +0000 +++ annotation-indexer-1.13/src/main/java/org/jvnet/hudson/annotation_indexer/Index.java 2019-12-27 08:57:32.000000000 +0000 @@ -45,15 +45,13 @@ final Enumeration res = cl.getResources("META-INF/annotations/"+type.getName()); while (res.hasMoreElements()) { URL url = res.nextElement(); - InputStream is = url.openStream(); - try { - BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8")); + + try (InputStream is = url.openStream(); + BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8"))) { String line; while ((line = r.readLine()) != null) { ids.add(line); } - } finally { - is.close(); } } @@ -96,6 +94,11 @@ String name = iditr.next(); try { + if (name.endsWith(".*")) { + final Package p = Package.getPackage(name.substring(0, name.length() - 2)); + lookaheads.add(p); + } + Class c = cl.loadClass(name); if (c.isAnnotationPresent(type)) diff -Nru annotation-indexer-1.12/src/test/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImplTest.java annotation-indexer-1.13/src/test/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImplTest.java --- annotation-indexer-1.12/src/test/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImplTest.java 2017-06-21 19:19:24.000000000 +0000 +++ annotation-indexer-1.13/src/test/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImplTest.java 2019-12-27 08:57:32.000000000 +0000 @@ -1,5 +1,6 @@ package org.jvnet.hudson.annotation_indexer; +import java.io.IOException; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; @@ -26,7 +27,7 @@ compilation.addSource("some.pkg.Stuff"). addLine("package some.pkg;"). addLine("@some.api.A public class Stuff {}"); - compilation.doCompile(null, "-source", "6"); + compilation.doCompile(null, "-source", "8"); assertEquals(Collections.emptyList(), Utils.filterObsoleteSourceVersionWarnings(compilation.getDiagnostics())); assertEquals("some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/annotations/some.api.A")); } @@ -37,7 +38,7 @@ compilation.addSource("some.pkg.Stuff"). addLine("package some.pkg;"). addLine("@" + A.class.getCanonicalName() + " public class Stuff {}"); - compilation.doCompile(null, "-source", "6"); + compilation.doCompile(null, "-source", "8"); assertEquals(Collections.emptyList(), Utils.filterObsoleteSourceVersionWarnings(compilation.getDiagnostics())); assertEquals("some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/annotations/" + A.class.getName())); } @@ -47,14 +48,14 @@ compilation.addSource("some.pkg.Stuff"). addLine("package some.pkg;"). addLine("@" + A.class.getCanonicalName() + " public class Stuff {}"); - compilation.doCompile(null, "-source", "6"); + compilation.doCompile(null, "-source", "8"); assertEquals(Collections.emptyList(), Utils.filterObsoleteSourceVersionWarnings(compilation.getDiagnostics())); assertEquals("some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/annotations/" + A.class.getName())); compilation = new Compilation(compilation); compilation.addSource("some.pkg.MoreStuff"). addLine("package some.pkg;"). addLine("@" + A.class.getCanonicalName() + " public class MoreStuff {}"); - compilation.doCompile(null, "-source", "6"); + compilation.doCompile(null, "-source", "8"); assertEquals(Collections.emptyList(), Utils.filterObsoleteSourceVersionWarnings(compilation.getDiagnostics())); assertEquals("some.pkg.MoreStuff" + System.getProperty("line.separator") + "some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/annotations/" + A.class.getName())); } @@ -66,7 +67,7 @@ compilation.addSource("some.pkg.Stuff"). addLine("package some.pkg;"). addLine("public class Stuff extends " + Super.class.getCanonicalName() + " {}"); - compilation.doCompile(null, "-source", "6"); + compilation.doCompile(null, "-source", "8"); assertEquals(Collections.emptyList(), Utils.filterObsoleteSourceVersionWarnings(compilation.getDiagnostics())); /* XXX #7188605 currently broken on JDK 6; perhaps need to use a ElementScanner6 on roundEnv.rootElements whose visitType checks for annotations assertEquals("some.pkg.Stuff\n", Utils.getGeneratedResource(compilation, "META-INF/annotations/" + B.class.getName())); @@ -109,4 +110,13 @@ assertFalse(it.hasNext()); } + + @Indexed @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PACKAGE) public @interface OnPackage {} + @Test public void packageinfo() throws IOException { + Iterator it = Index.list(OnPackage.class, Stuff.class.getClassLoader()).iterator(); + assertTrue(it.hasNext()); + final Package p = (Package) it.next(); + assertEquals("org.jvnet.hudson.annotation_indexer", p.getName()); + } + } diff -Nru annotation-indexer-1.12/src/test/java/org/jvnet/hudson/annotation_indexer/package-info.java annotation-indexer-1.13/src/test/java/org/jvnet/hudson/annotation_indexer/package-info.java --- annotation-indexer-1.12/src/test/java/org/jvnet/hudson/annotation_indexer/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ annotation-indexer-1.13/src/test/java/org/jvnet/hudson/annotation_indexer/package-info.java 2019-12-27 08:57:32.000000000 +0000 @@ -0,0 +1,2 @@ +@AnnotationProcessorImplTest.OnPackage +package org.jvnet.hudson.annotation_indexer; diff -Nru annotation-indexer-1.12/src/test/java/org/jvnet/hudson/annotation_indexer/Utils.java annotation-indexer-1.13/src/test/java/org/jvnet/hudson/annotation_indexer/Utils.java --- annotation-indexer-1.12/src/test/java/org/jvnet/hudson/annotation_indexer/Utils.java 2017-06-21 19:19:24.000000000 +0000 +++ annotation-indexer-1.13/src/test/java/org/jvnet/hudson/annotation_indexer/Utils.java 2019-12-27 08:57:32.000000000 +0000 @@ -24,8 +24,7 @@ // Filter out warnings about source 1.6 is obsolete in java 9 // This usually appears with other warnings public static final List IGNORE = Arrays.asList( - "source value 1.6 is obsolete and will be removed in a future release", // Filter out warnings about source 1.6 is obsolete in java 9 - "To suppress warnings about obsolete options" // This usually appears with other warnings + "RELEASE_6" // Filter out warnings about source 1.6 is obsolete in java 9+ ); public static List> filterObsoleteSourceVersionWarnings(List> diagnostics) {