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

enable android apk build from brave-core #2376

Merged
merged 1 commit into from
May 8, 2019
Merged

enable android apk build from brave-core #2376

merged 1 commit into from
May 8, 2019

Conversation

bridiver
Copy link
Collaborator

@bridiver bridiver commented May 6, 2019

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@petemill
Copy link
Member

petemill commented May 7, 2019

@bridiver what's the command for building the android output? Is it similar to https://github.com/brave/browser-android-tabs where we:

  • Generate a build output that has the flag: target_os = "android"
  • Run directly ninja -C out/[target name] chrome_public_apk
    ?

@bridiver bridiver changed the title wip enable android apk build from brave-core May 8, 2019
@bridiver
Copy link
Collaborator Author

bridiver commented May 8, 2019

@petemill
npm run init -- --target_os=android
npm run build -- --target_os=android
for now

@bridiver bridiver marked this pull request as ready for review May 8, 2019 00:31
@bridiver bridiver self-assigned this May 8, 2019

public_deps = []
deps = [
+ "//brave/utility",
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't cause circular dependency?
//brave/utility target has //chrome/utility in its dep list.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nope

@@ -3,6 +3,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "extensions/buildflags/buildflags.h"

#if BUILDFLAG(ENABLE_EXTENSIONS)
Copy link
Member

Choose a reason for hiding this comment

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

I think ToolbarView overriding is not just for extension?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this particular set of headers could not be included without triggering an error because they include other extension headers. This is likely because chromium doesn't test non-default options so while they aren't strictly for extensions, they cannot be used without extensions being enabled

@@ -38,8 +36,9 @@ bool RewriteManifestFile(
// Add the public key
DCHECK(!public_key.empty());

FILE_PATH_LITERAL()
Copy link
Member

Choose a reason for hiding this comment

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

delete?

@@ -33,7 +33,9 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry);

// appearance
#if !defined(OS_ANDROID)
BraveThemeService::RegisterProfilePrefs(registry);
Copy link
Member

Choose a reason for hiding this comment

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

Why only this is in non-android? I think kLocationBarIsWide is not related with android?
Or this is just for avoiding compile error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe the theme service exists on android and this fixed either compile or linking error

@bridiver bridiver force-pushed the android-apk branch 3 times, most recently from 7bf5084 to 1a4b13d Compare May 8, 2019 17:38
Copy link
Member

@bbondy bbondy left a comment

Choose a reason for hiding this comment

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

Looks like all file permissions are being changed from 100644 → 100755, could you reset that back to browser/extensions/brave_component_extension.cc 644?

Copy link
Member

@bbondy bbondy left a comment

Choose a reason for hiding this comment

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

There are some binary files to remove like ._BUILD.gn

@@ -33,7 +33,9 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry);

// appearance
#if !defined(OS_ANDROID)
BraveThemeService::RegisterProfilePrefs(registry);
Copy link
Member

Choose a reason for hiding this comment

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

There is a dark theme on android from Chromium I believe behind a feature flag, but it might not be using this.
Doesn't block this PR in any case.

@@ -39,7 +37,7 @@ bool RewriteManifestFile(
DCHECK(!public_key.empty());

std::unique_ptr<base::DictionaryValue> final_manifest(manifest.DeepCopy());
final_manifest->SetString(extensions::manifest_keys::kPublicKey, public_key);
final_manifest->SetString("key", public_key);
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal but we should define our own constants for these.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the problem was using extensions::manifest_keys::* in android

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not sure if it really makes sense to define them again with the same values just for this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think there's probably a better solution here though that separates extensions from components

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bridiver bridiver force-pushed the android-apk branch 2 times, most recently from 892754a to 513d49d Compare May 8, 2019 19:12
@@ -524,8 +522,9 @@ bool ParsePaymentsPreferences(BraveLedger* ledger,
break;

default:
payments->min_visit_time =
braveledger_ledger::_default_min_publisher_duration;
payments->min_visit_time = 8;
Copy link
Member

Choose a reason for hiding this comment

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

I think a better fix here would be to have a different gn file for this dep and move the constant there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree, just wasn't sure if it was worth it for this since it's just migration from browser-laptop. I can open a ticket if you want

Copy link
Member

Choose a reason for hiding this comment

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

@bridiver yes please, issue is fine for now. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"views/profiles/brave_profile_chooser_view.cc",
"views/profiles/brave_profile_chooser_view.h",
"webui/brave_welcome_ui.cc",
"webui/brave_welcome_ui.h",
Copy link
Member

Choose a reason for hiding this comment

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

I think we'll want to have welcome_ui available in Android, we can fix later though.

bbondy
bbondy previously approved these changes May 8, 2019
Copy link
Member

@bbondy bbondy left a comment

Choose a reason for hiding this comment

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

I'm ok with landing as long as it passes CI or equivalent local builds if CI is being painful.

Copy link
Member

@simonhong simonhong left a comment

Choose a reason for hiding this comment

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

I'm also LGTM if builds are good. Nice refactoring 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants