| OLD | NEW | 
|---|
| 1 import("//build/config/android/rules.gni") | 1 import("//build/config/android/rules.gni") | 
| 2 | 2 | 
| 3 # Copy libadblockplus headers | 3 # Copy libadblockplus headers | 
| 4 copy("copy_libadblockplus_include") { | 4 copy("copy_libadblockplus_include") { | 
| 5   sources = [ "//third_party/libadblockplus/include" ] | 5   sources = [ "//third_party/libadblockplus/include" ] | 
| 6   outputs = [ "${target_out_dir}/libadblockplus-binaries/include" ] | 6   outputs = [ "${target_out_dir}/libadblockplus-binaries/include" ] | 
| 7 } | 7 } | 
| 8 | 8 | 
| 9 if (target_cpu == "arm") { | 9 if (target_cpu == "arm") { | 
| 10   _abi_directory = "armeabi-v7a" | 10   _abi_directory = "armeabi-v7a" | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 58 _cwd = rebase_path(".") | 58 _cwd = rebase_path(".") | 
| 59 _build_dir = "${target_out_dir}/build" | 59 _build_dir = "${target_out_dir}/build" | 
| 60 _abs_build_dir = rebase_path("${_build_dir}") | 60 _abs_build_dir = rebase_path("${_build_dir}") | 
| 61 _abs_libadblockplus_dir = rebase_path("//third_party/libadblockplus") | 61 _abs_libadblockplus_dir = rebase_path("//third_party/libadblockplus") | 
| 62 _abs_sdk_dir = rebase_path("//third_party/android_tools/sdk") | 62 _abs_sdk_dir = rebase_path("//third_party/android_tools/sdk") | 
| 63 | 63 | 
| 64 _libadblockplus_binaries_dir = "${target_out_dir}/libadblockplus-binaries" | 64 _libadblockplus_binaries_dir = "${target_out_dir}/libadblockplus-binaries" | 
| 65 _abs_libadblockplus_binaries_dir = rebase_path("${_libadblockplus_binaries_dir}"
     ) | 65 _abs_libadblockplus_binaries_dir = rebase_path("${_libadblockplus_binaries_dir}"
     ) | 
| 66 | 66 | 
| 67 action("clear") { | 67 action("clear") { | 
| 68   script = "clear.py" | 68   script = "delete_dir.py" | 
| 69   args = [ | 69   args = [ | 
| 70     "${_cwd}/libadblockplus-android/.externalNativeBuild" | 70     "${_cwd}/libadblockplus-android/.externalNativeBuild" | 
| 71   ] | 71   ] | 
| 72   outputs = [ | 72   outputs = [ | 
| 73     "${_build_dir}/tmp" | 73     "${_build_dir}/tmp" | 
| 74   ] | 74   ] | 
| 75 } | 75 } | 
| 76 | 76 | 
| 77 # Build libadblockplus-android using Gradle | 77 # Build libadblockplus-android using Gradle | 
| 78 action("make") { | 78 action("make") { | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 124 # (see `_scanned_files = read_file(_info_path, "scope")` and it means _info_path
      file should already exist). | 124 # (see `_scanned_files = read_file(_info_path, "scope")` and it means _info_path
      file should already exist). | 
| 125 # Since we do generate .aar from sources we can't have .aar existing when runnin
     g 'gn ...'. | 125 # Since we do generate .aar from sources we can't have .aar existing when runnin
     g 'gn ...'. | 
| 126 # So the trick here is to prebuild libadblockplus-android with default V8 to gen
     erate .aar | 126 # So the trick here is to prebuild libadblockplus-android with default V8 to gen
     erate .aar | 
| 127 # right when running 'gn ...' and generate according .info file for it. | 127 # right when running 'gn ...' and generate according .info file for it. | 
| 128 | 128 | 
| 129 # Obviously it slows down running 'gn ...' dramatically, but it allows to run 'g
     n' and 'ninja' only once. | 129 # Obviously it slows down running 'gn ...' dramatically, but it allows to run 'g
     n' and 'ninja' only once. | 
| 130 # Otherwise you have to run 'gn' and 'ninja' to generate .aar first, then rerun 
     'gn' with 'update_android_aar_prebuilts=true' | 130 # Otherwise you have to run 'gn' and 'ninja' to generate .aar first, then rerun 
     'gn' with 'update_android_aar_prebuilts=true' | 
| 131 # to generate .info and then rerun 'ninja' again to build with existing .info fi
     le. | 131 # to generate .info and then rerun 'ninja' again to build with existing .info fi
     le. | 
| 132 | 132 | 
| 133 #print("Prebuilding libadblockplus-android to ${_abs_prebuild_dir}") | 133 #print("Prebuilding libadblockplus-android to ${_abs_prebuild_dir}") | 
| 134 exec_script("clear.py", [ | 134 exec_script("delete_dir.py", [ | 
| 135   "${_cwd}/libadblockplus-android/.externalNativeBuild" | 135   "${_cwd}/libadblockplus-android/.externalNativeBuild" | 
| 136   ]) | 136   ]) | 
| 137 exec_script("subproc.py", [ | 137 exec_script("subproc.py", [ | 
| 138   "${_cwd}/gradlew",  "clean", "assembleAbi_${target_cpu}Release", ":libadblockp
     lus-android-settings:assembleRelease", | 138   "${_cwd}/gradlew",  "clean", "assembleAbi_${target_cpu}Release", ":libadblockp
     lus-android-settings:assembleRelease", | 
| 139 | 139 | 
| 140   # cwd | 140   # cwd | 
| 141   "--cwd${_cwd}", | 141   "--cwd${_cwd}", | 
| 142 | 142 | 
| 143   # environment variables | 143   # environment variables | 
| 144   "--envANDROID_HOME=${_abs_sdk_dir}", | 144   "--envANDROID_HOME=${_abs_sdk_dir}", | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 181 _settings_aar_path = rebase_path("${_build_dir}/libadblockplus-android-settings/
     outputs/aar/libadblockplus-android-settings-release.aar") | 181 _settings_aar_path = rebase_path("${_build_dir}/libadblockplus-android-settings/
     outputs/aar/libadblockplus-android-settings-release.aar") | 
| 182 android_aar_prebuilt("settings_aar_java") { | 182 android_aar_prebuilt("settings_aar_java") { | 
| 183   unpack_deps = [ | 183   unpack_deps = [ | 
| 184     ":make" | 184     ":make" | 
| 185   ] | 185   ] | 
| 186   aar_path = "$_settings_aar_path" | 186   aar_path = "$_settings_aar_path" | 
| 187   info_path = "$_settings_info_path" | 187   info_path = "$_settings_info_path" | 
| 188   proguard_configs = [ "proguard-adblock.txt" ] | 188   proguard_configs = [ "proguard-adblock.txt" ] | 
| 189   ignore_native_libraries = false | 189   ignore_native_libraries = false | 
| 190 } | 190 } | 
| OLD | NEW | 
|---|