[Git][java-team/annotation-indexer][master] 6 commits: New upstream version 1.13

Emmanuel Bourg gitlab at salsa.debian.org
Mon Jan 27 09:12:24 GMT 2020



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / annotation-indexer


Commits:
eb6b9ae5 by Emmanuel Bourg at 2020-01-27T09:58:43+01:00
New upstream version 1.13
- - - - -
ba7a16bd by Emmanuel Bourg at 2020-01-27T09:58:44+01:00
Update upstream source from tag 'upstream/1.13'

Update to upstream version '1.13'
with Debian dir 15cc9ba0730ae31c4e2444503719efdefa6aa29f
- - - - -
16e874c4 by Emmanuel Bourg at 2020-01-27T10:07:33+01:00
Set the compatibility level to Java 8

- - - - -
f3cf8d4f by Emmanuel Bourg at 2020-01-27T10:07:38+01:00
Standards-Version updated to 4.5.0

- - - - -
231c4cba by Emmanuel Bourg at 2020-01-27T10:08:58+01:00
Removed the javadoc package

- - - - -
539ff9d6 by Emmanuel Bourg at 2020-01-27T10:09:16+01:00
Upload to unstable

- - - - -


13 changed files:

- + .github/release-drafter.yml
- + README.md
- debian/changelog
- debian/control
- − debian/libannotation-indexer-java-doc.doc-base.api
- − debian/libannotation-indexer-java-doc.install
- debian/maven.properties
- pom.xml
- src/main/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImpl.java
- src/main/java/org/jvnet/hudson/annotation_indexer/Index.java
- src/test/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImplTest.java
- src/test/java/org/jvnet/hudson/annotation_indexer/Utils.java
- + src/test/java/org/jvnet/hudson/annotation_indexer/package-info.java


Changes:

=====================================
.github/release-drafter.yml
=====================================
@@ -0,0 +1,2 @@
+_extends: .github
+tag-template: annotation-indexer-$NEXT_MINOR_VERSION


=====================================
README.md
=====================================
@@ -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)


=====================================
debian/changelog
=====================================
@@ -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 <ebourg at apache.org>  Mon, 27 Jan 2020 10:09:11 +0100
+
 annotation-indexer (1.12-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -6,14 +6,11 @@ Uploaders: James Page <james.page at ubuntu.com>
 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 @@ Description: Indexing and validation of Java annotations
  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.


=====================================
debian/libannotation-indexer-java-doc.doc-base.api deleted
=====================================
@@ -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/*


=====================================
debian/libannotation-indexer-java-doc.install deleted
=====================================
@@ -1 +0,0 @@
-target/apidocs/* usr/share/doc/libannotation-indexer-java/api


=====================================
debian/maven.properties
=====================================
@@ -3,3 +3,5 @@
 # maven.test.skip=true
 
 maven.test.skip=true
+
+maven.compiler.release=8


=====================================
pom.xml
=====================================
@@ -4,22 +4,27 @@
   <parent>
     <groupId>org.jenkins-ci</groupId>
     <artifactId>jenkins</artifactId>
-    <version>1.37</version>
+    <version>1.46</version>
     <relativePath />
   </parent>
 
   <artifactId>annotation-indexer</artifactId>
   <name>Annotation Indexer</name>
-  <version>1.12</version>
+  <version>1.13</version>
   <description>
     Creates index of annotations.
   </description>
 
+  <properties>
+    <java.level>8</java.level>
+    <java.level.test>8</java.level.test>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.kohsuke.metainf-services</groupId>
       <artifactId>metainf-services</artifactId>
-      <version>1.7</version>
+      <version>1.8</version>
       <optional>true</optional>
     </dependency>
     <dependency>
@@ -39,7 +44,7 @@
   <scm>
     <connection>scm:git:git://github.com/jenkinsci/lib-${project.artifactId}.git</connection>
     <developerConnection>scm:git:git at github.com:jenkinsci/lib-${project.artifactId}.git</developerConnection>
-    <tag>annotation-indexer-1.12</tag>
+    <tag>annotation-indexer-1.13</tag>
   </scm>
 
   <licenses>


=====================================
src/main/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImpl.java
=====================================
@@ -9,6 +9,7 @@ import javax.annotation.processing.SupportedAnnotationTypes;
 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 @@ public class AnnotationProcessorImpl extends AbstractProcessor {
             case CONSTRUCTOR:
                 t = (TypeElement) elt.getEnclosingElement();
                 break;
+            case PACKAGE:
+                classes.add(((PackageElement)elt).getQualifiedName().toString()+".*");
+                return;
+
             default:
 //                throw new AssertionError(elt.getKind());
                 return;


=====================================
src/main/java/org/jvnet/hudson/annotation_indexer/Index.java
=====================================
@@ -45,15 +45,13 @@ public class Index {
         final Enumeration<URL> 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 @@ public class Index {
                             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))


=====================================
src/test/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImplTest.java
=====================================
@@ -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 @@ public class AnnotationProcessorImplTest {
         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 @@ public class AnnotationProcessorImplTest {
         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 @@ public class AnnotationProcessorImplTest {
         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 @@ public class AnnotationProcessorImplTest {
         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 @@ public class AnnotationProcessorImplTest {
         assertFalse(it.hasNext());
     }
 
+
+    @Indexed @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PACKAGE) public @interface OnPackage {}
+    @Test public void packageinfo() throws IOException {
+        Iterator<AnnotatedElement> 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());
+    }
+
 }


=====================================
src/test/java/org/jvnet/hudson/annotation_indexer/Utils.java
=====================================
@@ -24,8 +24,7 @@ class Utils {
     // Filter out warnings about source 1.6 is obsolete in java 9
     // This usually appears with other warnings
     public static final List<String> 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<Diagnostic<? extends JavaFileObject>> filterObsoleteSourceVersionWarnings(List<Diagnostic<? extends JavaFileObject>> diagnostics) {


=====================================
src/test/java/org/jvnet/hudson/annotation_indexer/package-info.java
=====================================
@@ -0,0 +1,2 @@
+ at AnnotationProcessorImplTest.OnPackage
+package org.jvnet.hudson.annotation_indexer;



View it on GitLab: https://salsa.debian.org/java-team/annotation-indexer/compare/9babca3b50a179a2f29c8bacf1f9bf9068363ddd...539ff9d64eaea3d954ad5ead1f0fb0b3b68c826f

-- 
View it on GitLab: https://salsa.debian.org/java-team/annotation-indexer/compare/9babca3b50a179a2f29c8bacf1f9bf9068363ddd...539ff9d64eaea3d954ad5ead1f0fb0b3b68c826f
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/20200127/75c6e541/attachment.html>


More information about the pkg-java-commits mailing list