I want to link my own compiled .a file. It contains some util code for working with opengl.
How can I do it?
Now I use hack task to patch xcode project:
task patchxcode << {
java.nio.file.Path path = Paths.get("$projectDir/build").toAbsolutePath()
Files.walkFileTree(path, new java.nio.file.FileVisitor<java.nio.file.Path>() {
@Override
FileVisitResult preVisitDirectory(java.nio.file.Path dir, BasicFileAttributes attrs) throws IOException {
return FileVisitResult.CONTINUE
}
@Override
FileVisitResult visitFile(java.nio.file.Path file, BasicFileAttributes attrs) throws IOException {
if (file.endsWith("build.xcconfig")) {
def jniTask = tasks.getByPath(":scene-graph-ios:buildJni");
appendToLineInFile(file, "MOE_CUSTOM_OTHER_LDFLAGS", " -force_load ${jniTask.ext.outputPath} -framework OpenGLES")
}
return FileVisitResult.CONTINUE
}
@Override
FileVisitResult visitFileFailed(java.nio.file.Path file, IOException exc) throws IOException {
return FileVisitResult.CONTINUE
}
@Override
FileVisitResult postVisitDirectory(java.nio.file.Path dir, IOException exc) throws IOException {
return FileVisitResult.CONTINUE
}
})
}
I think it’s tricky and fragile.