Changed compiler compliance to 11, modularized all packages (#114)

* added module- and package-info.java, changed JRE from 8 to 11

* updated maven from Java 1.8 to 11

Co-authored-by: CyB3RC0nN0R <kske@outlook.de>
This commit is contained in:
delvh 2020-03-07 19:38:06 +01:00 committed by GitHub
parent 930d1cebe1
commit 9896339f92
14 changed files with 163 additions and 79 deletions

View File

@ -18,7 +18,7 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

View File

@ -9,9 +9,9 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Build with Maven
run: mvn -B package --file pom.xml

View File

@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -87,7 +87,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warn
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
@ -127,4 +127,4 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=11

145
pom.xml
View File

@ -1,68 +1,77 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>informatik-ag-ngl</groupId>
<artifactId>envoy-client</artifactId>
<version>0.3-alpha</version>
<name>Envoy Client</name>
<url>https://github.com/informatik-ag-ngl/envoy-client</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.informatik-ag-ngl</groupId>
<artifactId>envoy-common</artifactId>
<version>develop-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>envoy-client</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>envoy.client.ui.Startup</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>informatik-ag-ngl</groupId>
<artifactId>envoy-client</artifactId>
<version>0.1-beta</version>
<name>Envoy Client</name>
<url>https://github.com/informatik-ag-ngl/envoy-client</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.informatik-ag-ngl</groupId>
<artifactId>envoy-common</artifactId>
<version>develop-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>envoy-client</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>envoy.client.ui.Startup</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,9 @@
/**
* This package contains all data classes and classes related to persistence.
*
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
*/
package envoy.client.data;

View File

@ -0,0 +1,9 @@
/**
* This package contains all client-sided events.
*
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
*/
package envoy.client.event;

View File

@ -85,7 +85,7 @@ public class Client implements Closeable {
rejected = false;
// Start receiver
new Thread(receiver).start();
receiver.start();
// Write login credentials
SerializationUtils.writeBytesWithLength(credentials, socket.getOutputStream());

View File

@ -21,7 +21,7 @@ import envoy.util.SerializationUtils;
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
*/
public class Receiver implements Runnable {
public class Receiver extends Thread {
private final InputStream in;
private final Map<Class<?>, Consumer<?>> processors = new HashMap<>();
@ -33,7 +33,10 @@ public class Receiver implements Runnable {
*
* @param in the {@link InputStream} to parse objects from
*/
public Receiver(InputStream in) { this.in = in; }
public Receiver(InputStream in) {
super("Receiver");
this.in = in;
}
@Override
public void run() {

View File

@ -0,0 +1,9 @@
/**
* This package contains all classes related to client-server communication.
*
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
*/
package envoy.client.net;

View File

@ -91,7 +91,7 @@ public final class ComponentListModel<E> implements Iterable<E>, Serializable {
*/
@Override
public Iterator<E> iterator() {
return new Iterator<E>() {
return new Iterator<>() {
Iterator<E> iter = elements.iterator();

View File

@ -0,0 +1,10 @@
/**
* This package defines a Swing component that can be used to display lists of
* other components to the user.
*
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.3-alpha
*/
package envoy.client.ui.list;

View File

@ -0,0 +1,9 @@
/**
* This package contains classes defining the user interface.
*
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
*/
package envoy.client.ui;

View File

@ -0,0 +1,9 @@
/**
* This package contains user interface classes related to the settings screen.
*
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.2-alpha
*/
package envoy.client.ui.settings;

View File

@ -0,0 +1,17 @@
/**
* This module contains all classes defining the client application of the Envoy
* project.
*
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
*/
module envoy {
requires transitive envoy.common;
requires transitive java.desktop;
requires transitive java.logging;
requires transitive java.naming;
requires transitive java.prefs;
}