Skip to content

Commit b10d122

Browse files
Add conanfile task input
1 parent c7965c7 commit b10d122

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ android {
6060
}
6161
```
6262

63+
### conanfile.txt
64+
65+
ConanInstall task runs conan install on `conanfile.txt`. To use a different conanfile, e.g. `conanfile.py`, or one in a directory other than the module directory, configure tasks with it:
66+
67+
```groovy
68+
["armv7", "armv8", "x86", "x86_64"].each { arch ->
69+
tasks.named("conanInstall-" + arch) {
70+
conanfile.set("conanfile.py")
71+
}
72+
}
73+
```
74+
6375
## Further reading
6476

6577
https://docs.conan.io/2/examples/cross_build/android/android_studio.html

src/main/kotlin/app/opendocument/ConanInstallTask.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,21 @@ abstract class ConanInstallTask : Exec() {
3535
@get:Input
3636
abstract val profile: Property<String>
3737

38+
@get:Input
39+
abstract val conanfile: Property<String>
3840

3941
init {
4042
profile.convention("default")
43+
conanfile.convention("conanfile.txt")
4144
}
4245

4346
@get:OutputDirectory
4447
val outputDirectory: Provider<Directory> = arch.map { project.layout.buildDirectory.get().dir("conan/$it") }
4548

4649
override fun exec() {
4750
commandLine(
48-
"conan", "install", ".",
51+
"conan",
52+
"install", conanfile.get(),
4953
"--output-folder=" + outputDirectory.get(),
5054
"--build=missing",
5155
"--profile:host=" + profile.get(),

0 commit comments

Comments
 (0)