[Git][java-team/annotation-indexer][master] 5 commits: New upstream version 1.14
Emmanuel Bourg
gitlab at salsa.debian.org
Thu Jan 7 09:18:36 GMT 2021
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / annotation-indexer
Commits:
21f8246f by Emmanuel Bourg at 2021-01-07T10:16:19+01:00
New upstream version 1.14
- - - - -
ebc58958 by Emmanuel Bourg at 2021-01-07T10:16:20+01:00
Update upstream source from tag 'upstream/1.14'
Update to upstream version '1.14'
with Debian dir 9e9dc242f7d87207282ab7edc5243586f6f9fadb
- - - - -
4e2d5d7e by Emmanuel Bourg at 2021-01-07T10:16:57+01:00
Standards-Version updated to 4.5.1
- - - - -
4bf79443 by Emmanuel Bourg at 2021-01-07T10:17:00+01:00
Switch to debhelper level 13
- - - - -
914d1ef5 by Emmanuel Bourg at 2021-01-07T10:17:22+01:00
Upload to unstable
- - - - -
7 changed files:
- debian/changelog
- − debian/compat
- debian/control
- 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
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+annotation-indexer (1.14-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream release
+ * Standards-Version updated to 4.5.1
+ * Switch to debhelper level 13
+
+ -- Emmanuel Bourg <ebourg at apache.org> Thu, 07 Jan 2021 10:17:07 +0100
+
annotation-indexer (1.13-1) unstable; urgency=medium
* Team upload.
=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-11
=====================================
debian/control
=====================================
@@ -4,13 +4,13 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: James Page <james.page at ubuntu.com>
Build-Depends:
- debhelper (>= 11),
+ debhelper-compat (= 13),
default-jdk,
junit4,
libmaven-compiler-plugin-java,
libmetainf-services-java,
maven-debian-helper
-Standards-Version: 4.5.0
+Standards-Version: 4.5.1
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
=====================================
pom.xml
=====================================
@@ -10,7 +10,7 @@
<artifactId>annotation-indexer</artifactId>
<name>Annotation Indexer</name>
- <version>1.13</version>
+ <version>1.14</version>
<description>
Creates index of annotations.
</description>
@@ -44,7 +44,8 @@
<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.13</tag>
+ <url>https://github.com/jenkinsci/lib-annotation-indexer</url>
+ <tag>annotation-indexer-1.14</tag>
</scm>
<licenses>
=====================================
src/main/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImpl.java
=====================================
@@ -93,7 +93,7 @@ public class AnnotationProcessorImpl extends AbstractProcessor {
}
String getIndexFileName() {
- return "META-INF/annotations/" + annotationName;
+ return "META-INF/services/annotations/" + annotationName;
}
/**
=====================================
src/main/java/org/jvnet/hudson/annotation_indexer/Index.java
=====================================
@@ -7,6 +7,7 @@ import java.io.InputStreamReader;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.net.URL;
+import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedList;
@@ -20,6 +21,14 @@ import java.util.logging.Logger;
* @author Kohsuke Kawaguchi
*/
public class Index {
+ /**
+ * Resource path in which we look up the index.
+ *
+ * <p>
+ * Historically we put things under META-INF/annotations.
+ */
+ private static final List<String> PREFIXES = Arrays.asList("META-INF/annotations/", "META-INF/services/annotations/");
+
/**
* Lists up all the elements annotated by the given annotation and of the given {@link AnnotatedElement} subtype.
*/
@@ -42,15 +51,17 @@ public class Index {
final Set<String> ids = new TreeSet<String>();
- final Enumeration<URL> res = cl.getResources("META-INF/annotations/"+type.getName());
- while (res.hasMoreElements()) {
- URL url = res.nextElement();
+ for (String prefix : PREFIXES) {
+ final Enumeration<URL> res = cl.getResources(prefix + type.getName());
+ while (res.hasMoreElements()) {
+ URL url = res.nextElement();
- try (InputStream is = url.openStream();
- BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8"))) {
- String line;
- while ((line = r.readLine()) != null) {
- ids.add(line);
+ try (InputStream is = url.openStream();
+ BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8"))) {
+ String line;
+ while ((line = r.readLine()) != null) {
+ ids.add(line);
+ }
}
}
}
=====================================
src/test/java/org/jvnet/hudson/annotation_indexer/AnnotationProcessorImplTest.java
=====================================
@@ -29,7 +29,7 @@ public class AnnotationProcessorImplTest {
addLine("@some.api.A public class Stuff {}");
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"));
+ assertEquals("some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/services/annotations/some.api.A"));
}
@Indexed @Retention(RetentionPolicy.RUNTIME) public @interface A {}
@@ -40,7 +40,7 @@ public class AnnotationProcessorImplTest {
addLine("@" + A.class.getCanonicalName() + " public class Stuff {}");
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()));
+ assertEquals("some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/services/annotations/" + A.class.getName()));
}
@Test public void incremental() {
@@ -50,14 +50,14 @@ public class AnnotationProcessorImplTest {
addLine("@" + A.class.getCanonicalName() + " public class Stuff {}");
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()));
+ assertEquals("some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/services/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", "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()));
+ assertEquals("some.pkg.MoreStuff" + System.getProperty("line.separator") + "some.pkg.Stuff" + System.getProperty("line.separator"), Utils.getGeneratedResource(compilation, "META-INF/services/annotations/" + A.class.getName()));
}
@Indexed @Retention(RetentionPolicy.RUNTIME) @Inherited public @interface B {}
@@ -70,7 +70,7 @@ public class AnnotationProcessorImplTest {
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()));
+ assertEquals("some.pkg.Stuff\n", Utils.getGeneratedResource(compilation, "META-INF/services/annotations/" + B.class.getName()));
*/
}
View it on GitLab: https://salsa.debian.org/java-team/annotation-indexer/-/compare/539ff9d64eaea3d954ad5ead1f0fb0b3b68c826f...914d1ef5e658cc646a594af04641461b62958fe1
--
View it on GitLab: https://salsa.debian.org/java-team/annotation-indexer/-/compare/539ff9d64eaea3d954ad5ead1f0fb0b3b68c826f...914d1ef5e658cc646a594af04641461b62958fe1
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/20210107/492002be/attachment.html>
More information about the pkg-java-commits
mailing list