Cpp plugin: baseName with dots, last part gets truncated

I’m trying to move my projects from Ant/Ivy to Gradle (https://github.com/AndreasFagschlunger/O2Xfs). In some projects I also use JNI, so I take advantage of the native software plugins.

Now the point, I have a hard-coded library name “at.o2xfs.win32.dll”. When I set baseName property to this value:

components { main(NativeLibrarySpec) { baseName = 'at.o2xfs.win32'
The output file is “at.o2xfs.dll” and not “at.o2xfs.win32.dll” as expected, so win32 gets truncated. It seems gradle thinks I added a file extension and overwrites it. The workaround is simple to add a trailing dot. But I consider it a Bug, because it is unexpected behavior.

Best regards,
Andreas Fagschlunger

1 Like

Just wanted to add some more information, removing baseName and changing the component’s name:

components { 'at.o2xfs.win32'(NativeLibrarySpec) {

Has the same effect, build outputs a file named at.o2xfs.dll. Since I moved some Java parts to the software model as well, I can also say that JvmLibrarySpec doesn’t show this behavior:

at.o2xfs.win32'(JvmLibrarySpec) {

ends up in a at.o2xfs.win32.jar as expected.

1 Like