@@ -4,6 +4,7 @@ plugins {
44 id ' com.android.application'
55 id ' com.google.gms.google-services'
66 id ' com.google.firebase.crashlytics'
7+ id ' app.opendocument.conanandroidgradleplugin'
78}
89
910android {
@@ -16,56 +17,12 @@ tasks.register('conanProfile', Copy) {
1617 filter(ReplaceTokens , tokens : [" NDK_PATH" : android. ndkDirectory. toString()])
1718}
1819
19- abstract class ConanInstallTask extends Exec {
20- @Input
21- abstract Property<String > getArch ()
22-
23- // Cannot read project.layout.buildDirectory when configuration-cache is enabled
24- @Input
25- abstract Property<String > getArchBuildDirPath ()
26-
27- @OutputDirectory
28- final Provider<Directory > outputDirectory = archBuildDirPath.map { new File (it ) }
29-
30- @Override
31- protected void exec () {
32- commandLine(
33- " conan" , " install" , " ." ,
34- " --output-folder=" + archBuildDirPath. get(),
35- " --build=missing" ,
36- " --profile:host=build/conanprofile.txt" ,
37- " -s" , " arch=" + arch. get(),
38- " -s" , " build_type=Release" ,
39- " -s" , " &:build_type=RelWithDebInfo" ,
40- " -s" , " odrcore/*:build_type=RelWithDebInfo" ,
41- )
42- super . exec()
43- }
44- }
45-
4620[" armv8" , " armv7" , " x86" , " x86_64" ]. each { architecture ->
47- tasks. register(' conanInstall-' + architecture, ConanInstallTask ) {
48- setArch(architecture)
49- setArchBuildDirPath(new File (project. layout. buildDirectory. get(). toString(), ' conan/' + architecture). absolutePath)
50- dependsOn(tasks. named(" conanProfile" ))
51-
52- // Execute at least one conanInstall before running all three others in parallel.
53- // Some issue with conan's local cache
54- // @TODO: isolate and report to conan-client bugtracker
55- if (architecture != " armv8" ) {
56- dependsOn(tasks. named(" conanInstall-armv8" ))
57- }
21+ tasks. named(" conanInstall-" + architecture) {
22+ profile. set(' build/conanprofile.txt' )
23+ dependsOn(tasks. named(' conanProfile' ))
5824 }
5925}
60- tasks. register(" conanInstall" ) {
61- [" armv7" , " armv8" , " x86" , " x86_64" ]. each { arch ->
62- dependsOn tasks. named(' conanInstall-' + arch)
63- }
64- }
65-
66- tasks. named(" preBuild" ). configure { preBuildTask ->
67- preBuildTask. dependsOn(tasks. named(" conanInstall" ))
68- }
6926
7027android {
7128 defaultConfig {
0 commit comments