android - Gradle: how to include an existing, complete project as a subproject? -
i git clone complete gradle project "completegradleproja" github , include local project submodule. "complete gradle project" mean can go directory "completegradleproja" , issue command
cd completegradleproja && gradle build
to build it.
my directory structure looks this,
myproj |---completegradleproja | |---build.gradle | |---build.gradle
my question is: how can call "completegradleproja/build.gradle" without changing of root "build.gradle"?
the following root "build.gradle" config not help.
apply plugin: 'java' dependencies { compile project(':completegradleproja') }
i got error message
failure: build failed exception. * went wrong: not determine dependencies of task ':compilejava'. > not determine dependencies of task ':compilejava'.
"completegradleproja" android porject , "completegradleproja/build.gradle" looks this
buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } }
completegradleproja/build.gradle
apply plugin: 'com.android.library' // if project isn't library use this: // apply plugin: 'com.android.application' android { compilesdkversion 22 buildtoolsversion '21.1.2' defaultconfig { minsdkversion 8 targetsdkversion 22 } } dependencies { compile 'com.android.support:support-v4:22.2.0' // if needed }
settings.gradle
include ':completegradleproja'
use apply plugin: 'com.android.library'
or apply plugin: 'com.android.application'
instead of apply plugin: 'java'
Comments
Post a Comment