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

GenerateRoboVMXml Task #31

Closed PokeMMO closed 2 years ago

PokeMMO commented 2 years ago

Allows customizing the libs and forceLinkClasses definitions. Allows an easier time migrating projects for #28 and future changes.

This is a breaking change, and will complain to users when they have the legacy jni/robovm.xml file still in their project or specify the file to be used with manualFile

jnigen {

    ....

    // Configure robovm.xml for IOS builds, most simple libraries will not need to do this
    robovm {
        // Use preexisting robovm.xml, cannot be combined with other options.
        manualFile file("robovm.xml")

        OR

        // Add extra patterns to forceLinkClasses
        forceLinkClasses "test", "test2"
        forceLinkClasses "pattern3"
        // Add extra library "test.a" with variant "device"
        extraLib "test.a", "device"
    }
}
Berstanio commented 2 years ago

What do you think about a extra option to enable the old behavior? The new xml generation only supports a small subset of the robovm.xml configuration which is probably for most users fine, but maybe some usecases needs some extra configuration.

PokeMMO commented 2 years ago

What else is missing? Is there a full schema listed somewhere?

Berstanio commented 2 years ago

http://robovm.mobidevelop.com/docs/en/configuration.html Not all in the list are relevant, but maybe things like "framework" and "frameworkPath", "unhideSymbols" and "exportedSymbols" and maybe others could be used by some.

PokeMMO commented 2 years ago

I guess we need the withXml option, would cover anything anyone wants, but runs the risk of breaking compatibility of gradle changes the api.

PokeMMO commented 2 years ago

Added back an option to set manualFile instead of using internal api to implement withXml. Is probably good enough.