Wrapper script to work around issue 161 #162
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides a shell script run_example.sh in the base directory of the repo which can be used to run any of the example files directly with the platform's default 'java' binary. This enables the tests to be run without incurring the delayed and ungraceful shutdown described in #161.
To do this it builds a classpath including the directories within the repository where the mvn-compiled .class files for the library, and its test and example classes are, also the .so files for the amd64 platform (I don't know whether #161 affects other platforms so I haven't attempted to support them).
The line which runs java is qualified with sudo so that the operator doesn't have to worry about udev rules on Linux. I realize that this may not be a good default policy, but it suits me as I am working on a hid4java-dependent project with a couple of devices which will require udev rules and I don't want to put these in place until I am ready to develop the packaging for my project. A consequence of running with sudo is that builds using mvn will also need to be run under sudo so that they can delete runtime files created by test runs. If maintainers want to remove the sudo from the java command and the recommended mvn build command displayed if the .class file for the example test is not found they are welcome to do so.
Finally thanks to @gary-rowe and the other maintainers for their excellent work on hid4java.