Skip to content

Commit

Permalink
Use org.apache.tools.ant.filters.ReplaceTokens to set NDK_PATH in con…
Browse files Browse the repository at this point in the history
…anprofile.txt
  • Loading branch information
ViliusSutkus89 committed Jul 15, 2024
1 parent 01c3efd commit 8547be1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
Expand All @@ -10,14 +12,8 @@ android {

tasks.register('conanProfile', Copy) {
from "conanprofile.txt"
into "build/"

doLast {
def file = file("build/conanprofile.txt")
def content = file.text
content = content.replace("<NDK_PATH>", android.ndkDirectory.toString())
file.write(content)
}
into project.layout.buildDirectory
filter(ReplaceTokens, tokens: ["NDK_PATH": android.ndkDirectory.toString()])
}

tasks.register('conanInstall') {
Expand Down
2 changes: 1 addition & 1 deletion app/conanprofile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ compiler.cppstd=17
compiler.libcxx=c++_shared

[conf]
tools.android:ndk_path=<NDK_PATH>
tools.android:ndk_path=@NDK_PATH@
tools.build:skip_test=True

0 comments on commit 8547be1

Please sign in to comment.