Bug 1064620: Replace # with //# for IDE integration. r=nalexander
☠☠ backed out by 5e285d8e2ac1 ☠ ☠
authorNick Alexander <nalexander@mozilla.com>
Fri, 10 Oct 2014 21:11:56 +0100
changeset 209800 f6422f3802514ff92876261cef0f5a033e2af274
parent 209799 15e3bf0b1847032b930b1f3e0f7131abf329b7e9
child 209801 683b81f8a9d3c14d04522af9ad3311d9944b74fc
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersnalexander
bugs1064620
milestone35.0a1
Bug 1064620: Replace # with //# for IDE integration. r=nalexander
mobile/android/base/AppConstants.java.in
mobile/android/base/Makefile.in
mobile/android/base/SysInfo.java.in
mobile/android/base/background/common/GlobalConstants.java.in
mobile/android/base/background/healthreport/HealthReportConstants.java.in
mobile/android/base/fxa/FxAccountConstants.java.in
mobile/android/base/mozglue/GeckoLoader.java.in
mobile/android/base/sync/SyncConstants.java.in
mobile/android/base/widget/ThemedEditText.java.in
mobile/android/base/widget/ThemedImageButton.java.in
mobile/android/base/widget/ThemedImageView.java.in
mobile/android/base/widget/ThemedLinearLayout.java.in
mobile/android/base/widget/ThemedRelativeLayout.java.in
mobile/android/base/widget/ThemedTextSwitcher.java.in
mobile/android/base/widget/ThemedTextView.java.in
mobile/android/base/widget/ThemedView.java.frag
mobile/android/base/widget/ThemedView.java.in
--- a/mobile/android/base/AppConstants.java.in
+++ b/mobile/android/base/AppConstants.java.in
@@ -1,9 +1,9 @@
-#filter substitution
+//#filter substitution
 /* -*- 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/. */
 
 package org.mozilla.gecko;
 
 import org.mozilla.gecko.mozglue.RobocopTarget;
@@ -26,21 +26,21 @@ public class AppConstants {
 
     /**
      * Encapsulates access to compile-time version definitions, allowing
      * for dead code removal for particular APKs.
      */
     public static final class Versions {
         public static final int MIN_SDK_VERSION = @MOZ_ANDROID_MIN_SDK_VERSION@;
         public static final int MAX_SDK_VERSION =
-#ifdef MOZ_ANDROID_MAX_SDK_VERSION
+//#ifdef MOZ_ANDROID_MAX_SDK_VERSION
         @MOZ_ANDROID_MAX_SDK_VERSION@;
-#else
+//#else
         999;
-#endif
+//#endif
 
         /*
          * The SDK_INT >= N check can only pass if our MAX_SDK_VERSION is
          * _greater than or equal_ to that number, because otherwise we
          * won't be installed on the device.
          *
          * If MIN_SDK_VERSION is greater than or equal to the number, there
          * is no need to do the runtime check.
@@ -88,21 +88,21 @@ public class AppConstants {
     public static final String MOZ_APP_VENDOR = "@MOZ_APP_VENDOR@";
     public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@";
 
     // MOZILLA_VERSION is already quoted when it gets substituted in. If we
     // add additional quotes we end up with ""x.y"", which is a syntax error.
     public static final String MOZILLA_VERSION = @MOZILLA_VERSION@;
 
     public static final String MOZ_STUMBLER_API_KEY =
-#ifdef MOZ_ANDROID_MLS_STUMBLER
+//#ifdef MOZ_ANDROID_MLS_STUMBLER
     "@MOZ_STUMBLER_API_KEY@";
-#else
+//#else
     null;
-#endif
+//#endif
     public static final boolean MOZ_STUMBLER_BUILD_TIME_ENABLED = (MOZ_STUMBLER_API_KEY != null);
 
     public static final String MOZ_CHILD_PROCESS_NAME = "@MOZ_CHILD_PROCESS_NAME@";
     public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@";
     public static final String OMNIJAR_NAME = "@OMNIJAR_NAME@";
     public static final String OS_TARGET = "@OS_TARGET@";
     public static final String TARGET_XPCOM_ABI = @TARGET_XPCOM_ABI@;
 
@@ -117,147 +117,147 @@ public class AppConstants {
     public static final String USER_AGENT_FENNEC_TABLET = "Mozilla/5.0 (Android; Tablet; rv:" +
         AppConstants.MOZ_APP_VERSION + ") Gecko/" +
         AppConstants.MOZ_APP_VERSION + " Firefox/" +
         AppConstants.MOZ_APP_VERSION;
 
     public static final int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@;
 
     public static final boolean MOZ_ANDROID_ANR_REPORTER =
-#ifdef MOZ_ANDROID_ANR_REPORTER
+//#ifdef MOZ_ANDROID_ANR_REPORTER
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final String MOZ_PKG_SPECIAL =
-#ifdef MOZ_PKG_SPECIAL
+//#ifdef MOZ_PKG_SPECIAL
     "@MOZ_PKG_SPECIAL@";
-#else
+//#else
     null;
-#endif
+//#endif
 
     /**
      * Whether this APK was built with constrained resources --
      * no xhdpi+ images, for example.
      */
     public static final boolean MOZ_ANDROID_RESOURCE_CONSTRAINED =
-#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
+//#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_SERVICES_HEALTHREPORT =
-#ifdef MOZ_SERVICES_HEALTHREPORT
+//#ifdef MOZ_SERVICES_HEALTHREPORT
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_TELEMETRY_ON_BY_DEFAULT =
-#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
+//#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final String TELEMETRY_PREF_NAME =
           "toolkit.telemetry.enabled";
 
     public static final boolean MOZ_TELEMETRY_REPORTING =
-#ifdef MOZ_TELEMETRY_REPORTING
+//#ifdef MOZ_TELEMETRY_REPORTING
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_CRASHREPORTER =
-#if MOZ_CRASHREPORTER
+//#if MOZ_CRASHREPORTER
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_DATA_REPORTING =
-#ifdef MOZ_DATA_REPORTING
+//#ifdef MOZ_DATA_REPORTING
       true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_LOCALE_SWITCHER =
-#ifdef MOZ_LOCALE_SWITCHER
+//#ifdef MOZ_LOCALE_SWITCHER
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_UPDATER =
-#ifdef MOZ_UPDATER
+//#ifdef MOZ_UPDATER
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_WEBSMS_BACKEND =
-#ifdef MOZ_WEBSMS_BACKEND
+//#ifdef MOZ_WEBSMS_BACKEND
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     // Android Beam is only supported on API14+, so we don't even bother building
     // it if this APK doesn't include API14 support.
     public static final boolean MOZ_ANDROID_BEAM =
-#ifdef MOZ_ANDROID_BEAM
+//#ifdef MOZ_ANDROID_BEAM
     Versions.feature14Plus;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_ANDROID_APZ =
-#ifdef MOZ_ANDROID_APZ
+//#ifdef MOZ_ANDROID_APZ
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     // See this wiki page for more details about channel specific build defines:
     // https://wiki.mozilla.org/Platform/Channel-specific_build_defines
     public static final boolean RELEASE_BUILD =
-#ifdef RELEASE_BUILD
+//#ifdef RELEASE_BUILD
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean DEBUG_BUILD =
-#ifdef MOZ_DEBUG
+//#ifdef MOZ_DEBUG
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean MOZ_MEDIA_PLAYER =
-#ifdef MOZ_NATIVE_DEVICES
+//#ifdef MOZ_NATIVE_DEVICES
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     // Official corresponds, roughly, to whether this build is performed on
     // Mozilla's continuous integration infrastructure. You should disable
     // developer-only functionality when this flag is set.
     public static final boolean MOZILLA_OFFICIAL =
-#ifdef MOZILLA_OFFICIAL
+//#ifdef MOZILLA_OFFICIAL
     true;
-#else
+//#else
     false;
-#endif
+//#endif
 
     public static final boolean ANDROID_DOWNLOADS_INTEGRATION =
 #ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
     AppConstants.Versions.feature12Plus;
 #else
     false;
 #endif
 }
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -196,29 +196,31 @@ PP_TARGETS += manifest
 # Certain source files need to be preprocessed.  This special rule
 # generates these files into generated/org/mozilla/gecko for
 # consumption by the build system and IDEs.
 
 preprocessed := $(addsuffix .in,$(subst generated/org/mozilla/gecko/,,$(filter generated/org/mozilla/gecko/%,$(PP_JAVAFILES))))
 
 preprocessed_PATH := generated/org/mozilla/gecko
 preprocessed_KEEP_PATH := 1
+preprocessed_FLAGS := --marker='//\\\#'
 
 PP_TARGETS += preprocessed
 
 # Certain source files have Java package name @ANDROID_PACKAGE_NAME@.
 # We hate these files but they are necessary for backwards
 # compatibility.  These special rules generate these files into
 # generated/org/mozilla/{firefox,firefox_beta,fennec,fennec_$USER} for
 # consumption by the build system and IDEs.
 
 preprocessed_package := $(addsuffix .in,$(subst $(android_package_dir)/,,$(filter $(android_package_dir)/%,$(PP_JAVAFILES))))
 
 preprocessed_package_PATH := $(android_package_dir)
 preprocessed_package_KEEP_PATH := 1
+preprocessed_package_FLAGS := --marker='//\\\#'
 
 PP_TARGETS += preprocessed_package
 
 include $(topsrcdir)/config/rules.mk
 
 not_android_res_files := \
   *.mkdir.done* \
   *.DS_Store* \
--- a/mobile/android/base/SysInfo.java.in
+++ b/mobile/android/base/SysInfo.java.in
@@ -1,9 +1,9 @@
-#filter substitution
+//#filter substitution
 /* -*- 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/. */
 
 package org.mozilla.gecko;
 
 import org.mozilla.gecko.util.HardwareUtils;
--- a/mobile/android/base/background/common/GlobalConstants.java.in
+++ b/mobile/android/base/background/common/GlobalConstants.java.in
@@ -1,9 +1,9 @@
-#filter substitution
+//#filter substitution
 /* 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/. */
 
 package org.mozilla.gecko.background.common;
 
 /**
  * Preprocessed class for storing preprocessed values common to all
@@ -11,21 +11,21 @@ package org.mozilla.gecko.background.com
  */
 public class GlobalConstants {
   public static final String ANDROID_CPU_ARCH = "@ANDROID_CPU_ARCH@";
 
   // One of 'beta', 'aurora', 'nightly', 'default'.
   // If this is an official build, 'default' means 'release'.
   // Otherwise, it means 'dev'.
   public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@";
-#ifdef MOZ_OFFICIAL_BRANDING
+//#ifdef MOZ_OFFICIAL_BRANDING
   public static final boolean MOZ_OFFICIAL_BRANDING = true;
-#else
+//#else
   public static final boolean MOZ_OFFICIAL_BRANDING = false;
-#endif
+//#endif
 
   public static final long BUILD_TIMESTAMP_SECONDS = @MOZ_BUILD_TIMESTAMP@L;
   public static final long BUILD_TIMESTAMP_MSEC = 1000L * @MOZ_BUILD_TIMESTAMP@L;
 
   public static final String MOZ_APP_DISPLAYNAME = "@MOZ_APP_DISPLAYNAME@";
   public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@";
   public static final String BROWSER_INTENT_PACKAGE = "@ANDROID_PACKAGE_NAME@";
   public static final String BROWSER_INTENT_CLASS = "org.mozilla.gecko.BrowserApp";
--- a/mobile/android/base/background/healthreport/HealthReportConstants.java.in
+++ b/mobile/android/base/background/healthreport/HealthReportConstants.java.in
@@ -1,9 +1,9 @@
-#filter substitution
+//#filter substitution
 /* 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/. */
 
 package org.mozilla.gecko.background.healthreport;
 
 import org.mozilla.gecko.background.common.GlobalConstants;
 
--- a/mobile/android/base/fxa/FxAccountConstants.java.in
+++ b/mobile/android/base/fxa/FxAccountConstants.java.in
@@ -1,9 +1,9 @@
-#filter substitution
+//#filter substitution
 /* 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/. */
 
 package org.mozilla.gecko.fxa;
 
 import org.mozilla.gecko.background.common.GlobalConstants;
 import org.mozilla.gecko.background.common.log.Logger;
--- a/mobile/android/base/mozglue/GeckoLoader.java.in
+++ b/mobile/android/base/mozglue/GeckoLoader.java.in
@@ -1,9 +1,9 @@
-#filter substitution
+//#filter substitution
 /* -*- 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/. */
 
 package org.mozilla.gecko.mozglue;
 
 import java.io.File;
@@ -221,26 +221,26 @@ public final class GeckoLoader {
         String forced_ondemand = System.getenv("MOZ_LINKER_ONDEMAND");
         if (forced_ondemand == null) {
             if ("HTC".equals(android.os.Build.MANUFACTURER) &&
                 "HTC Vision".equals(android.os.Build.MODEL)) {
                 putenv("MOZ_LINKER_ONDEMAND=0");
             }
         }
 
-#ifdef MOZ_LINKER_EXTRACT
+//#ifdef MOZ_LINKER_EXTRACT
         putenv("MOZ_LINKER_EXTRACT=1");
         // Ensure that the cache dir is world-writable
         File cacheDir = new File(linkerCache);
         if (cacheDir.isDirectory()) {
             cacheDir.setWritable(true, false);
             cacheDir.setExecutable(true, false);
             cacheDir.setReadable(true, false);
         }
-#endif
+//#endif
     }
 
     @RobocopTarget
     public static void loadSQLiteLibs(final Context context, final String apkName) {
         synchronized (sLibLoadingLock) {
             if (sSQLiteLibsLoaded) {
                 return;
             }
--- a/mobile/android/base/sync/SyncConstants.java.in
+++ b/mobile/android/base/sync/SyncConstants.java.in
@@ -1,9 +1,9 @@
-#filter substitution
+//#filter substitution
 /* 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/. */
 
 package org.mozilla.gecko.sync;
 
 import org.mozilla.gecko.background.common.GlobalConstants;
 
--- a/mobile/android/base/widget/ThemedEditText.java.in
+++ b/mobile/android/base/widget/ThemedEditText.java.in
@@ -1,5 +1,5 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX EditText
-#define BASE_TYPE android.widget.EditText
-#define STYLE_CONSTRUCTOR 1
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX EditText
+//#define BASE_TYPE android.widget.EditText
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
--- a/mobile/android/base/widget/ThemedImageButton.java.in
+++ b/mobile/android/base/widget/ThemedImageButton.java.in
@@ -1,5 +1,5 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX ImageButton
-#define BASE_TYPE android.widget.ImageButton
-#define STYLE_CONSTRUCTOR 1
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX ImageButton
+//#define BASE_TYPE android.widget.ImageButton
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
--- a/mobile/android/base/widget/ThemedImageView.java.in
+++ b/mobile/android/base/widget/ThemedImageView.java.in
@@ -1,5 +1,5 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX ImageView
-#define BASE_TYPE android.widget.ImageView
-#define STYLE_CONSTRUCTOR 1
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX ImageView
+//#define BASE_TYPE android.widget.ImageView
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
--- a/mobile/android/base/widget/ThemedLinearLayout.java.in
+++ b/mobile/android/base/widget/ThemedLinearLayout.java.in
@@ -1,4 +1,4 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX LinearLayout
-#define BASE_TYPE android.widget.LinearLayout
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX LinearLayout
+//#define BASE_TYPE android.widget.LinearLayout
+//#include ThemedView.java.frag
--- a/mobile/android/base/widget/ThemedRelativeLayout.java.in
+++ b/mobile/android/base/widget/ThemedRelativeLayout.java.in
@@ -1,5 +1,5 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX RelativeLayout
-#define BASE_TYPE android.widget.RelativeLayout
-#define STYLE_CONSTRUCTOR 1
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX RelativeLayout
+//#define BASE_TYPE android.widget.RelativeLayout
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
--- a/mobile/android/base/widget/ThemedTextSwitcher.java.in
+++ b/mobile/android/base/widget/ThemedTextSwitcher.java.in
@@ -1,4 +1,4 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX TextSwitcher
-#define BASE_TYPE android.widget.TextSwitcher
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX TextSwitcher
+//#define BASE_TYPE android.widget.TextSwitcher
+//#include ThemedView.java.frag
--- a/mobile/android/base/widget/ThemedTextView.java.in
+++ b/mobile/android/base/widget/ThemedTextView.java.in
@@ -1,5 +1,5 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX TextView
-#define BASE_TYPE android.widget.TextView
-#define STYLE_CONSTRUCTOR 1
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX TextView
+//#define BASE_TYPE android.widget.TextView
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
--- a/mobile/android/base/widget/ThemedView.java.frag
+++ b/mobile/android/base/widget/ThemedView.java.frag
@@ -30,21 +30,21 @@ public class Themed@VIEW_NAME_SUFFIX@ ex
     private boolean mIsDark;
     private boolean mAutoUpdateTheme = true;
 
     public Themed@VIEW_NAME_SUFFIX@(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
     public Themed@VIEW_NAME_SUFFIX@(Context context, AttributeSet attrs, int defStyle) {
-#ifdef STYLE_CONSTRUCTOR
+//#ifdef STYLE_CONSTRUCTOR
         super(context, attrs, defStyle);
-#else
+//#else
         super(context, attrs);
-#endif
+//#endif
 
         mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
 
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
         mAutoUpdateTheme = a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
         a.recycle();
     }
 
--- a/mobile/android/base/widget/ThemedView.java.in
+++ b/mobile/android/base/widget/ThemedView.java.in
@@ -1,5 +1,5 @@
-#filter substitution
-#define VIEW_NAME_SUFFIX View
-#define BASE_TYPE android.view.View
-#define STYLE_CONSTRUCTOR 1
-#include ThemedView.java.frag
+//#filter substitution
+//#define VIEW_NAME_SUFFIX View
+//#define BASE_TYPE android.view.View
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag