libgdx / gdx-jnigen

jnigen is a small library that can be used with or without libGDX which allows C/C++ code to be written inline with Java source code.
Apache License 2.0
59 stars 26 forks source link

Correctly define android file extension as ".so" to fix jaring #68

Closed Berstanio closed 1 month ago

Berstanio commented 1 month ago

This fixes android lib jaring.

The jar task determines the include paths by:

String path = ext.subProjectDir + ext.libsDir + File.separatorChar + targetFolder + File.separatorChar + target.getSharedLibFilename(ext.sharedLibName);

where target.getSharedLibFilename(ext.sharedLibName); will build up the file like:

        String suffix = os.getLibExtension().isEmpty() ? "" : "." + os.getLibExtension();

        // generate shared lib prefix and suffix, determine jni platform headers directory
        return os.getLibPrefix() + sharedLibName + architecture.toSuffix() + bitness.toSuffix() + suffix;

since suffix for android was empty, it didn't set the file extension correctly and didn't maged the ".so" files.

This should have no side effects, since the jar task is the only place that effectivly uses the value for android.