Closed ahtokca closed 8 years ago
@ahtokca The current gradle I use is 2.2.1. But that task should be generated by Android Library Plugin and should depend on that. Are you doing a debug build for the library project? Can you send the list of tasks being executed in the :api-impl project?
Also please let me know your android plugin version. I currently use com.android.tools.build:gradle:1.2.3
I use 1.3.0beta4, but I tried 1.2.3 - no luck Another thing I'm struggling with is to make embedded dependencies per buildType
it seems I have do something like below
tasks.findAll { task ->
if (task.name.matches('generate.*?Assets')) {
println "task found + " + task.name;
// Merge Assets
task.dependsOn embedAssets
} else if (...) {
}
}
The embedding is only useful for the release builds, not for the debug builds probably used by test instrumentation. Are you using flavors? Since I am only using release builds, I did not put checks around the task names. Maybe I'll need do that.
A better way may be to attach the task dependencies using build variants. That might work for multiple flavors too. However, it would then also require changing the hardcoded paths in some of the tasks.
If you can give me some idea about the project (flavors, build types) or a sample I can try it out.
Well there is one flavor, however different build types. The build type defines which dependencies to embed and which obfuscation mechanism to use. That's basically it.
Thats quite complex thing for me :) The current version only supports single build type - release with default flavor.
Since you want to have different embed dependencies per build type, you will have to generate configurations for each like compile does. We can use fooCompile
when defining a dependency if we have a build type named foo
and it will be used only with foo
build. Something similar can be done here.
However an easier way might be to create a different library project per build type if you want to use it as it is.
Anyway thank you very much. I don't need to merge any resource/assest etc. Just classes. So I almost made my script taking yours as an example
Hi
I use gradle 2.5 and fat-aar spits the exception below. Which version of gradle is supported?