Conversation
Author
Question posted: https://stackoverflow.com/questions/68594740 |
Author
I've filed an upstream bug report with For now, I've created a workaround by writing a properties file and then picking it back up, which seems to do the trick. PR with this workaround is ready in #98. |
- Move antrun tasks to dedicated build.xml file - Use properties file workaround for property sharing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since #91 was merged, the profile logic for detecting and setting various build properties was failing in certain scenarios (e.g. One JVM or host OS may report
os.arch=x86_64, another reportsos.arch=arm64, etc)The
os-maven-pluginis designed to handle these exact scenarios, however it's properties are not available at profile-activation time.This PR aims to fix that by moving maven's profile logic into dedicated antrun tasks, which are still quite hard to read (a nuance of ant in general), but now well organized much easier to read than the spiderwebs of profile rules we had previously.
This adds the following antrun tasks:
main-props
Calculates the target build system properties, specifically:
os.target.nameos.target.archos.target.bitnessos.target.classifierThese names were chosen to match the
os-maven-pluginconvention ofos.detected.name,os.detected.arch, etc. If the target system isn't specified, it'll default to the detected system.Other properties set by
calculate-targetcmake.generator.nativelibdircmake.generator.arg(only if a toolchain file is provided)maven.assembly.idLast, this target is responsible for attaching a toolchain file to cmake, if needed.
msvc-props
gcc,clangthrough like msys2 or cygwin yet. It would be relatively easy to support these down the road if needed.cmake.build.argneeded for MSVC-only (to trigger Release builds only, not Debug builds)xcode-props
gccor other compilers on Mac.gcc-props
clangor other compilers on Linux, but historically these are drop-in replacements and should work. Note,clangis required for cross-compiling Windows ARM64 binaries from Linux, but this is handled through a dedicated toolchain file (seemain-props)test-props
os.target.classifiertoos.detected.classifierand settingmaven.test.skipappropriately.show-file-info
file(e.g.file target/cmake/natives/macos_64/libjssc.dyllib) and echo the value returned to the screen. @GMKennedy and I used this command a lot testing Add aarch64 support #91 and I shimmed it in to save some time testing. If supported thefilecommand should state the target architecture, which is especially useful for cross-compiling. The command will run on unix variants like MacOS and Linux as well as Windows using git'ssh.exeas a shim.Before merging:
mingw,ppcorarmhfprofiles yet.build.xmlfile, but when doing so, I couldn't get the properties to propagate back to Maven. Any help here is greatly appreciated.