Anthony Anthony - 5 months ago 68
Android Question

Android experimental gradle source

Anyone know the new way to set a manifest source location in the experimental plugin?

dependencies {
classpath "com.android.tools.build:gradle-experimental:0.1.0"
}


I believe I have java and resources correct, but can't figure out manifest:

android.sources {
main {
//manifest.source.srcDir 'library'
manifest.srcFile = file('library/AndroidManifest.xml')
//manifest.srcFile 'library'
resources.source.srcDir 'library/res'
java.source.srcDir 'library/src'
}
}

Answer

Try the following:

android.sources {
    main {
        manifest.source {
            srcDir 'library'
            include 'AndroidManifest.xml'
        }
        resources.source.srcDir 'library/res'
        java.source.srcDir 'library/src'
    }
}

Note that since the plugin is experimental this is likely to change version-to-version.