Skip to content

Commit 8547be1

Browse files
Use org.apache.tools.ant.filters.ReplaceTokens to set NDK_PATH in conanprofile.txt
1 parent 01c3efd commit 8547be1

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

app/build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.apache.tools.ant.filters.ReplaceTokens
2+
13
plugins {
24
id 'com.android.application'
35
id 'com.google.gms.google-services'
@@ -10,14 +12,8 @@ android {
1012

1113
tasks.register('conanProfile', Copy) {
1214
from "conanprofile.txt"
13-
into "build/"
14-
15-
doLast {
16-
def file = file("build/conanprofile.txt")
17-
def content = file.text
18-
content = content.replace("<NDK_PATH>", android.ndkDirectory.toString())
19-
file.write(content)
20-
}
15+
into project.layout.buildDirectory
16+
filter(ReplaceTokens, tokens: ["NDK_PATH": android.ndkDirectory.toString()])
2117
}
2218

2319
tasks.register('conanInstall') {

app/conanprofile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ compiler.cppstd=17
99
compiler.libcxx=c++_shared
1010

1111
[conf]
12-
tools.android:ndk_path=<NDK_PATH>
12+
tools.android:ndk_path=@NDK_PATH@
1313
tools.build:skip_test=True

0 commit comments

Comments
 (0)