You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-34Lines changed: 14 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,27 +123,24 @@ In case you have issues, have a look at the [troubleshooting document](TROUBLESH
123
123
124
124
For local compilation:
125
125
126
-
* Maven 3.3.1 or newer
127
126
* GCC (or compatible)
128
-
*Java 8 (Maven will enforce this)
127
+
*Some version of Java (Gradle will download the correct one if necessary)
129
128
* a libc
130
129
* Bash
131
130
132
131
For cross compilation:
133
132
134
-
* Maven 3.3.1 or newer
135
-
* Podman or docker and permissions to run containers (alternatively provide the `RUN_CONTAINER_COMMAND` env with a command that takes an image name)
136
-
* Java 8 (Maven will enforce this)
133
+
* Podman or docker and permissions to run containers
134
+
* Some version of Java (Gradle will download the correct one if necessary)
137
135
* Bash
138
136
139
137
For tests:
140
138
141
-
* Maven 3.3.1 or newer
142
139
* A fairly recent Linux kernel with CAN support
143
140
* The can-isotp kernel module loaded (Kernel 5.10 with `CONFIG_CAN_ISOTP` enabled or the [out-of-tree module](https://github.com/hartkopp/can-isotp))
144
141
*[can-utils](https://github.com/linux-can/can-utils) installed in the `PATH`
145
142
* A CAN interface named "vcan0"
146
-
* Java 8 or newer installed
143
+
*Some version of Java (Gradle will download the correct one if necessary)
147
144
* a libc (unless compiled statically)
148
145
149
146
For usage:
@@ -157,36 +154,19 @@ For usage:
157
154
158
155
### Building
159
156
160
-
By default, the project only builds the native components (`single-architecture` maven profile) for the host system architecture:
157
+
All architectures can be built in parallel with using the `compileNativeAll` task:
161
158
162
159
```bash
163
-
mvn clean package
160
+
./gradlew compileNativeAll
164
161
```
165
162
166
-
This default build configuration will also execute the test suite.
167
-
168
-
Specifying the `javacan.architecture` option enables cross-compilation of the native components to the given architecture. If an architecture is specified that is not currently supported by the build,
169
-
then the property `dockcross.image` must also be provided to provide the necessary dockcross image for the architecture.
170
-
This can be used to build architectures that are not currently included in JavaCAN releases. The test suite will not be executed by default when cross-compiling, since the host system might not
171
-
be able to execute the resulting binaries. If test execution on the host system is possible, enabling the `test` profile will include all tests into the build.
172
-
By default, the libraries are linked dynamically, by setting the `dockcross.link-mode` property to `static` it can be switched to static linking, however not every dockcross image
173
-
supports static linking (musl libc based images usually do).
174
-
175
-
In order to build all architectures that are currently part of releases, the `all-architectures` maven profile must be activated:
176
-
177
-
```bash
178
-
mvn clean package -Pall-architectures
179
-
```
163
+
Alternatively there exist `packageNativeFor*` tasks for all the bundled architectures. A special task is packageNativeForHost, which will use
164
+
the compiler toolchain on your machine instead of dockcross. This is primarily intended for unit tests, but can also be used to build on systems
165
+
that are not supported by dockcross.
180
166
181
-
The `all-architectures` profile will execute the test suite using the `x86_64` libraries, however tests are not included by default. To override this the property `javacan.test.architecture` can be
182
-
set to any other architecture that is part of the build.
183
-
184
-
To build android-specific architectures add the `android` profile.
185
-
186
-
If the architecture you are building *on* is not part of the build, then tests will always fail. To prevent this you have to disable the `test` maven profile:
187
-
188
-
```bash
189
-
mvn clean package -P!test
190
-
```
167
+
All architectures allow their dockcross image to be overridden by properties like `dockcross.image.<architecture>`. The linking
168
+
mode (`dynamic` or `static`) can also be overridden by properties like `dockcross.link.<architecture>`.
191
169
192
-
Each architecture in the `all-architectures` profile can have its dockcross image and linking mode overridden by setting the `dockcross.image.<arch>` and/or `dockcross.link-mode.<arch>` properties.
170
+
Using the property `javacan.extra-archs` additional architectures can be defined as a comma-separated list. The values will be used as the
171
+
jar classifier. These additional architectures will also require manually setting configuring the dockcross image and linking mode using the
0 commit comments