Skip to content

Commit

Permalink
Merge pull request #722 from brave/integrate_omaha_to_brave_core
Browse files Browse the repository at this point in the history
Integrate omaha build into brave-core
  • Loading branch information
emerick committed Oct 29, 2018
1 parent 0365868 commit 3a73967
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
6 changes: 6 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ group("create_dist") {
"//chrome/installer/mini_installer",
"build/win:create_signed_installer"
]

if (build_omaha) {
deps += [
"//brave/vendor/omaha",
]
}
}
if (is_mac) {
deps += [ "build/mac:create_dist_mac" ]
Expand Down
1 change: 1 addition & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ deps = {
"vendor/requests": "https://github.com/kennethreitz/requests@e4d59bedfd3c7f4f254f4f5d036587bcd8152458",
"vendor/boto": "https://github.com/boto/boto@f7574aa6cc2c819430c1f05e9a1a1a666ef8169b",
"vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403",
"vendor/omaha": "https://github.com/brave/omaha.git@5c633e867efafb9013c57ca830212d1ff6ea5076",
"vendor/sparkle": "https://github.com/brave/Sparkle.git@c0759cce415d7c0feae45005c8a013b1898711f0",
"vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@d50120871086cc1c35625a73de2088b5fd454b8f",
"vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@86aafe2ef89835ae71c9ed7c2527e3bb3000930e",
Expand Down
29 changes: 29 additions & 0 deletions build/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ declare_args() {
brave_version_build = ""
brave_version_patch = 0
chrome_version_string = ""
chrome_version_major = ""
build_omaha = false
tag_ap =""
}

if (base_sparkle_update_url == "") {
Expand All @@ -41,6 +44,32 @@ if (brave_exe == "") {
brave_dist_dir = "$root_out_dir/dist"
if (is_win) {
brave_exe = "$brave_exe.exe"
brave_underline_full_version = "_$chrome_version_major" + "_$brave_version_major" + "_$brave_version_minor" + "_$brave_version_build"
_channel = ""
brave_app_guid = "{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}"
if (is_official_build) {
if (brave_channel == "beta") {
_channel = "Beta"
brave_app_guid = "{103BD053-949B-43A8-9120-2E424887DE11}"
} else if (brave_channel == "dev") {
_channel = "Dev"
brave_app_guid = "{CB2150F2-595F-4633-891A-E39720CE0531}"
} else if (brave_channel == "nightly") {
_channel = "Nightly"
brave_app_guid = "{C6CB981E-DB30-4876-8639-109F8933582C}"
} else {
assert(brave_channel == "", "Unknown channel name")
}
} else {
_channel = "Development"
}
_arch = ""
if (target_cpu == "x86") {
_arch = "32"
}
brave_installer_exe = "brave_installer$brave_underline_full_version.exe"
brave_stub_installer_exe = "BraveBrowser$_channel" + "Setup$_arch$brave_underline_full_version.exe"
brave_standalone_installer_exe = "BraveBrowserStandalone$_channel" + "Setup$_arch$brave_underline_full_version.exe"
} else if (is_mac) {
brave_exe = "$chrome_product_full_name.app"
brave_dmg = "$chrome_product_full_name.dmg"
Expand Down
6 changes: 5 additions & 1 deletion build/win/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import("//brave/build/config.gni")

group("brave") {
public_deps = [
":copy_exe",
Expand Down Expand Up @@ -40,10 +42,12 @@ action("create_signed_installer") {
]
outputs = [
"$root_out_dir/brave_installer.exe",
"$root_out_dir/$brave_installer_exe",
]
out_dir = rebase_path(root_out_dir, "//")
args = [
"--root_out_dir=$out_dir"
"--root_out_dir=$out_dir",
"--brave_installer_exe=$brave_installer_exe",
]
deps = [
"//chrome/installer/mini_installer"
Expand Down
9 changes: 7 additions & 2 deletions script/create-signed-installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ def main():
root_out_dir = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))),
args.root_out_dir[0])
create_signed_installer(root_out_dir)
create_signed_installer(root_out_dir, args.brave_installer_exe[0])

def parse_args():
parser = argparse.ArgumentParser(description='Create signed installer')
parser.add_argument('--root_out_dir',
nargs=1)
parser.add_argument('--brave_installer_exe',
nargs=1)
return parser.parse_args()


def create_signed_installer(root_out_dir, env=None):
def create_signed_installer(root_out_dir, brave_installer_exe, env=None):
installer_file = os.path.join(root_out_dir, 'brave_installer.exe')
shutil.copyfile(os.path.join(root_out_dir, 'mini_installer.exe'), installer_file)
sign_binary(installer_file)
# Copy signed installer to version appended name
installer_file_with_version = os.path.join(root_out_dir, brave_installer_exe)
shutil.copyfile(installer_file, installer_file_with_version)


if __name__ == '__main__':
Expand Down

0 comments on commit 3a73967

Please sign in to comment.