aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarış Kaya <bkaya@google.com>2022-12-29 13:32:56 +0000
committerBarış Kaya <bkaya@google.com>2022-12-29 13:36:38 +0000
commit70d15095e3fe8979fcf88cc1d2680a1711b9fb34 (patch)
treed190360c9f6ce6914e28e273e8ea6acce78e908f
parent511458a40c72e5f4e4bd49c5eea3099e774a5688 (diff)
downloadgamesdk-70d15095e3fe8979fcf88cc1d2680a1711b9fb34.tar.gz
Move the copying task from Cmake to gradle.
Bug: b/262182866 Test: Tested with the hogger apk generated with the prebuilds to see whether it contains the assets. Change-Id: I4b3ada1e8220e56f6011932391913df36f280096
-rw-r--r--samples/memory_advice/hogger/app/CMakeLists.txt5
-rw-r--r--samples/memory_advice/hogger/app/build.gradle9
2 files changed, 9 insertions, 5 deletions
diff --git a/samples/memory_advice/hogger/app/CMakeLists.txt b/samples/memory_advice/hogger/app/CMakeLists.txt
index 2f602ec2..677e23a3 100644
--- a/samples/memory_advice/hogger/app/CMakeLists.txt
+++ b/samples/memory_advice/hogger/app/CMakeLists.txt
@@ -8,11 +8,6 @@ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTAT
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGOOGLE_PROTOBUF_NO_RTTI -DHAVE_PTHREAD")
-set( MEMORYADVICE_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/memoryadvice/memoryadvice/src/main/resources")
-
-file(GLOB TF_MODEL_FILES "${MEMORYADVICE_RESOURCES_DIR}/*.*")
-file(COPY ${TF_MODEL_FILES} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets)
-
include_directories(../../../../include)
include_directories(../../../common/include ) # Samples Includes
diff --git a/samples/memory_advice/hogger/app/build.gradle b/samples/memory_advice/hogger/app/build.gradle
index 8b4fab03..20e4bfbd 100644
--- a/samples/memory_advice/hogger/app/build.gradle
+++ b/samples/memory_advice/hogger/app/build.gradle
@@ -41,6 +41,15 @@ android {
}
}
+task copyAssets() {
+ copy {
+ from "../../../../test/memoryadvice/memoryadvice/src/main/resources"
+ into "src/main/assets"
+ }
+}
+
+tasks.preBuild.dependsOn('copyAssets')
+
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'