Skip to content

Commit 8502a30

Browse files
committed
Upgrade examples to 0.5.0
1 parent f7e8b78 commit 8502a30

File tree

9 files changed

+81
-59
lines changed

9 files changed

+81
-59
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ If you are using Maven, add the below dependency to your pom.xml:
4848
If you are using Gradle, add the below dependency to your build.gradle file:
4949

5050
```groovy
51-
compile group: 'net.codecrete.usb', name: 'java-does-usb', version: '0.4.1'
51+
compile group: 'net.codecrete.usb', name: 'java-does-usb', version: '0.5.0'
5252
```
5353

5454
```java

examples/bulk_transfer/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ This sample shows how to find a device, open it and transfer data from and to bu
44

55
## Prerequisites
66

7-
- Java 19
7+
- Java 20
88
- Apache Maven
99
- 64-bit operating system (Windows, macOS, Linux)
1010
- A USB device with bulk IN and OUT endpoints (e.g. the test device, see https://github.com/manuelbl/JavaDoesUSB/tree/main/test-devices/loopback-stm32)
1111

1212
## How to run
1313

14-
### Install Java 19
14+
### Install Java 20
1515

16-
Check that *Java 19* is installed:
16+
Check that *Java 20* is installed:
1717

1818
```shell
1919
$ java -version
@@ -39,24 +39,24 @@ $ mvn compile exec:exec
3939
[INFO] Scanning for projects...
4040
[INFO]
4141
[INFO] --------------< net.codecrete.usb.examples:bulk-transfer >--------------
42-
[INFO] Building bulk-transfer 0.4.0
42+
[INFO] Building bulk-transfer 0.5.0
4343
[INFO] --------------------------------[ jar ]---------------------------------
4444
[INFO]
4545
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ bulk-transfer ---
4646
[INFO] Using 'UTF-8' encoding to copy filtered resources.
47-
[INFO] skip non existing resourceDirectory /Users/manuel/Documents/Lab/JavaDoesUSB/examples/bulk_transfer/src/main/resources
47+
[INFO] skip non existing resourceDirectory /Users/me/Documents/JavaDoesUSB/examples/bulk_transfer/src/main/resources
4848
[INFO]
4949
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ bulk-transfer ---
5050
[INFO] Changes detected - recompiling the module!
51-
[INFO] Compiling 1 source file to /Users/manuel/Documents/Lab/JavaDoesUSB/examples/bulk_transfer/target/classes
51+
[INFO] Compiling 1 source file to /Users/me/Documents/JavaDoesUSB/examples/bulk_transfer/target/classes
5252
[INFO]
5353
[INFO] --- exec-maven-plugin:3.1.0:exec (default-cli) @ bulk-transfer ---
5454
6 bytes sent.
5555
6 bytes received.
5656
[INFO] ------------------------------------------------------------------------
5757
[INFO] BUILD SUCCESS
5858
[INFO] ------------------------------------------------------------------------
59-
[INFO] Total time: 3.830 s
60-
[INFO] Finished at: 2022-09-09T14:43:10+02:00
59+
[INFO] Total time: 1.259 s
60+
[INFO] Finished at: 2023-03-23T14:10:17+01:00
6161
[INFO] ------------------------------------------------------------------------
6262
```

examples/bulk_transfer/pom.xml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.codecrete.usb.examples</groupId>
88
<artifactId>bulk-transfer</artifactId>
9-
<version>0.4.1</version>
9+
<version>0.5.0</version>
1010

1111
<name>bulk-transfer</name>
1212
<url>https://github.com/manuelbl/JavaDoesUSB/examples/bulk_transfer</url>
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>net.codecrete.usb</groupId>
2323
<artifactId>java-does-usb</artifactId>
24-
<version>0.4.1</version>
24+
<version>0.5.0</version>
2525
</dependency>
2626
</dependencies>
2727

@@ -42,15 +42,20 @@
4242
<artifactId>maven-compiler-plugin</artifactId>
4343
<version>3.8.0</version>
4444
<configuration>
45-
<release>19</release>
46-
<compilerArgs>--enable-preview</compilerArgs>
47-
<source>19</source>
48-
<target>19</target>
45+
<release>20</release>
46+
<compilerArgs>
47+
<arg>--enable-preview</arg>
48+
</compilerArgs>
49+
<source>20</source>
50+
<target>20</target>
4951
</configuration>
5052
</plugin>
5153
<plugin>
5254
<artifactId>maven-surefire-plugin</artifactId>
5355
<version>2.22.1</version>
56+
<configuration>
57+
<argLine>--enable-preview --enable-native-access=ALL-UNNAMED</argLine>
58+
</configuration>
5459
</plugin>
5560
<plugin>
5661
<artifactId>maven-jar-plugin</artifactId>

examples/enumerate/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ This sample enumerates the connected USB devices and provides information about
44

55
## Prerequisites
66

7-
- Java 19
7+
- Java 20
88
- Apache Maven
99
- 64-bit operating system (Windows, macOS, Linux)
1010

1111
## How to run
1212

13-
### Install Java 19
13+
### Install Java 20
1414

15-
Check that *Java 19* is installed:
15+
Check that *Java 20* is installed:
1616

1717
```shell
1818
$ java -version
@@ -38,15 +38,16 @@ $ mvn compile exec:exec
3838
[INFO] Scanning for projects...
3939
[INFO]
4040
[INFO] ----------------< net.codecrete.usb.examples:enumerate >----------------
41-
[INFO] Building enumerate 0.4.1
41+
[INFO] Building enumerate 0.5.0
4242
[INFO] --------------------------------[ jar ]---------------------------------
4343
[INFO]
4444
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ enumerate ---
4545
[INFO] Using 'UTF-8' encoding to copy filtered resources.
4646
[INFO] skip non existing resourceDirectory /Users/me/Documents/JavaDoesUSB/examples/enumerate/src/main/resources
4747
[INFO]
4848
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ enumerate ---
49-
[INFO] Nothing to compile - all classes are up to date
49+
[INFO] Changes detected - recompiling the module!
50+
[INFO] Compiling 2 source files to /Users/me/Documents/JavaDoesUSB/examples/enumerate/target/classes
5051
[INFO]
5152
[INFO] --- exec-maven-plugin:3.1.0:exec (default-cli) @ enumerate ---
5253
Device:

