/** * Returns the application id override value coming from the Product Flavor and/or the * Build Type. If the package/id is not overridden then this returns null. * * @return the id override or null */ @Nullable public String getIdOverride() { String idName = mMergedFlavor.getApplicationId(); String idSuffix = mBuildType.getApplicationIdSuffix(); if (idSuffix != null && !idSuffix.isEmpty()) { if (idName == null) { idName = getPackageFromManifest(); } if (idSuffix.charAt(0) == '.') { idName = idName + idSuffix; } else { idName = idName + '.' + idSuffix; } } return idName; }
/** * Returns the original application ID before any overrides from flavors. * If the variant is a test variant, then the application ID is the one coming from the * configuration of the tested variant, and this call is similar to {@link #getApplicationId()} * @return the original application ID */ @Nullable public String getOriginalApplicationId() { if (mType.isForTesting()) { return getApplicationId(); } return getPackageFromManifest(); }
/** * Returns the original application ID before any overrides from flavors. * If the variant is a test variant, then the application ID is the one coming from the * configuration of the tested variant, and this call is similar to {@link #getApplicationId()} * @return the original application ID */ @Nullable public String getOriginalApplicationId() { if (mType.isForTesting()) { return getApplicationId(); } return getPackageFromManifest(); }
/** * Returns the application id override value coming from the Product Flavor and/or the * Build Type. If the package/id is not overridden then this returns null. * * @return the id override or null */ @Nullable public String getIdOverride() { String idName = mMergedFlavor.getApplicationId(); String idSuffix = DefaultProductFlavor.mergeApplicationIdSuffix( mBuildType.getApplicationIdSuffix(), mMergedFlavor.getApplicationIdSuffix()); if (!idSuffix.isEmpty()) { if (idName == null) { idName = getPackageFromManifest(); } if (idSuffix.charAt(0) == '.') { idName = idName + idSuffix; } else { idName = idName + '.' + idSuffix; } } return idName; }
String packageName = variantConfig.getPackageFromManifest(); if (packageName == null) { throw new BuildException("Failed to read manifest", null);