Tuesday, 15 February 2011

Android gradle: Multi project build, top level build.gradle -



Android gradle: Multi project build, top level build.gradle -

i have multi-project android build system. construction of project follows:

root dir | settings.gradle | build.gradle | apps | app 1 | build.gradle | app 2 | build.gradle | libs | lib 1 | build.gradle | lib 2 | build.gradle

all apps , libraries have mutual android configration.

at root level build.gradle have following:

subprojects { apply plugin: 'android' android { compilesdkversion "google inc.:google apis:19" buildtoolsversion "20.0.0" defaultconfig { minsdkversion 14 targetsdkversion 19 } } }

next thought of adding next build.gradle in app 1

apply plugin: 'com.android.application' android { sourcesets { main { manifest.srcfile 'androidmanifest.xml' java.srcdirs = ['src'] res.srcdirs = ['res'] } } }

i next error:

cannot add together extension name 'android', there extension registered name.

in gradle plugin android, there way have "master android configuration" can extended sub-module?

i had similar problem - , has how including plugins.

in "root" build file have:

apply plugin: 'android'

in app have:

apply plugin: 'com.android.application'

change root match app plugin.

android gradle android-gradle

No comments:

Post a Comment