examples/enumerate/pom.xml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66

77
<groupId>net.codecrete.usb.examples</groupId>
88
<artifactId>enumerate</artifactId>
9-
<version>0.4.1</version>
9+
<version>0.5.0</version>
1010

1111
<name>enumerate</name>
1212
<url>https://github.com/manuelbl/JavaDoesUSB/examples/enumerate</url>
1313

1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<maven.compiler.source>19</maven.compiler.source>
17-
<maven.compiler.target>19</maven.compiler.target>
16+
<maven.compiler.source>20</maven.compiler.source>
17+
<maven.compiler.target>20</maven.compiler.target>
1818
</properties>
1919

2020
<dependencies>
2121
<dependency>
2222
<groupId>net.codecrete.usb</groupId>
2323
<artifactId>java-does-usb</artifactId>
24-
<version>0.4.1</version>
24+
<version>0.5.0</version>
2525
</dependency>
2626
</dependencies>
2727

@@ -42,15 +42,20 @@
4242
<artifactId>maven-compiler-plugin</artifactId>
4343
<version>3.8.0</version>
4444
<configuration>
45-
<release>19</release>
46-
<compilerArgs>--enable-preview</compilerArgs>
47-
<source>19</source>
48-
<target>19</target>
45+
<release>20</release>
46+
<compilerArgs>
47+
<arg>--enable-preview</arg>
48+
</compilerArgs>
49+
<source>20</source>
50+
<target>20</target>
4951
</configuration>
5052
</plugin>
5153
<plugin>
5254
<artifactId>maven-surefire-plugin</artifactId>
5355
<version>2.22.1</version>
56+
<configuration>
57+
<argLine>--enable-preview --enable-native-access=ALL-UNNAMED</argLine>
58+
</configuration>
5459
</plugin>
5560
<plugin>
5661
<artifactId>maven-jar-plugin</artifactId>

examples/monitor/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ This sample program monitors USB devices as they are connected and disconnected.
44

55
## Prerequisites
66

7-
- Java 19
7+
- Java 20
88
- Apache Maven
99
- 64-bit operating system (Windows, macOS, Linux)
1010

1111
## How to run
1212

13-
### Install Java 19
13+
### Install Java 20
1414

15-
Check that *Java 19* is installed:
15+
Check that *Java 20* is installed:
1616

1717
```shell
1818
$ java -version
@@ -38,15 +38,16 @@ $ mvn compile exec:exec
3838
[INFO] Scanning for projects...
3939
[INFO]
4040
[INFO] -----------------< net.codecrete.usb.examples:monitor >-----------------
41-
[INFO] Building monitor 0.4.1
41+
[INFO] Building monitor 0.5.0
4242
[INFO] --------------------------------[ jar ]---------------------------------
4343
[INFO]
4444
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ monitor ---
4545
[INFO] Using 'UTF-8' encoding to copy filtered resources.
4646
[INFO] skip non existing resourceDirectory /Users/me/Documents/JavaDoesUSB/examples/monitor/src/main/resources
4747
[INFO]
4848
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ monitor ---
49-
[INFO] Nothing to compile - all classes are up to date
49+
[INFO] Changes detected - recompiling the module!
50+
[INFO] Compiling 1 source file to /Users/me/Documents/JavaDoesUSB/examples/monitor/target/classes
5051
[INFO]
5152
[INFO] --- exec-maven-plugin:3.1.0:exec (default-cli) @ monitor ---
5253
Present: VID: 0xcafe, PID: 0xceaf, manufacturer: JavaDoesUSB, product: Loopback, serial: 8D8F515C5456, ID: 4295291950

examples/monitor/pom.xml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66

77
<groupId>net.codecrete.usb.examples</groupId>
88
<artifactId>monitor</artifactId>
9-
<version>0.4.1</version>
9+
<version>0.5.0</version>
1010

1111
<name>monitor</name>
1212
<url>https://github.com/manuelbl/JavaDoesUSB/examples/monitor</url>
1313

1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<maven.compiler.source>19</maven.compiler.source>
17-
<maven.compiler.target>19</maven.compiler.target>
16+
<maven.compiler.source>20</maven.compiler.source>
17+
<maven.compiler.target>20</maven.compiler.target>
1818
</properties>
1919

2020
<dependencies>
2121
<dependency>
2222
<groupId>net.codecrete.usb</groupId>
2323
<artifactId>java-does-usb</artifactId>
24-
<version>0.4.1</version>
24+
<version>0.5.0</version>
2525
</dependency>
2626
</dependencies>
2727

@@ -42,15 +42,20 @@
4242
<artifactId>maven-compiler-plugin</artifactId>
4343
<version>3.8.0</version>
4444
<configuration>
45-
<release>19</release>
46-
<compilerArgs>--enable-preview</compilerArgs>
47-
<source>19</source>
48-
<target>19</target>
45+
<release>20</release>
46+
<compilerArgs>
47+
<arg>--enable-preview</arg>
48+
</compilerArgs>
49+
<source>20</source>
50+
<target>20</target>
4951
</configuration>
5052
</plugin>
5153
<plugin>
5254
<artifactId>maven-surefire-plugin</artifactId>
5355
<version>2.22.1</version>
56+
<configuration>
57+
<argLine>--enable-preview --enable-native-access=ALL-UNNAMED</argLine>
58+
</configuration>
5459
</plugin>
5560
<plugin>
5661
<artifactId>maven-jar-plugin</artifactId>

examples/stm_dfu/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Even though the DFU
66

77
## Prerequisites
88

9-
- Java 19
9+
- Java 20
1010
- Apache Maven
1111
- 64-bit operating system (Windows, macOS, Linux)
1212

1313
## How to run
1414

15-
### Install Java 19
15+
### Install Java 20
1616

17-
Check that *Java 19* is installed:
17+
Check that *Java 20* is installed:
1818

1919
```shell
2020
$ java -version
@@ -57,16 +57,16 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0666"
5757
Run the command below (adapting the file path depending on your specific board):
5858

5959
```shell
60-
$ java --enable-preview --enable-native-access=ALL-UNNAMED -jar target/stm_dfu-0.4.1.jar ../../test-devices/loopback-stm32/bin/blackpill-f401cc.bin
61-
DFU device found with serial 36C730037136.
60+
$ java --enable-preview --enable-native-access=ALL-UNNAMED -jar target/stm_dfu-0.5.0.jar ../../test-devices/loopback-stm32/bin/blackpill-f401cc.bin
61+
DFU device found with serial 35A737883336.
6262
Target memory segment: Internal Flash
6363
Erasing page at 0x8000000 (size 0x4000)
6464
Writing data at 0x8000000 (size 0x800)
6565
Writing data at 0x8000800 (size 0x800)
6666
Writing data at 0x8001000 (size 0x800)
6767
Writing data at 0x8001800 (size 0x800)
6868
Writing data at 0x8002000 (size 0x800)
69-
Writing data at 0x8002800 (size 0x4cc)
69+
Writing data at 0x8002800 (size 0x1f4)
7070
Firmware successfully downloaded and verified
7171
DFU mode exited and firmware started
7272
```

examples/stm_dfu/pom.xml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@
44

55
<groupId>net.codecrete.usb.examples</groupId>
66
<artifactId>stm_dfu</artifactId>
7-
<version>0.4.1</version>
7+
<version>0.5.0</version>
88

99
<name>stm_dfu</name>
1010
<url>https://github.com/manuelbl/JavaDoesUSB/examples/stm_dfu</url>
1111

12+
<properties>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<maven.compiler.source>20</maven.compiler.source>
15+
<maven.compiler.target>20</maven.compiler.target>
16+
</properties>
17+
1218
<dependencies>
1319
<dependency>
1420
<groupId>net.codecrete.usb</groupId>
1521
<artifactId>java-does-usb</artifactId>
16-
<version>0.4.1</version>
22+
<version>0.5.0</version>
1723
</dependency>
1824
</dependencies>
1925

@@ -31,10 +37,12 @@
3137
<artifactId>maven-compiler-plugin</artifactId>
3238
<version>3.8.0</version>
3339
<configuration>
34-
<release>19</release>
35-
<compilerArgs>--enable-preview</compilerArgs>
36-
<source>19</source>
37-
<target>19</target>
40+
<release>20</release>
41+
<compilerArgs>
42+
<arg>--enable-preview</arg>
43+
</compilerArgs>
44+
<source>20</source>
45+
<target>20</target>
3846
</configuration>
3947
</plugin>
4048
<plugin>
@@ -44,6 +52,9 @@
4452
<plugin>
4553
<artifactId>maven-surefire-plugin</artifactId>
4654
<version>2.22.2</version>
55+
<configuration>
56+
<argLine>--enable-preview --enable-native-access=ALL-UNNAMED</argLine>
57+
</configuration>
4758
</plugin>
4859
<plugin>
4960
<artifactId>maven-shade-plugin</artifactId>
@@ -76,10 +87,4 @@
7687
</plugin>
7788
</plugins>
7889
</build>
79-
80-
<properties>
81-
<maven.compiler.target>19</maven.compiler.target>
82-
<maven.compiler.source>19</maven.compiler.source>
83-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
84-
</properties>
8590
</project>

0 commit comments

Comments
 (0)