-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for indexing some common libraries
This commit makes creative use of the Maven plugin integration tests to verify that indexing some common libraries doesn't fail. It also alters the tests for recursive type parameters to look closer to how the most common recursive type, `Comparable`, is typically defined.
- Loading branch information
Showing
4 changed files
with
136 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.smallrye</groupId> | ||
<artifactId>smallrye-build-parent</artifactId> | ||
<version>31</version> | ||
</parent> | ||
|
||
<groupId>org.jboss.jandex</groupId> | ||
<artifactId>jandex-maven-plugin-someLibraries</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<version>29.0-jre</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>42.5.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.snmp4j</groupId> | ||
<artifactId>snmp4j</artifactId> | ||
<version>3.6.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.scala-lang</groupId> | ||
<artifactId>scala-library</artifactId> | ||
<version>2.9.1-1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib-jdk8</artifactId> | ||
<version>1.7.10</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>@version.maven-compiler-plugin@</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<id>make-index</id> | ||
<goals> | ||
<goal>jandex</goal> | ||
</goals> | ||
<configuration> | ||
<processDefaultFileSet>false</processDefaultFileSet> | ||
<indexDir>${project.build.directory}/index</indexDir> | ||
<fileSets> | ||
<fileSet> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
</dependency> | ||
</fileSet> | ||
<fileSet> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
</dependency> | ||
</fileSet> | ||
<fileSet> | ||
<dependency> | ||
<groupId>org.snmp4j</groupId> | ||
<artifactId>snmp4j</artifactId> | ||
</dependency> | ||
</fileSet> | ||
<fileSet> | ||
<dependency> | ||
<groupId>org.scala-lang</groupId> | ||
<artifactId>scala-library</artifactId> | ||
</dependency> | ||
</fileSet> | ||
<fileSet> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib-common</artifactId> | ||
</dependency> | ||
</fileSet> | ||
<fileSet> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib</artifactId> | ||
</dependency> | ||
</fileSet> | ||
<fileSet> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib-jdk7</artifactId> | ||
</dependency> | ||
</fileSet> | ||
<fileSet> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib-jdk8</artifactId> | ||
</dependency> | ||
</fileSet> | ||
</fileSets> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import org.jboss.jandex.IndexReader | ||
|
||
// index dir explicitly configured | ||
def jandexFile = new File(basedir, 'target/index/jandex.idx') | ||
assert jandexFile.exists() : "File ${jandexFile} does not exist" | ||
assert jandexFile.length() > 0 : "File ${jandexFile} is empty" | ||
|
||
index = new IndexReader(jandexFile.newInputStream()).read() | ||
assert index.getKnownClasses().size() > 0 : "Index ${jandexFile} contains no class" |