diff options
Diffstat (limited to 'simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle')
-rw-r--r-- | simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle b/simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle deleted file mode 100644 index aa23c8d2..00000000 --- a/simpleperf/demo/SimpleperfExamplePureJava/app/profiling.gradle +++ /dev/null @@ -1,58 +0,0 @@ - -// Set when building only part of the abis in the apk. -def abiFiltersForWrapScript = [] - -android { - buildTypes { - profiling { - initWith debug - externalNativeBuild { - cmake { - // cmake Debug build type uses -O0, which makes the code slow. - arguments "-DCMAKE_BUILD_TYPE=Release" - } - } - packagingOptions { - - // Exclude wrap.sh for architectures not built. - if (abiFiltersForWrapScript) { - def exclude_abis = ["armeabi", "armeabi-v7a", "arm64-v8a", - "x86", "x86_64", "mips", "mips64"] - .findAll{ !(it in abiFiltersForWrapScript) } - .collect{ "**/" + it + "/wrap.sh" } - excludes += exclude_abis - } - } - - // Add lib/xxx/wrap.sh in the apk. This is to enable java profiling on Android O - // devices. - sourceSets { - profiling { - resources { - srcDir { - "profiling_apk_add_dir" - } - } - } - } - } - } -} - -def writeWrapScriptToFullyCompileJavaApp(wrapFile) { - wrapFile.withWriter { writer -> - writer.write('#!/system/bin/sh\n') - writer.write('\$@\n') - } -} - -task createProfilingApkAddDir { - for (String abi : ["armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64", "mips", "mips64"]) { - def dir = new File("app/profiling_apk_add_dir/lib/" + abi) - dir.mkdirs() - def wrapFile = new File(dir, "wrap.sh") - writeWrapScriptToFullyCompileJavaApp(wrapFile) - println "write file " + wrapFile.path - } -} - |