Skip to content

Commit

Permalink
Add module-info.java, fixes rzymek#2
Browse files Browse the repository at this point in the history
- Bump test dependency + plugin versions
- Set project.build.sourceEncoding to fix build warning
- Fix FileListTest when run as a module
- Bump Travis JDK version to oraclejdk9
- Set scm.url without property reference so it works on search.maven.org
  • Loading branch information
zimmi committed Apr 14, 2021
1 parent 7ddb774 commit 8a0d80d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
language: java
jdk: oraclejdk8
jdk: oraclejdk9
34 changes: 18 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url>https://github.com/rzymek/opczip</url>

<scm>
<url>${project.url}</url>
<url>https://github.com/rzymek/opczip</url>
</scm>

<licenses>
Expand All @@ -32,15 +32,15 @@
</developers>

<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>9</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.0</version>
<version>5.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -52,13 +52,13 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.15.0</version>
<version>3.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.7.0-M1</version>
<version>5.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -70,24 +70,26 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.23</version>
<version>1.29</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.0.0-M5</version>
<configuration>
<argLine>
--add-opens com.github.rzymek.opczip/com.github.rzymek.opczip=ALL-UNNAMED
--add-opens com.github.rzymek.opczip/com.github.rzymek.opczip.reader=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
<version>3.8.1</version>
</plugin>
</plugins>
</build>
Expand All @@ -100,7 +102,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -113,7 +115,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -140,7 +142,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module com.github.rzymek.opczip {
exports com.github.rzymek.opczip;
exports com.github.rzymek.opczip.reader;
exports com.github.rzymek.opczip.reader.ordered;
exports com.github.rzymek.opczip.reader.skipping;
}
37 changes: 15 additions & 22 deletions src/test/java/com/github/rzymek/opczip/reader/FileListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

Expand Down Expand Up @@ -66,25 +69,15 @@ private InputStream open(String filename) {

@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext extensionContext) {
InputStream resource = FileListTest.class.getResourceAsStream(XLSX_DIR);
Scanner scanner = new Scanner(resource);
return StreamSupport.stream(
Spliterators.spliteratorUnknownSize(new Iterator<>() {
@Override
public boolean hasNext() {
boolean hasNext = scanner.hasNext();
if (!hasNext) {
scanner.close();
}
return hasNext;
}

@Override
public Arguments next() {
return Arguments.of(scanner.nextLine());
}
}, Spliterator.ORDERED),
false
);
try {
URI resource = FileListTest.class.getResource(XLSX_DIR).toURI();
Path path = Paths.get(resource);
return Files.list(path)
.map(Path::getFileName)
.map(Path::toString)
.map(Arguments::of);
} catch (URISyntaxException | IOException ex) {
throw new IllegalStateException(ex);
}
}
}

0 comments on commit 8a0d80d

Please sign in to comment.