Closed Bug 1124503 Opened 9 years ago Closed 9 years ago

move AppConstants.jsm to toolkit

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: Gavin, Assigned: philip.chee)

References

Details

Attachments

(2 files, 1 obsolete file)

Introduced in bug 1093358, this is useful more broadly than just Android.
Attached patch Patch v1 Move to toolkit (obsolete) — Splinter Review
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7c088b98d7ba
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5c736b4e0f7b
Except for some expected intermittent failures everything looks green.
Attachment #8567897 - Flags: review?(gavin.sharp)
Assignee: nobody → philip.chee
Status: NEW → ASSIGNED
Comment on attachment 8567897 [details] [diff] [review]
Patch v1 Move to toolkit

Could you please split the "use new shared AppConstants" changes from the "move the module to toolkit" changes?
Attachment #8567897 - Flags: review?(gavin.sharp)
Attachment #8567897 - Attachment is obsolete: true
Attachment #8569285 - Flags: review?(gavin.sharp)
Attachment #8569286 - Flags: review?(gavin.sharp)
Comment on attachment 8569286 [details] [diff] [review]
V2 Part 2: Use the new shared AppConstants

This patch would ideally go in its own bug.

>diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm

>+  get CRASHREPORTER() {
>+    return "nsICrashReporter" in Components.interfaces &&
>+           Services.appinfo instanceof Components.interfaces.nsICrashReporter;
>+  },

This is an odd one - as defined this is not returning a build-time constant. It's also not used, so I would suggest not adding it here.

Looks good otherwise.
Attachment #8569286 - Flags: review?(gavin.sharp)
Comment on attachment 8569285 [details] [diff] [review]
V2 Part 1: move AppConstants.jsm to toolkit

>diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build

>+for var in ('ANDROID_PACKAGE_NAME',

>+            'MOZ_BUILD_APP'):

>+for var in ('NIGHTLY_BUILD',
>+            'RELEASE_BUILD',
>+            'ACCESSIBILITY',
>+            'MOZ_DEVICES',
>+            'MOZ_OFFICIAL_BRANDING',
>+            'MOZ_SAFE_BROWSING',
>+            'MOZ_SERVICES_HEALTHREPORT',
>+            'MOZ_TELEMETRY_REPORTING',
>+            'MOZ_WEBRTC'):

You should be able to remove all of these given that they are AC_DEFINE()d in configure. Could you test that?

>+# Keep it this way if at all possible.  If you need preprocessing,
>+# consider adding fields to AppConstants.jsm.

I don't understand this comment at all, I would just remove it.
Attachment #8569285 - Flags: review?(gavin.sharp) → review+
Blocks: 1139958
https://hg.mozilla.org/mozilla-central/rev/be4fec24c85c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
> >+# Keep it this way if at all possible.  If you need preprocessing,
> >+# consider adding fields to AppConstants.jsm.
> 
> I don't understand this comment at all, I would just remove it.

The idea was to discourage folks from preprocessing additional modules in mobile/android.
Oops forgot to post my checkin comment:

>>diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
> 
>>+for var in ('ANDROID_PACKAGE_NAME',
> 
>>+            'MOZ_BUILD_APP'):
> 
>>+for var in ('NIGHTLY_BUILD',
>>+            'RELEASE_BUILD',
>>+            'ACCESSIBILITY',
>>+            'MOZ_DEVICES',
>>+            'MOZ_OFFICIAL_BRANDING',
>>+            'MOZ_SAFE_BROWSING',
>>+            'MOZ_SERVICES_HEALTHREPORT',
>>+            'MOZ_TELEMETRY_REPORTING',
>>+            'MOZ_WEBRTC'):
> 
> You should be able to remove all of these given that they are AC_DEFINE()d in configure. Could you test that?

> mozbuild.preprocessor.Error: ('c:\\t1\\hg\\comm-central\\mozilla\\toolkit\\modules\\AppConstants.jsm', 97, 'UNDEFINED_VAR', 'ANDROID_PACKAGE_NAME')
Remvoving the other defines don't seem to cause problems.

>>+# Keep it this way if at all possible.  If you need preprocessing,
>>+# consider adding fields to AppConstants.jsm.
> 
> I don't understand this comment at all, I would just remove it.
Removed.
(In reply to Nick Alexander :nalexander from comment #9)
> The idea was to discourage folks from preprocessing additional modules in
> mobile/android.

I see - could have been clearer! Not relevant to the toolkit/ version so having removed it is fine I think. Can re-add a mobile moz.build variant if needed.

(In reply to Philip Chee from comment #10)
> Oops forgot to post my checkin comment:
> 
> >>diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
> > 
> >>+for var in ('ANDROID_PACKAGE_NAME',
> > 
> >>+            'MOZ_BUILD_APP'):

> > mozbuild.preprocessor.Error: ('c:\\t1\\hg\\comm-central\\mozilla\\toolkit\\modules\\AppConstants.jsm', 97, 'UNDEFINED_VAR', 'ANDROID_PACKAGE_NAME')
> Remvoving the other defines don't seem to cause problems.

Yes sorry, that was just my context-preserving quoting style causing confusion. Thanks for fixing this.
Blocks: 1211166
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: