import com.android.builder.DefaultManifestParser def manifestParser = new DefaultManifestParser() println manifestParser.getVersionName(android.sourceSets.main.manifest.srcFile)
protected String extractPackageNameFromAndroidManifest( File manifestFile ) { return new DefaultManifestParser( manifestFile ).getPackage(); }
final String packageName = new DefaultManifestParser( libManifestFile ).getPackage(); if ( rJavaAlreadyExists( packageName ) )
doLast { def manifestParser = new DefaultManifestParser() def manifestVersion = manifestParser.getVersionName(android.sourceSets.main.manifest.srcFile) }
buildTypes { applicationVariants.all { variant -> variant.outputs.each { output -> def String fileName; if(variant.name == android.buildTypes.release.name) { def manifestParser = new DefaultManifestParser() def String versionName = manifestParser.getVersionName((File) android.sourceSets.main.manifest.srcFile) fileName = "App-release-v${versionName}.apk" } else { //etc } def File file = output.outputFile output.outputFile = new File( file.parent, fileName ) } } release { //etc } }
@NonNull private ManifestAttributeSupplier getManifestAttributeSupplier(){ if (mManifestAttributeSupplier == null){ mManifestAttributeSupplier = new DefaultManifestParser(mDefaultSourceProvider.getManifestFile()); } return mManifestAttributeSupplier; } }
@NonNull public static NativeLibrariesPackagingMode getNativeLibrariesLibrariesPackagingMode( @NonNull File manifest) { checkState(manifest.exists()); DefaultManifestParser parser = new DefaultManifestParser(manifest); Boolean extractNativeLibs = parser.getExtractNativeLibs(); // The default is "true", so we only package *.so files differently if the user explicitly // set this to "false". if (Boolean.FALSE.equals(extractNativeLibs)) { return NativeLibrariesPackagingMode.UNCOMPRESSED_AND_ALIGNED; } else { return NativeLibrariesPackagingMode.COMPRESSED; } }
/** * Parses the manifest file and return the package name. * @param manifestFile the manifest file * @return the package name found or null */ @Nullable public static String getManifestPackage(@NonNull File manifestFile) { return new DefaultManifestParser().getPackage(manifestFile); }
externalBuildContext, new AaptOptionsImpl(null, null, false, null), new DefaultManifestParser(androidManifestFile));
new DefaultManifestParser(atomDependency.getManifest()).getSplit(); if (splitName == null) return config.getOriginalApplicationId();