Skip to content

Commit 9d268c6

Browse files
committed
Compile with backward compatibility for Java 8
1 parent a3d9f54 commit 9d268c6

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

pom.xml

+28-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,35 @@
7777
<plugin>
7878
<groupId>org.apache.maven.plugins</groupId>
7979
<artifactId>maven-compiler-plugin</artifactId>
80-
<version>3.8.1</version>
80+
<version>3.10.1</version>
81+
<executions>
82+
<execution>
83+
<id>default-compile</id>
84+
<configuration>
85+
<release>9</release>
86+
<!-- No excludes: compile everything to ensure module-info contains right entries -->
87+
</configuration>
88+
</execution>
89+
<execution>
90+
<id>base-compile</id>
91+
<goals>
92+
<goal>compile</goal>
93+
</goals>
94+
<configuration>
95+
<!-- Recompile everything for target VM except the module-info.java -->
96+
<excludes>
97+
<exclude>module-info.java</exclude>
98+
</excludes>
99+
</configuration>
100+
</execution>
101+
</executions>
102+
<!-- Defaults for compile and testCompile -->
81103
<configuration>
82-
<release>11</release>
104+
<release>8</release><!-- compatibility expectations -->
105+
<!-- Only required when haven't configured the maven-toolchains-plugin -->
106+
<jdkToolchain>
107+
<version>9</version>
108+
</jdkToolchain>
83109
<showDeprecation>true</showDeprecation>
84110
<showWarnings>true</showWarnings>
85111
<fork>true</fork>

webrtc/src/test/java/dev/onvoid/webrtc/RTCDataChannelTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import static org.junit.jupiter.api.Assertions.assertEquals;
2020

21-
import java.util.List;
21+
import java.util.Arrays;
2222

2323
import org.junit.jupiter.api.Test;
2424

@@ -43,8 +43,8 @@ void textMessage() throws Exception {
4343

4444
Thread.sleep(500);
4545

46-
assertEquals(List.of("Hello world"), callee.getReceivedTexts());
47-
assertEquals(List.of("Hi :)"), caller.getReceivedTexts());
46+
assertEquals(Arrays.asList("Hello world"), callee.getReceivedTexts());
47+
assertEquals(Arrays.asList("Hi :)"), caller.getReceivedTexts());
4848

4949
caller.close();
5050
callee.close();

webrtc/src/test/java/dev/onvoid/webrtc/media/MediaDevicesTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.junit.jupiter.api.Assertions.*;
2020

2121
import dev.onvoid.webrtc.media.audio.AudioDevice;
22+
import dev.onvoid.webrtc.media.video.VideoCaptureCapability;
2223
import dev.onvoid.webrtc.media.video.VideoDevice;
2324

2425
import java.util.List;
@@ -42,8 +43,8 @@ void getVideoDevices() {
4243

4344
assertNotNull(captureDevices);
4445

45-
for (var device : captureDevices) {
46-
var capabilities = MediaDevices.getVideoCaptureCapabilities(device);
46+
for (VideoDevice device : captureDevices) {
47+
List<VideoCaptureCapability> capabilities = MediaDevices.getVideoCaptureCapabilities(device);
4748

4849
assertNotNull(capabilities);
4950
}

0 commit comments

Comments
 (0)