Bug 1353055 - Strip 'vars' debugging information when building Fennec --with-gradle. r=ahunt

To observe the difference, use `javap -l`.  For example, for
automationRelease and automationDebug built with `./mach gradle clean
app:assembleAutomationRelease app:assembleAutomationDebug`, I see
locally:

$ javap -l objdir-droid/gradle/build/mobile/android/app/intermediates/classes/automation/release/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu\$1.class
Compiled from "ActivityStreamContextMenu.java"
class org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu$1 extends org.mozilla.gecko.util.UIAsyncTask$WithoutParams<java.lang.Boolean> {
  final android.view.MenuItem val$bookmarkItem;

  final org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu this$0;

  org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu$1(org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu, android.os.Handler, android.view.MenuItem);
    LineNumberTable:
      line 103: 0

  <snip>
}

$ javap -l objdir-droid/gradle/build/mobile/android/app/intermediates/classes/automation/debug/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu\$1.class
Compiled from "ActivityStreamContextMenu.java"
class org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu$1 extends org.mozilla.gecko.util.UIAsyncTask$WithoutParams<java.lang.Boolean> {
  final android.view.MenuItem val$bookmarkItem;

  final org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu this$0;

  org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu$1(org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu, android.os.Handler, android.view.MenuItem);
    LineNumberTable:
      line 103: 0
    LocalVariableTable:
      Start  Length  Slot  Name   Signature
          0      16     0  this   Lorg/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu$1;
          0      16     1 this$0   Lorg/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu;
          0      16     2    x0   Landroid/os/Handler;

  <snip>
}

MozReview-Commit-ID: 3HmiGkHhowQ

--HG--
extra : rebase_source : c84d8d4b8ac813e49db0c61a30c7098ff2eae3f4
This commit is contained in:
Nick Alexander 2017-04-03 13:41:11 -07:00
Родитель d16dcf0eb4
Коммит f0ae8d607b
5 изменённых файлов: 35 добавлений и 1 удалений

Просмотреть файл

@ -447,4 +447,8 @@ android.applicationVariants.all { variant ->
dependsOn "assemble${variant.name.capitalize()}"
}
}
}
// Bug 1353055 - Strip 'vars' debugging information to agree with moz.build.
apply from: "${topsrcdir}/mobile/android/gradle/debug_level.gradle"
android.applicationVariants.all configureVariantDebugLevel

Просмотреть файл

@ -200,3 +200,7 @@ afterEvaluate {
archives sourcesJarWithGeckoBinaries
}
}
// Bug 1353055 - Strip 'vars' debugging information to agree with moz.build.
apply from: "${topsrcdir}/mobile/android/gradle/debug_level.gradle"
android.libraryVariants.all configureVariantDebugLevel

Просмотреть файл

@ -0,0 +1,17 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// Bug 1353055 - Strip 'vars' debugging information to agree with moz.build.
ext.configureVariantDebugLevel = { variant ->
// Like 'debug', 'release', or 'withGeckoBinaries'.
def buildType = variant.buildType.name
// The default is 'lines,source,vars', which includes debugging information
// that is quite large: roughly 500kb for Fennec. Therefore we remove
// 'vars' unless we're producing a debug build, where it is useful.
if (!buildType.equals('debug')) {
variant.javaCompile.options.debugOptions.debugLevel = 'lines,source'
}
}

Просмотреть файл

@ -1,3 +1,8 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// We run fairly hard into a fundamental limitation of the Android Gradle
// plugin. There are many bugs filed about this, but
// https://code.google.com/p/android/issues/detail?id=216978#c6 is a reason one.

4
mobile/android/thirdparty/build.gradle поставляемый
Просмотреть файл

@ -52,3 +52,7 @@ idea {
}
}
}
// Bug 1353055 - Strip 'vars' debugging information to agree with moz.build.
apply from: "${topsrcdir}/mobile/android/gradle/debug_level.gradle"
android.libraryVariants.all configureVariantDebugLevel