Skip to content

Commit e888855

Browse files
committed
Update Readme
1 parent cbef2fa commit e888855

File tree

1 file changed

+44
-12
lines changed

1 file changed

+44
-12
lines changed

README.md

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,24 @@ plugins {
6464
}
6565
6666
javaModulePackaging {
67-
target("windows") {
68-
operatingSystem = "windows"
69-
architecture = "x86-64"
67+
target("ubuntu-22.04") {
68+
operatingSystem = OperatingSystemFamily.LINUX
69+
architecture = MachineArchitecture.X86_64
7070
}
71-
target("ubuntu") {
72-
operatingSystem = "linux"
73-
architecture = "x86-64"
71+
target("macos-13") {
72+
operatingSystem = OperatingSystemFamily.MACOS
73+
architecture = MachineArchitecture.X86_64
7474
}
75-
target("macos") {
76-
operatingSystem = "macos"
77-
architecture = "x86-64"
75+
target("macos-14") {
76+
operatingSystem = OperatingSystemFamily.MACOS
77+
architecture = MachineArchitecture.ARM64
7878
}
79-
target("macosM1") {
80-
operatingSystem = "macos"
81-
architecture = "aarch64"
79+
target("windows-2022") {
80+
operatingSystem = OperatingSystemFamily.WINDOWS
81+
architecture = MachineArchitecture.X86_64
8282
}
83+
84+
primaryTarget(target("macos-14"))
8385
}
8486
```
8587

@@ -93,6 +95,20 @@ You can now run _target-specific_ builds:
9395
./gradlew runWindows
9496
```
9597

98+
There are some additional configuration options that can be used:
99+
100+
```
101+
javaModulePackaging {
102+
applicationName();
103+
applicationVersion();
104+
applicationDescription = ""
105+
vendor = "My Company"
106+
copyright = "(c) My Company"
107+
jpackageResources.setFrom(...);
108+
resources.from(...)
109+
}
110+
```
111+
96112
## Using target specific variants of libraries (like JavaFX)
97113

98114
The plugin uses Gradle's [variant-aware dependency management](https://docs.gradle.org/current/userguide/variant_model.html)
@@ -117,6 +133,22 @@ jvmDependencyConflicts.patch {
117133
}
118134
```
119135

136+
## Testing against multiple targets
137+
138+
> [!WARNING]
139+
> Currently, the following only works in combination with [Blackbox Test Suites configured by the _org.gradlex.java-module-testing_ plugin](https://github.com/gradlex-org/java-module-testing?tab=readme-ov-file#blackbox-test-suites).
140+
141+
Tests run against the _primary_ target, which is either the local machine you run the build on, or what is configured via `javaModulePackaging.primaryTarget(...)`.
142+
If you want to run the test multiple times against each target you configured, you can configure this as follows:
143+
144+
```
145+
javaModulePackaging {
146+
multiTargetTestSuite(testing.suites["test"])
147+
}
148+
```
149+
150+
Then, there will be a test task available for each target, such as `testWindows-2022` or `testMacos-14`.
151+
120152
## Running on GitHub Actions
121153

122154
Target-specific _tasks_ such as `assembleWindows-2022` or `assembleMacos-14` only run on the fitting operating system and architecture.

0 commit comments

Comments
 (0)