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
62 stars 25 forks source link

AntScriptGenerator does not allow to specify an absolute libsDir #14

Closed MobiDevelop closed 2 days ago

MobiDevelop commented 4 years ago

AntScriptGenerator prefixes the libsDir path with ../, preventing the libs directory from being specified as an absolute path (e.g. from the Gradle plugin as `libsDir = "${project.buildDir}/jnigen/libs"). For background, I'm attempting to set up a project where all the jnigen artifacts are placed within the Gradle build directory (to allow easy clean-up).

PokeMMO commented 4 years ago

I think we should be checking File#isAbsolute before attempting to do relative path logic. And also using File constructor with child instead of doing manual string concatenation.

MobiDevelop commented 4 years ago

I've been playing around with it and I think I've got it working using Path and it's relativize method.

PokeMMO commented 4 years ago

On a semi-related note, I dont see why I added NativeCodeGeneratorConfig.jniDir as a separate field. That should just be using JnigenExtension.jniDir

MobiDevelop commented 4 years ago

Yep, I noticed that while working to make the Gradle plugin work off files instead of strings. I was also making the extension values properties which can be evaluated lazily by the tasks while also specifying inputs and outputs for those tasks, so they can play Gradle's incremental game.

Tom-Ski commented 2 days ago

Fixed in 3.0.0.