gradle android ndk build -
i'm trying build cocos2dx c++ project on android using gradle
(previously ant
). want have 2 gradle tasks:
1) build c++ , java. found solution
task buildcpp(type: exec) { commandline ... // command } tasks.withtype(javacompile) { compiletask -> compiletask.dependson buildcpp }
2) build java without cpp. how?
note. ant can define 2 targets:
<!-- build --> <target name="buildall" description="build all: ndkbuild -> javac" depends="setdebugflagtrue, ndkbuild, buildjavasigned"/> <!-- build java --> <target name="buildjavasigned" description="javac" depends="setdebugflagfalse, clean, release"/>
how can gradle? seems ant more flexible gradle..
hmm... think may want have more flexible solution, honest. gradle's usage of ndk not best , there ways add more flexibility native builds without losing other benefits of using gradle (such using supported ide android, of 6/30/2015, android studio).
i suggest following this tutorial, show how force gradle use android.mk file. these files allow far more flexibility utilizing modules can changed around way need them build. suggest compiling c++ library elsewhere .so files, can give little more room breath , debug problems.
this document explains various aspects of android.mk files can better understand how want build. there loads of options building , it's easier control.
good luck! hope helps.
Comments
Post a Comment