/** * Generates the file from the template. * @param outputFile the file to create */ public void generate(File outputFile) throws IOException { String template = readEmbeddedTextFile(mTemplateStream); String content = replaceParameters(template, mPlaceHolderMap); writeFile(outputFile, content); }
@Override public File getFile(int pathId) { return new File(getPath(pathId)); }
@Override public int hashCode() { return Objects.hashCode( super.hashCode(), mName, mDebuggable, mTestCoverageEnabled, mJniDebuggable, mPseudoLocalesEnabled, mRenderscriptDebuggable, mRenderscriptOptimLevel, mApplicationIdSuffix, mVersionNameSuffix, mMinifyEnabled, mZipAlignEnabled, mSigningConfig, mEmbedMicroApp); }
public BuildConfigGenerator addField( @NonNull String type, @NonNull String name, @NonNull String value) { mFields.add(new ClassFieldImpl(type, name, value)); return this; }
protected void _initWith(@NonNull BaseConfig that) { setBuildConfigFields(that.getBuildConfigFields()); setResValues(that.getResValues()); mProguardFiles.clear(); mProguardFiles.addAll(that.getProguardFiles()); mConsumerProguardFiles.clear(); mConsumerProguardFiles.addAll(that.getConsumerProguardFiles()); mTestProguardFiles.clear(); mTestProguardFiles.addAll(that.getTestProguardFiles()); mManifestPlaceholders.clear(); mManifestPlaceholders.putAll(that.getManifestPlaceholders()); mMultiDexEnabled = that.getMultiDexEnabled(); mMultiDexKeepFile = that.getMultiDexKeepFile(); mMultiDexKeepProguard = that.getMultiDexKeepProguard(); mJarJarRuleFiles = that.getJarJarRuleFiles(); }
private static void generateTestManifest( @NonNull String testApplicationId, @Nullable String minSdkVersion, @Nullable String targetSdkVersion, @NonNull String testedApplicationId, @NonNull String instrumentationRunner, @NonNull Boolean handleProfiling, @NonNull Boolean functionalTest, @NonNull File outManifestLocation) { TestManifestGenerator generator = new TestManifestGenerator( outManifestLocation, testApplicationId, minSdkVersion, targetSdkVersion, testedApplicationId, instrumentationRunner, handleProfiling, functionalTest); try { generator.generate(); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; DefaultBuildType buildType = (DefaultBuildType) o; return Objects.equal(mName, buildType.mName) && mDebuggable == buildType.mDebuggable && mTestCoverageEnabled == buildType.mTestCoverageEnabled && mJniDebuggable == buildType.mJniDebuggable && mPseudoLocalesEnabled == buildType.mPseudoLocalesEnabled && mRenderscriptDebuggable == buildType.mRenderscriptDebuggable && mRenderscriptOptimLevel == buildType.mRenderscriptOptimLevel && mMinifyEnabled == buildType.mMinifyEnabled && mZipAlignEnabled == buildType.mZipAlignEnabled && mEmbedMicroApp == buildType.mEmbedMicroApp && Objects.equal(mSigningConfig, buildType.mSigningConfig); }
private Table<String, String, SymbolEntry> getAllSymbols() { Table<String, String, SymbolEntry> symbols = HashBasedTable.create(); for (SymbolLoader symbolLoader : mSymbols) { symbols.putAll(symbolLoader.getSymbols()); } return symbols; }
/** * Generates the file from the template. * @param outputFile the file to create */ public void generate(File outputFile) throws IOException { String template = readEmbeddedTextFile(mTemplateStream); String content = replaceParameters(template, mPlaceHolderMap); writeFile(outputFile, content); }
/** * Adds a variant-specific res value. * @param type the type of the field * @param name the name of the field * @param value the value of the field */ public void addResValue(@NonNull String type, @NonNull String name, @NonNull String value) { ClassField classField = new ClassFieldImpl(type, name, value); mResValues.put(name, classField); }
protected void _initWith(@NonNull BaseConfig that) { setBuildConfigFields(that.getBuildConfigFields()); setResValues(that.getResValues()); mApplicationIdSuffix = that.getApplicationIdSuffix(); mVersionNameSuffix = that.getVersionNameSuffix(); mProguardFiles.clear(); mProguardFiles.addAll(that.getProguardFiles()); mConsumerProguardFiles.clear(); mConsumerProguardFiles.addAll(that.getConsumerProguardFiles()); mTestProguardFiles.clear(); mTestProguardFiles.addAll(that.getTestProguardFiles()); mManifestPlaceholders.clear(); mManifestPlaceholders.putAll(that.getManifestPlaceholders()); mMultiDexEnabled = that.getMultiDexEnabled(); mMultiDexKeepFile = that.getMultiDexKeepFile(); mMultiDexKeepProguard = that.getMultiDexKeepProguard(); mJarJarRuleFiles = that.getJarJarRuleFiles(); }
@Override public int hashCode() { return Objects.hashCode( super.hashCode(), mName, mDebuggable, mTestCoverageEnabled, mJniDebuggable, mPseudoLocalesEnabled, mRenderscriptDebuggable, mRenderscriptOptimLevel, mMinifyEnabled, mZipAlignEnabled, mSigningConfig, mEmbedMicroApp); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; DefaultBuildType buildType = (DefaultBuildType) o; return Objects.equal(mName, buildType.mName) && mDebuggable == buildType.mDebuggable && mTestCoverageEnabled == buildType.mTestCoverageEnabled && mJniDebuggable == buildType.mJniDebuggable && mPseudoLocalesEnabled == buildType.mPseudoLocalesEnabled && mRenderscriptDebuggable == buildType.mRenderscriptDebuggable && mRenderscriptOptimLevel == buildType.mRenderscriptOptimLevel && mMinifyEnabled == buildType.mMinifyEnabled && mZipAlignEnabled == buildType.mZipAlignEnabled && mEmbedMicroApp == buildType.mEmbedMicroApp && Objects.equal(mApplicationIdSuffix, buildType.mApplicationIdSuffix) && Objects.equal(mVersionNameSuffix, buildType.mVersionNameSuffix) && Objects.equal(mSigningConfig, buildType.mSigningConfig); }
@Override public File getFile(int pathId) { return new File(getPath(pathId)); }
public ResValueGenerator addResource( @NonNull String type, @NonNull String name, @NonNull String value) { mFields.add(new ClassFieldImpl(type, name, value)); return this; }
@Override public int hashCode() { return Objects.hashCode( super.hashCode(), mName, mDimension, mMinSdkVersion, mTargetSdkVersion, mMaxSdkVersion, mRenderscriptTargetApi, mRenderscriptSupportModeEnabled, mRenderscriptSupportModeBlasEnabled, mRenderscriptNdkModeEnabled, mVersionCode, mVersionName, mApplicationId, mTestApplicationId, mTestInstrumentationRunner, mTestInstrumentationRunnerArguments, mTestHandleProfiling, mTestFunctionalTest, mSigningConfig, mResourceConfiguration, mWearAppUnbundled); }
return false; if (!super.equals(o)) { return false;
/** * Adds a variant-specific BuildConfig field. * @param type the type of the field * @param name the name of the field * @param value the value of the field */ public void addBuildConfigField(@NonNull String type, @NonNull String name, @NonNull String value) { ClassField classField = new ClassFieldImpl(type, name, value); mBuildConfigFields.put(name, classField); }
@Override public int hashCode() { return Objects.hashCode( super.hashCode(), mName, mDimension, mMinSdkVersion, mTargetSdkVersion, mMaxSdkVersion, mRenderscriptTargetApi, mRenderscriptSupportModeEnabled, mRenderscriptNdkModeEnabled, mVersionCode, mVersionName, mApplicationId, mTestApplicationId, mTestInstrumentationRunner, mTestInstrumentationRunnerArguments, mTestHandleProfiling, mTestFunctionalTest, mSigningConfig, mResourceConfiguration); }
@NonNull public static ClassField createClassField(@NonNull String type, @NonNull String name, @NonNull String value) { return new ClassFieldImpl(type, name, value); }