public class BuildUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANDROID_MANIFEST_FILE_NAME
The name for the AndroidManifest.xml files.
|
| Constructor and Description |
|---|
BuildUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.android.builder.model.ClassField |
createStringClassField(java.lang.String key,
java.lang.String value)
Creates a
ClassField with String type that could be inserted into a BuildConfig. |
static Version |
getAndroidGradlePluginVersion(org.gradle.api.Project project)
Gets the
Version of the Android Gradle Plugin for the given Project. |
static java.util.List<java.lang.String> |
getAndroidGradlePluginVersions(org.gradle.api.Project project)
Gets all the Android Gradle Plugin version Strings, that are defined in the given Projects buildscript.
|
static java.util.List<java.lang.String> |
getAndroidGradlePluginVersionsForConfiguration(org.gradle.api.artifacts.Configuration configuration)
Gets all the Android Gradle Plugin version Strings from a given
Configuration. |
static java.util.List<java.io.File> |
getApkManifestPaths(org.gradle.api.Project project,
com.android.build.gradle.api.BaseVariantOutput output)
Gets the list of AndroidManifest.xml files for apk outputs for a given variant output.
|
static java.util.List<java.io.File> |
getBundleManifestPaths(org.gradle.api.Project project,
com.android.build.gradle.api.BaseVariantOutput output)
Gets the list of paths for the AndroidManifest.xml files for bundle outputs for a given
variant output.
|
static java.util.List<java.io.File> |
getManifestPaths(org.gradle.api.Project project,
com.android.build.gradle.api.BaseVariantOutput output,
java.util.List<org.gradle.api.Task> tasks)
Gets the path for the compiled AndroidManifest.xml files.
|
static boolean |
hasApkOutput(java.util.List<org.gradle.api.Task> tasks)
Determines if the current set of tasks will have apk outputs or not.
|
static boolean |
hasBundleOutput(java.util.List<org.gradle.api.Task> tasks)
Determines if the current set of tasks will have bundle outputs or not.
|
public static final java.lang.String ANDROID_MANIFEST_FILE_NAME
public static boolean hasBundleOutput(@NonNull
java.util.List<org.gradle.api.Task> tasks)
tasks - the task list of the build.true if it has, false otherwise.public static boolean hasApkOutput(@NonNull
java.util.List<org.gradle.api.Task> tasks)
tasks - the task list of the build.true if it has, false otherwise.@NonNull
public static java.util.List<java.io.File> getBundleManifestPaths(@NonNull
org.gradle.api.Project project,
@NonNull
com.android.build.gradle.api.BaseVariantOutput output)
project - the Project itself.output - the variant output.@NonNull
public static java.util.List<java.io.File> getApkManifestPaths(@NonNull
org.gradle.api.Project project,
@NonNull
com.android.build.gradle.api.BaseVariantOutput output)
project - the Project itself.output - the variant output.@NonNull
public static java.util.List<java.io.File> getManifestPaths(@NonNull
org.gradle.api.Project project,
@NonNull
com.android.build.gradle.api.BaseVariantOutput output,
@NonNull
java.util.List<org.gradle.api.Task> tasks)
project - the Project itself.output - the build variant output.tasks - the list of tasks of the build.@NonNull
public static com.android.builder.model.ClassField createStringClassField(@NonNull
java.lang.String key,
@NonNull
java.lang.String value)
ClassField with String type that could be inserted into a BuildConfig.key - the key of the String.value - the value of the String.@NonNull public static Version getAndroidGradlePluginVersion(@NonNull org.gradle.api.Project project)
Version of the Android Gradle Plugin for the given Project. Recursively checks the
buildscript dependencies within the project and all parent project, and returns the highest value, similarly
how Gradle's dependency resolution works.project - the Project itself.@NonNull
public static java.util.List<java.lang.String> getAndroidGradlePluginVersions(@Nullable
org.gradle.api.Project project)
project - the Project itself.@NonNull
public static java.util.List<java.lang.String> getAndroidGradlePluginVersionsForConfiguration(@Nullable
org.gradle.api.artifacts.Configuration configuration)
Configuration.configuration - the Configuration.