| 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/libadblockplus_android/third_party/and
roid_sdk") | 62 _abs_sdk_dir = rebase_path("//third_party/libadblockplus_android/third_party/and
roid_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 = "delete_dir.py" | 68 script = "//third_party/libadblockplus_common/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") { |
| 79 deps = [ | 79 deps = [ |
| 80 "//third_party/libadblockplus:make", | 80 "//third_party/libadblockplus:make", |
| 81 ":clear", | 81 ":clear", |
| 82 | 82 |
| 83 # from libadblockplus | 83 # from libadblockplus |
| 84 ":copy_libadblockplus_include", | 84 ":copy_libadblockplus_include", |
| 85 ":copy_libadblockplus_abi", | 85 ":copy_libadblockplus_abi", |
| 86 | 86 |
| 87 # from Chromium | 87 # from Chromium |
| 88 ":copy_libv8", | 88 ":copy_libv8", |
| 89 ":copy_libv8_libbase", | 89 ":copy_libv8_libbase", |
| 90 ] | 90 ] |
| 91 | 91 |
| 92 script = "subproc.py" | 92 script = "//third_party/libadblockplus_common/subproc.py" |
| 93 | 93 |
| 94 inputs = [ | 94 inputs = [ |
| 95 ] | 95 ] |
| 96 | 96 |
| 97 outputs = [ | 97 outputs = [ |
| 98 "${_build_dir}/libadblockplus-android/outputs/aar/libadblockplus-android-abi
_${target_cpu}-release.aar", | 98 "${_build_dir}/libadblockplus-android/outputs/aar/libadblockplus-android-abi
_${target_cpu}-release.aar", |
| 99 "${_build_dir}/libadblockplus-android-settings/outputs/aar/libadblockplus-an
droid-settings-release.aar", | 99 "${_build_dir}/libadblockplus-android-settings/outputs/aar/libadblockplus-an
droid-settings-release.aar", |
| 100 ] | 100 ] |
| 101 | 101 |
| 102 args = [ | 102 args = [ |
| (...skipping 21 matching lines...) Expand all 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("delete_dir.py", [ | 134 exec_script("//third_party/libadblockplus_common/delete_dir.py", [ |
| 135 "${_cwd}/libadblockplus-android/.externalNativeBuild" | 135 "${_cwd}/libadblockplus-android/.externalNativeBuild" |
| 136 ]) | 136 ]) |
| 137 exec_script("subproc.py", [ | 137 exec_script("//third_party/libadblockplus_common/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}", |
| 145 "--envANDROID_NDK_HOME=${_abs_libadblockplus_dir}/third_party/android-ndk-r12b
", | 145 "--envANDROID_NDK_HOME=${_abs_libadblockplus_dir}/third_party/android-ndk-r12b
", |
| 146 "--envGRADLE_BUILD_DIR=${_abs_prebuild_dir}", | 146 "--envGRADLE_BUILD_DIR=${_abs_prebuild_dir}", |
| 147 ]) | 147 ]) |
| (...skipping 33 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 |