Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android bundle #8421

Merged
merged 16 commits into from
Apr 16, 2021
Merged

Android bundle #8421

merged 16 commits into from
Apr 16, 2021

Conversation

wchen342
Copy link
Contributor

@wchen342 wchen342 commented Apr 2, 2021

Resolves brave/brave-browser/issues/15087. Resolves brave/brave-browser/issues/15063.
Needs https://github.com/brave/devops/issues/4815

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@wchen342 wchen342 added CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS labels Apr 2, 2021
@wchen342 wchen342 requested a review from fmarier as a code owner April 2, 2021 13:40
outputs = [ "$target_sign_app_path-singed" ]
args = [
outputs = [ "$target_sign_app_path-signed" ]
args = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need that

@@ -41,7 +41,8 @@ const touchOverriddenFiles = () => {

const chromiumSrcDir = path.join(config.srcDir, 'brave', 'chromium_src')
var sourceFiles = util.walkSync(chromiumSrcDir, applyFileFilter)
const additionalGen = getAdditionalGenLocation()
// const additionalGen = getAdditionalGenLocation()
const additionalGen = undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bug when building release+x64, where the output folder will be android_Release in first run but npm will use android_Release_x64 while resuming which makes the build starts over.

@fmarier fmarier removed their request for review April 7, 2021 01:27
@wchen342 wchen342 requested a review from a team as a code owner April 7, 2021 13:39
@@ -0,0 +1,72 @@
/* Copyright (c) 2020 The Brave Authors. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's 2021

@@ -0,0 +1,70 @@
/* Copyright (c) 2020 The Brave Authors. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a year

@@ -8,7 +8,7 @@ index b067a3f7af514bc48632365427ba8ecffa4885df..dadadab8dd95e47bc228053bd1335cbd
]
+ deps += brave_chrome_app_java_resources_deps sources += brave_java_resources resource_overlay = true
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't remove the space on "empty lines" in patches. Some Windows versions of git will fail to apply the patch if the space is missing.

Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patches change LGTM

Copy link
Contributor

@AlexeyBarabash AlexeyBarabash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wchen342 awesome work!

The PR looks good in general.

I have a minor notices I left here about the commented out lines.

Also it seems the PR drops out ability to build apk. This may make local development and posting apks to Github a bit harder. Is it possible to have ability to choose what to build, either aab or old akps by command line switch?

Copy link
Contributor

@samartnik samartnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@AlexeyBarabash AlexeyBarabash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

argument_parser.add_argument('prvt_key_passwd')
argument_parser.add_argument('key_name')
args = argument_parser.parse_args()
argument_parser = argparse.ArgumentParser()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not use apkbuilder.py from upstream? Or at least use FinalizeApk from finalize_apk.py? I feel more comfortable with this stuff when we're doing the same thing as upsteam

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files you mentioned are only appicable to apk files. The only place upstream tried to sign a bundle is when creating a wrapper for running bundles, and they only sign the extracted apks in that case not the bundle itself (see //build/config/android/rules.gni#L4915).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, they looked very similar, but maybe there were some differences I didn't notice

@@ -86,6 +86,7 @@ const Config = function () {
this.targetOS = getNPMConfig(['target_os'])
this.gypTargetArch = 'x64'
this.targetApkBase ='classic'
this.targetOutput = 'apk'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the default for release be aab? specifying Release should set everything correctly and the only "overrides" we should have in CI are for things we can't set here like api keys and urls

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ex Config.prototype.isOfficialBuild = function () { return this.buildConfig === 'Release' }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The duplicate is removed.

@@ -72,6 +73,7 @@ program
.option('--target_os <target_os>', 'target OS')
.option('--target_arch <target_arch>', 'target architecture')
.option('--target_apk_base <target_apk_base>', 'target Android OS apk (classic, modern, mono)', 'classic')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this param name change or at least update the description so we know it applies to apk and aab?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name and descriptions are updated.

@@ -58,6 +58,7 @@ program
.option('--target_os <target_os>', 'target OS')
.option('--target_arch <target_arch>', 'target architecture')
.option('--target_apk_base <target_apk_base>', 'target Android OS apk (classic, modern, mono)', 'classic')
.option('--target_output <target_output>', 'target Android output format (apk, aab)', 'apk')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target_apk_base and target_output aren't relevant to gn_check. Only target_os and target_arch are relevant here because those affect the output dir

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably leave the default out of this one since we want to do it by build config type

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure which one is better, it will probably depend on how CI will be changed. @SergeyZhukovsky did you discuss with Mihai?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change the default to aab for now but that means local debugging needs an extra option.

Copy link
Contributor

@AlexeyBarabash AlexeyBarabash Apr 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @bridiver meant default to aab only for Release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change on gn_check is reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @bridiver meant default to aab only for Release?

I checked the js files, the only place isOfficialBuild is checked is when setting channels. I am not sure whether it is a good place to change default though.

@mihaiplesa mihaiplesa added CI/skip-ios Do not run CI builds for iOS CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels Apr 15, 2021
@@ -134,7 +135,8 @@ program
.option('--notarize', 'notarize the macOS app with Apple')
.option('--target_os <target_os>', 'target OS')
.option('--target_arch <target_arch>', 'target architecture')
.option('--target_apk_base <target_apk_base>', 'target Android OS apk (classic, modern, mono)', 'classic')
.option('--target_android_base <target_android_base>', 'target Android SDk level for apk or aab (classic, modern, mono)', 'classic')
.option('--target_android_output_format <target_android_output_format>', 'target Android output format (apk, aab)', 'aab')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want this to be APK by default? for developers at least

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mihaiplesa we do it here e03657f

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for create_dist we want to keep aab by default as it's a release distribution

@@ -134,7 +135,8 @@ program
.option('--notarize', 'notarize the macOS app with Apple')
.option('--target_os <target_os>', 'target OS')
.option('--target_arch <target_arch>', 'target architecture')
.option('--target_apk_base <target_apk_base>', 'target Android OS apk (classic, modern, mono)', 'classic')
.option('--target_android_base <target_android_base>', 'target Android SDk level for apk or aab (classic, modern, mono)', 'classic')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo SDK

@mihaiplesa mihaiplesa added CI/skip Do not run CI builds (except noplatform) and removed CI/skip-ios Do not run CI builds for iOS CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels Apr 16, 2021
@wchen342 wchen342 merged commit c7f0b4b into master Apr 16, 2021
@wchen342 wchen342 deleted the android-bundle branch April 16, 2021 17:20
@wchen342 wchen342 added this to the 1.25.x - Nightly milestone Apr 16, 2021
@wchen342 wchen342 mentioned this pull request May 5, 2021
24 tasks
kylehickinson added a commit that referenced this pull request Jan 4, 2024
On iOS 17 rotating the device with a full screen modal presented (e.g. Playlist, Tab Tray) to landscape then back to portrait does not trigger `traitCollectionDidChange`/`willTransition`/etc calls and so the toolbar remains in the wrong state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip Do not run CI builds (except noplatform)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android bundle builds Investigate 64-bit Option on Android
7 participants