mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
Removed the builder-model module
This commit is contained in:
Generated
+1
@@ -11,6 +11,7 @@
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel target="1.8">
|
||||
<module name="AndroidIDE.build-tools.builder-model" target="11" />
|
||||
<module name="AndroidIDE.build-tools.project" target="11" />
|
||||
<module name="AndroidIDE.build-tools.tooling-api-plugin" target="11" />
|
||||
<module name="AndroidIDE.google-java-format" target="1.8" />
|
||||
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* This file is part of AndroidIDE.
|
||||
*
|
||||
* AndroidIDE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AndroidIDE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
dependencies {
|
||||
//noinspection GradleDependency
|
||||
implementation "com.android.tools:annotations:30.2.0-rc01"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.build;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
|
||||
/**
|
||||
* Represents a split information, like its type or dimension (density, abi, language...) and
|
||||
* the filter value (like hdpi for a density split type).
|
||||
*/
|
||||
public interface FilterData {
|
||||
|
||||
@NonNull
|
||||
String getIdentifier();
|
||||
|
||||
@NonNull
|
||||
String getFilterType();
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.build;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
|
||||
/** An output with an associated set of filters. */
|
||||
@Deprecated
|
||||
public interface OutputFile extends VariantOutput {
|
||||
|
||||
/**
|
||||
* Returns the output file for this artifact's output.
|
||||
* Depending on whether the project is an app or a library project, this could be an apk or
|
||||
* an aar file. If this {@link com.android.build.OutputFile} has filters, this is a split
|
||||
* APK.
|
||||
*
|
||||
* For test artifact for a library project, this would also be an apk.
|
||||
*
|
||||
* @return the output file.
|
||||
*/
|
||||
@NonNull
|
||||
File getOutputFile();
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.build;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Collection;
|
||||
|
||||
/** basic variant output information */
|
||||
@Deprecated
|
||||
public interface VariantOutput {
|
||||
|
||||
/** An object representing the lack of filter. */
|
||||
String NO_FILTER = null;
|
||||
|
||||
/**
|
||||
* Type of package file, either the main APK or a full split APK file containing resources for a
|
||||
* particular split dimension.
|
||||
*/
|
||||
enum OutputType {
|
||||
MAIN,
|
||||
FULL_SPLIT
|
||||
}
|
||||
|
||||
/**
|
||||
* String representation of the OutputType enum which can be used for remote-able interfaces.
|
||||
*/
|
||||
String MAIN = OutputType.MAIN.name();
|
||||
|
||||
String FULL_SPLIT = OutputType.FULL_SPLIT.name();
|
||||
|
||||
/** Split dimension type */
|
||||
enum FilterType {
|
||||
DENSITY,
|
||||
ABI,
|
||||
LANGUAGE
|
||||
}
|
||||
|
||||
/**
|
||||
* String representations of the FilterType enum which can be used for remote-able interfaces.Ap
|
||||
*/
|
||||
String DENSITY = FilterType.DENSITY.name();
|
||||
|
||||
String ABI = FilterType.ABI.name();
|
||||
String LANGUAGE = FilterType.LANGUAGE.name();
|
||||
|
||||
/** Returns the output type of the referenced APK. */
|
||||
@NonNull
|
||||
String getOutputType();
|
||||
|
||||
/**
|
||||
* Returns the split dimensions the referenced APK was created with. Each collection's value is
|
||||
* the string representation of an element of the {@link FilterType} enum.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<String> getFilterTypes();
|
||||
|
||||
/** Returns all the split information used to create the APK. */
|
||||
@NonNull
|
||||
Collection<FilterData> getFilters();
|
||||
|
||||
/**
|
||||
* Returns the main file for this artifact which can be either the {@link
|
||||
* com.android.build.OutputFile.OutputType#MAIN} or {@link
|
||||
* com.android.build.OutputFile.OutputType#FULL_SPLIT}
|
||||
*/
|
||||
@NonNull
|
||||
OutputFile getMainOutputFile();
|
||||
|
||||
/**
|
||||
* All the output files for this artifacts, contains the main APK and optionally a list of split
|
||||
* APKs.
|
||||
*/
|
||||
@NonNull
|
||||
@Deprecated
|
||||
Collection<? extends OutputFile> getOutputs();
|
||||
|
||||
/**
|
||||
* Returns the version code for this output.
|
||||
*
|
||||
* <p>This is convenient method that returns the final version code whether it's coming from the
|
||||
* override set in the output or from the variant's merged flavor.
|
||||
*
|
||||
* @return the version code.
|
||||
*/
|
||||
int getVersionCode();
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
|
||||
/**
|
||||
* Options for aapt, but only those needed by the IDE.
|
||||
*/
|
||||
public interface AaptOptions {
|
||||
enum Namespacing {
|
||||
/**
|
||||
* Resources are not namespaced.
|
||||
*
|
||||
* <p>They are merged at the application level, as was the behavior with AAPT1
|
||||
*/
|
||||
DISABLED,
|
||||
/**
|
||||
* Resources must be namespaced.
|
||||
*
|
||||
* <p>Each library is compiled in to an AAPT2 static library with its own namespace.
|
||||
*
|
||||
* <p>Projects using this <em>cannot</em> consume non-namespaced dependencies.
|
||||
*/
|
||||
REQUIRED,
|
||||
// TODO: add more modes as implemented.
|
||||
}
|
||||
|
||||
/** Returns the resource namespacing strategy for this sub-project */
|
||||
@NonNull
|
||||
Namespacing getNamespacing();
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* Options for adb.
|
||||
*/
|
||||
interface AdbOptions {
|
||||
|
||||
/** The time out used for all adb operations. */
|
||||
val timeOutInMs: Int
|
||||
|
||||
/** The list of APK installation options. */
|
||||
val installOptions: Collection<String>?
|
||||
}
|
||||
-211
@@ -1,211 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* An Android Artifact.
|
||||
*
|
||||
* <p>This is the entry point for the output of a {@link Variant}. This can be more than one output
|
||||
* in the case of multi-apk where more than one APKs are generated from the same set of sources.
|
||||
*/
|
||||
public interface AndroidArtifact extends BaseArtifact {
|
||||
|
||||
/** @deprecated Use post-build model instead. See {@link VariantBuildInformation} */
|
||||
@Deprecated
|
||||
@NonNull
|
||||
Collection<AndroidArtifactOutput> getOutputs();
|
||||
|
||||
/**
|
||||
* Returns whether the output file is signed. This can only be true for the main apk of an
|
||||
* application project.
|
||||
*
|
||||
* @return true if the app is signed.
|
||||
*/
|
||||
boolean isSigned();
|
||||
|
||||
/**
|
||||
* Returns the name of the {@link SigningConfig} used for the signing. If none are setup or if
|
||||
* this is not the main artifact of an application project, then this is null.
|
||||
*
|
||||
* @return the name of the setup signing config.
|
||||
*/
|
||||
@Nullable
|
||||
String getSigningConfigName();
|
||||
|
||||
/**
|
||||
* Returns the application id of this artifact.
|
||||
*
|
||||
* <p>Deprecated as of 4.2. Application ID is now only provided post-build.
|
||||
*
|
||||
* @return the application id.
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
String getApplicationId();
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate the source code. The actual value might depend
|
||||
* on the build system front end.
|
||||
*
|
||||
* @return the name of the code generating task.
|
||||
*/
|
||||
@NonNull
|
||||
String getSourceGenTaskName();
|
||||
|
||||
/**
|
||||
* Returns all the source folders that are generated. This is typically folders for the R, the
|
||||
* aidl classes, and the renderscript classes.
|
||||
*
|
||||
* <p>Deprecated, as of 1.2, present in super interface.
|
||||
*
|
||||
* @return a list of folders.
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
Collection<File> getGeneratedSourceFolders();
|
||||
|
||||
/**
|
||||
* Returns all the resource folders that are generated. This is typically the renderscript
|
||||
* output and the merged resources.
|
||||
*
|
||||
* @return a list of folder.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getGeneratedResourceFolders();
|
||||
|
||||
/**
|
||||
* Returns the ABI filters associated with the artifact, or null if there are no filters.
|
||||
*
|
||||
* <p>If the list contains values, then the artifact only contains these ABIs and excludes
|
||||
* others.
|
||||
*/
|
||||
@Nullable
|
||||
Set<String> getAbiFilters();
|
||||
|
||||
/**
|
||||
* Returns the native libraries associated with the artifact.
|
||||
*
|
||||
* <p>Deprecated since ndk-compile has been deprecated.
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated
|
||||
Collection<NativeLibrary> getNativeLibraries();
|
||||
|
||||
/**
|
||||
* Map of generated res values where the key is the res name. This method is deprecated and will
|
||||
* always return an empty map
|
||||
*
|
||||
* @return empty map
|
||||
*/
|
||||
@NonNull
|
||||
@Deprecated
|
||||
Map<String, ClassField> getResValues();
|
||||
|
||||
/**
|
||||
* Returns the InstantRun feature related model.
|
||||
*
|
||||
* @return the model for all InstantRun related information.
|
||||
*/
|
||||
@NonNull
|
||||
InstantRun getInstantRun();
|
||||
|
||||
/**
|
||||
* Returns a list of additional APKs that need to installed on the device for this artifact to
|
||||
* work correctly.
|
||||
*
|
||||
* <p>For test artifacts, these will be "buddy APKs" from the {@code androidTestUtil}
|
||||
* configuration.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getAdditionalRuntimeApks();
|
||||
|
||||
/**
|
||||
* Returns the test options only if the variant type is testing.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
@Nullable
|
||||
TestOptions getTestOptions();
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to run instrumented tests or null if the variant is not a
|
||||
* test variant.
|
||||
*
|
||||
* @return name of the task used to run instrumented tests
|
||||
* @since 3.1
|
||||
*/
|
||||
@Nullable
|
||||
String getInstrumentedTestTaskName();
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate the bundle file (.aab), or null if the task is
|
||||
* not supported.
|
||||
*
|
||||
* @return name of the task used to generate the bundle file (.aab)
|
||||
* @since 3.2
|
||||
*/
|
||||
@Nullable
|
||||
String getBundleTaskName();
|
||||
|
||||
/**
|
||||
* Returns the path to the listing file generated after each {@link #getBundleTaskName()} task
|
||||
* execution. The listing file will contain a reference to the produced bundle file (.aab).
|
||||
* Returns null when {@link #getBundleTaskName()} returns null.
|
||||
*
|
||||
* @return the file path for the bundle model file.
|
||||
* @since 4.0
|
||||
*/
|
||||
@Nullable
|
||||
String getBundleTaskOutputListingFile();
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate APKs via the bundle file (.aab), or null if the
|
||||
* task is not supported.
|
||||
*
|
||||
* @return name of the task used to generate the APKs via the bundle
|
||||
* @since 3.2
|
||||
*/
|
||||
@Nullable
|
||||
String getApkFromBundleTaskName();
|
||||
|
||||
/**
|
||||
* Returns the path to the model file generated after each {@link #getApkFromBundleTaskName()}
|
||||
* task execution. The model will contain a reference to the folder where APKs from bundle are
|
||||
* placed into. Returns null when {@link #getApkFromBundleTaskName()} returns null.
|
||||
*
|
||||
* @return the file path for the {@link #getApkFromBundleTaskName()} output model.
|
||||
* @since 4.0
|
||||
*/
|
||||
@Nullable
|
||||
String getApkFromBundleTaskOutputListingFile();
|
||||
|
||||
/**
|
||||
* Returns the code shrinker used by this artifact or null if no shrinker is used to build this
|
||||
* artifact.
|
||||
*/
|
||||
@Nullable
|
||||
CodeShrinker getCodeShrinker();
|
||||
}
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.build.OutputFile;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* The Actual output for a {@link AndroidArtifact}, which can be one file at the minimum or several
|
||||
* APKs in case of pure splits configuration.
|
||||
*/
|
||||
public interface AndroidArtifactOutput extends OutputFile {
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate this artifact output.
|
||||
*
|
||||
* @return the name of the task.
|
||||
*/
|
||||
@NonNull
|
||||
@Deprecated
|
||||
String getAssembleTaskName();
|
||||
|
||||
/**
|
||||
* The generated manifest for this variant's artifact's output.
|
||||
*/
|
||||
@NonNull
|
||||
File getGeneratedManifest();
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents some of an {@link AndroidLibrary}.
|
||||
*
|
||||
* <p>The separation from AndroidLibrary is a historical artifact.
|
||||
*/
|
||||
public interface AndroidBundle extends Library {
|
||||
|
||||
/**
|
||||
* Returns an optional configuration name if the library is output by a module
|
||||
* that publishes more than one variant.
|
||||
*/
|
||||
@Nullable
|
||||
String getProjectVariant();
|
||||
|
||||
/**
|
||||
* Returns the location of the dependency bundle.
|
||||
*/
|
||||
@NonNull
|
||||
File getBundle();
|
||||
|
||||
/**
|
||||
* Returns the location of the unzipped AAR folder.
|
||||
*
|
||||
* @deprecated Users of this model are strongly encouraged to migrate to using the methods for
|
||||
* the individual artifacts within the AAR instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
File getFolder();
|
||||
|
||||
/**
|
||||
* Returns the list of direct library dependencies of this dependency.
|
||||
* The order is important.
|
||||
*/
|
||||
@NonNull
|
||||
List<? extends AndroidLibrary> getLibraryDependencies();
|
||||
|
||||
/**
|
||||
* Returns the collection of external Jar files that are included in the dependency.
|
||||
* @return a list of JavaDependency. May be empty but not null.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<? extends JavaLibrary> getJavaDependencies();
|
||||
|
||||
/**
|
||||
* Returns the location of the manifest.
|
||||
*/
|
||||
@NonNull
|
||||
File getManifest();
|
||||
|
||||
/**
|
||||
* Returns the location of the jar file to use for packaging.
|
||||
*
|
||||
* @return a File for the jar file. The file may not point to an existing file.
|
||||
* @see #getCompileJarFile()
|
||||
*/
|
||||
@NonNull
|
||||
File getJarFile();
|
||||
|
||||
/**
|
||||
* Returns the location of the jar file to use for compiling.
|
||||
*
|
||||
* @return a File for the jar file. The file may not point to an existing file.
|
||||
* @see #getJarFile()
|
||||
*/
|
||||
@NonNull
|
||||
File getCompileJarFile();
|
||||
|
||||
/**
|
||||
* Returns the location of the non-namespaced res folder.
|
||||
*
|
||||
* @return a File for the res folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
File getResFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the namespaced resources static library (res.apk).
|
||||
*
|
||||
* @return the static library apk. Does not exist if the library is not namespaced. May be null
|
||||
* in Android Gradle Plugin < 4.1.0, where namespace support is experimental anyway.
|
||||
*/
|
||||
@Nullable
|
||||
File getResStaticLibrary();
|
||||
|
||||
/**
|
||||
* Returns the location of the assets folder.
|
||||
*
|
||||
* @return a File for the assets folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
File getAssetsFolder();
|
||||
|
||||
}
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Represents various AGP project-wide flags.
|
||||
*
|
||||
* <p>This class is only for use in the Gradle tooling model. On the IDE side use {@code
|
||||
* IdeAndroidGradlePluginProjectFlags} which provides an interpreted view of the flags.
|
||||
*/
|
||||
public interface AndroidGradlePluginProjectFlags {
|
||||
/**
|
||||
* Boolean flags for behavior changes in AGP that Android Studio needs to know about.
|
||||
*
|
||||
* <p>Studio uses the legacy default for AGPs that do not specifiy that flag.
|
||||
*
|
||||
* <p>Flags <strong>must</strong> never be removed from here. This is to avoid issues when the
|
||||
* current version of studio fetches models from a project that has a legacy flag set. They can
|
||||
* be marked as {@code @Deprecated} and the getter removed from {@code
|
||||
* IdeAndroidGradlePluginProjectFlags}
|
||||
*/
|
||||
enum BooleanFlag {
|
||||
/**
|
||||
* Whether the R class in applications and dynamic features has constant IDs.
|
||||
*
|
||||
* <p>If they are constant they can be inlined by the java compiler and used in places that
|
||||
* require constants such as annotations and cases of switch statements.
|
||||
*/
|
||||
APPLICATION_R_CLASS_CONSTANT_IDS(true),
|
||||
/**
|
||||
* Whether the R class in instrumentation tests has constant IDs.
|
||||
*
|
||||
* <p>If they are constant they can be inlined by the java compiler and used in places that
|
||||
* require constants such as annotations and cases of switch statements.
|
||||
*/
|
||||
TEST_R_CLASS_CONSTANT_IDS(true),
|
||||
/**
|
||||
* Whether the R class generated for this project is transitive.
|
||||
*
|
||||
* <p>If it is transitive it will contain all of the resources defined in its transitive
|
||||
* dependencies alongside those defined in this project. If non-transitive it will only
|
||||
* contain the resources defined in this project.
|
||||
*/
|
||||
TRANSITIVE_R_CLASS(true),
|
||||
|
||||
/** Whether the jetpack Compose feature is enabled for this project. */
|
||||
JETPACK_COMPOSE(false),
|
||||
|
||||
/** Whether the ML model binding feature is enabled for this project. */
|
||||
ML_MODEL_BINDING(false),
|
||||
|
||||
/** Whether the Android Test Platform is enabled for this project. */
|
||||
UNIFIED_TEST_PLATFORM(false),
|
||||
;
|
||||
|
||||
private final boolean legacyDefault;
|
||||
|
||||
BooleanFlag(boolean legacyDefault) {
|
||||
this.legacyDefault = legacyDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
* The apparent value of this flag from Studio if it is not explicitly set in the AGP model.
|
||||
*
|
||||
* <p>As Studio can open projects from older Android Gradle Plugins this is used in {@code
|
||||
* IdeAndroidGradlePluginProjectFlags} to supply a value if it was not supplied by the build
|
||||
* system.
|
||||
*
|
||||
* <p>This could be used because:
|
||||
*
|
||||
* <ol>
|
||||
* <li>The AGP version used does not support this model at all.
|
||||
* <li>The AGP version used supports this model but predates the introduction of this
|
||||
* flag.
|
||||
* <li>The AGP version used supports this model and this flag but did not explicitly set a
|
||||
* value for it.
|
||||
* </ol>
|
||||
*/
|
||||
public boolean getLegacyDefault() {
|
||||
return legacyDefault;
|
||||
}
|
||||
}
|
||||
|
||||
Map<BooleanFlag, Boolean> getBooleanFlagMap();
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Represents an Android Library dependency, its content and its own dependencies.
|
||||
*/
|
||||
public interface AndroidLibrary extends AndroidBundle {
|
||||
|
||||
/**
|
||||
* Returns the list of local Jar files that are included in the dependency.
|
||||
*
|
||||
* @return a list of File. May be empty but not null.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getLocalJars();
|
||||
|
||||
/**
|
||||
* Returns the location of the jni libraries folder.
|
||||
*
|
||||
* @return a File for the folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
File getJniFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the aidl import folder.
|
||||
*
|
||||
* @return a File for the folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
File getAidlFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the renderscript import folder.
|
||||
*
|
||||
* @return a File for the folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
File getRenderscriptFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the proguard files.
|
||||
*
|
||||
* @return a File for the file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
File getProguardRules();
|
||||
|
||||
/**
|
||||
* Returns the location of the lint jar.
|
||||
*
|
||||
* @return a File for the jar file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
File getLintJar();
|
||||
|
||||
/**
|
||||
* Returns the location of the external annotations zip file (which may not exist)
|
||||
*
|
||||
* @return a File for the zip file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
File getExternalAnnotations();
|
||||
|
||||
/**
|
||||
* Returns the location of an optional file that lists the only
|
||||
* resources that should be considered public.
|
||||
*
|
||||
* @return a File for the file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
File getPublicResources();
|
||||
|
||||
/**
|
||||
* Returns the location of the text symbol file
|
||||
*/
|
||||
@NonNull
|
||||
File getSymbolFile();
|
||||
|
||||
/**
|
||||
* Returns whether the library is considered optional, meaning that it may or may not
|
||||
* be present in the final APK.
|
||||
*
|
||||
* If the library is optional, then:
|
||||
* - if the consumer is a library, it'll get skipped from resource merging and won't show up
|
||||
* in the consumer R.txt
|
||||
* - if the consumer is a separate test project, all the resources gets skipped from merging.
|
||||
*/
|
||||
@Override
|
||||
boolean isProvided();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #isProvided()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
boolean isOptional();
|
||||
|
||||
}
|
||||
-403
@@ -1,403 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Entry point for the model of the Android Projects. This models a single module, whether the
|
||||
* module is an app project, a library project, a Instant App feature project, an instantApp bundle
|
||||
* project, or a dynamic feature split project.
|
||||
*/
|
||||
public interface AndroidProject {
|
||||
// **************************************************************
|
||||
// **************************************************************
|
||||
// DO *NOT* ADD NEW VALUES HERE.
|
||||
// ADD VALUES TO InjectedProperties.kt only.
|
||||
//
|
||||
// Properties in this file are related to model v1 only.
|
||||
// **************************************************************
|
||||
// **************************************************************
|
||||
|
||||
// Injectable properties to use with -P
|
||||
// Sent by Studio 1.0 ONLY
|
||||
String PROPERTY_BUILD_MODEL_ONLY = "android.injected.build.model.only";
|
||||
// Sent by Studio 1.1+
|
||||
String PROPERTY_BUILD_MODEL_ONLY_ADVANCED = "android.injected.build.model.only.advanced";
|
||||
// Sent by Studio 2.4+. The value of the prop is a monotonically increasing integer.
|
||||
// see MODEL_LEVEL_* constants
|
||||
String PROPERTY_BUILD_MODEL_ONLY_VERSIONED = "android.injected.build.model.only.versioned";
|
||||
// Sent by Studio 2.4+. Additional model feature trigger on a case by case basis
|
||||
// Value is simply true to enable.
|
||||
String PROPERTY_BUILD_MODEL_FEATURE_FULL_DEPENDENCIES = "android.injected.build.model.feature.full.dependencies";
|
||||
/**
|
||||
* Was a property to disable source download during model sync, which is no longer done by AGP.
|
||||
*
|
||||
* @deprecated Only has effect in AGP 3.5. Android Studio 3.6 onwards downloads sources using an
|
||||
* injected gradle tooling model and model builder.
|
||||
*/
|
||||
@Deprecated
|
||||
String PROPERTY_BUILD_MODEL_DISABLE_SRC_DOWNLOAD =
|
||||
"android.injected.build.model.disable.src.download";
|
||||
|
||||
// Sent by Studio 2.2+ and Android Support plugin running with IDEA from 4.1+
|
||||
// This property will enable compatibility checks between Android Support plugin and the Android
|
||||
// Gradle plugin.
|
||||
// A use case for this property is that by restricting which versions are compatible
|
||||
// with the plugin, we could safely remove deprecated methods in the builder-model interfaces.
|
||||
String PROPERTY_ANDROID_SUPPORT_VERSION = "android.injected.studio.version";
|
||||
|
||||
// deprecated. Kept here so that newew Studio can still inject it for older plugin
|
||||
// but newer plugin don't do anything different based on this property.
|
||||
@SuppressWarnings("unused")
|
||||
String PROPERTY_GENERATE_SOURCES_ONLY = "android.injected.generateSourcesOnly";
|
||||
|
||||
String ARTIFACT_MAIN = "_main_";
|
||||
String ARTIFACT_ANDROID_TEST = "_android_test_";
|
||||
String ARTIFACT_UNIT_TEST = "_unit_test_";
|
||||
String ARTIFACT_TEST_FIXTURES = "_test_fixtures_";
|
||||
|
||||
int GENERATION_ORIGINAL = 1;
|
||||
int GENERATION_COMPONENT = 2; // component plugin is not supported since 3.5
|
||||
|
||||
int MODEL_LEVEL_0_ORIGINAL = 0 ; // studio 1.0, no support for SyncIssue
|
||||
int MODEL_LEVEL_1_SYNC_ISSUE = 1; // studio 1.1+, with SyncIssue
|
||||
//int MODEL_LEVEL_2_DONT_USE = 2; // Don't use this. Go level 1 to level 3 when ready.
|
||||
int MODEL_LEVEL_3_VARIANT_OUTPUT_POST_BUILD =
|
||||
3; // Model for 3.0 with no variant output in import sync model.
|
||||
int MODEL_LEVEL_4_NEW_DEP_MODEL = 4;
|
||||
int MODEL_LEVEL_LATEST = MODEL_LEVEL_4_NEW_DEP_MODEL;
|
||||
|
||||
/**
|
||||
* Returns the model version. This is a string in the format X.Y.Z
|
||||
*
|
||||
* @return a string containing the model version.
|
||||
*/
|
||||
@NonNull
|
||||
String getModelVersion();
|
||||
|
||||
/**
|
||||
* Returns the model api version.
|
||||
* <p>
|
||||
* This is different from {@link #getModelVersion()} in a way that new model
|
||||
* version might increment model version but keep existing api. That means that
|
||||
* code which was built against particular 'api version' might be safely re-used for all
|
||||
* new model versions as long as they don't change the api.
|
||||
* <p>
|
||||
* Every new model version is assumed to return an 'api version' value which
|
||||
* is equal or greater than the value used by the previous model version.
|
||||
*
|
||||
* @return model's api version
|
||||
*/
|
||||
int getApiVersion();
|
||||
|
||||
/**
|
||||
* Returns the name of the module.
|
||||
*
|
||||
* @return the name of the module.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns whether this is a library.
|
||||
* @return true for a library module.
|
||||
* @deprecated use {@link #getProjectType()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
boolean isLibrary();
|
||||
|
||||
/**
|
||||
* Returns the type of project: Android application, library, feature, instantApp.
|
||||
*
|
||||
* @return the type of project.
|
||||
* @since 2.3
|
||||
*/
|
||||
int getProjectType();
|
||||
|
||||
/**
|
||||
* Returns the optional group-id of the artifact represented by this project.
|
||||
*
|
||||
* @since 3.6
|
||||
*/
|
||||
@Nullable
|
||||
String getGroupId();
|
||||
|
||||
/**
|
||||
* Returns the namespace of the main artifact.
|
||||
*
|
||||
* <p>This is here rather than on {@link AndroidArtifact} because this is common to all
|
||||
* artifacts as it cannot be changed per variants.
|
||||
*/
|
||||
@NonNull
|
||||
String getNamespace();
|
||||
|
||||
/**
|
||||
* Returns the namespace of the AndroidTest artifact.
|
||||
*
|
||||
* <p>This is here rather than on {@link AndroidArtifact} because this is common to all
|
||||
* artifacts as it cannot be changed per variants.
|
||||
*
|
||||
* <p>If there are no AndroidTest components, this returns null.
|
||||
*/
|
||||
@Nullable
|
||||
String getAndroidTestNamespace();
|
||||
|
||||
/**
|
||||
* Returns the {@link ProductFlavorContainer} for the 'main' default config.
|
||||
*
|
||||
* @return the product flavor.
|
||||
*/
|
||||
@NonNull
|
||||
ProductFlavorContainer getDefaultConfig();
|
||||
|
||||
/**
|
||||
* Returns a list of all the {@link BuildType} in their container.
|
||||
*
|
||||
* @return a list of build type containers.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<BuildTypeContainer> getBuildTypes();
|
||||
|
||||
/**
|
||||
* Returns a list of all the {@link ProductFlavor} in their container.
|
||||
*
|
||||
* @return a list of product flavor containers.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<ProductFlavorContainer> getProductFlavors();
|
||||
|
||||
/**
|
||||
* Returns a list of all the variants.
|
||||
*
|
||||
* This does not include test variant. Test variants are additional artifacts in their
|
||||
* respective variant info.
|
||||
*
|
||||
* @return a list of the variants.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<Variant> getVariants();
|
||||
|
||||
/**
|
||||
* Returns a list of all the variant names.
|
||||
*
|
||||
* <p>This does not include test variant. Test variants are additional artifacts in their
|
||||
* respective variant info.
|
||||
*
|
||||
* @return a list of all the variant names.
|
||||
* @since 3.2.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<String> getVariantNames();
|
||||
|
||||
/**
|
||||
* Returns the name of the variant the IDE should use when opening the project for the first
|
||||
* time.
|
||||
*
|
||||
* @return the name of a variant that exists under the presence of the variant filter. Only
|
||||
* returns null if all variants are removed.
|
||||
* @since 3.5
|
||||
*/
|
||||
@Nullable
|
||||
String getDefaultVariant();
|
||||
|
||||
/**
|
||||
* Returns a list of all the flavor dimensions, may be empty.
|
||||
*
|
||||
* @return a list of the flavor dimensions.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<String> getFlavorDimensions();
|
||||
|
||||
/**
|
||||
* Returns a list of extra artifacts meta data. This does not include the main artifact.
|
||||
*
|
||||
* @return a list of extra artifacts
|
||||
*/
|
||||
@NonNull
|
||||
Collection<ArtifactMetaData> getExtraArtifacts();
|
||||
|
||||
/**
|
||||
* Returns the compilation target as a string. This is the full extended target hash string.
|
||||
* (see com.android.sdklib.IAndroidTarget#hashString())
|
||||
*
|
||||
* @return the target hash string
|
||||
*/
|
||||
@NonNull
|
||||
String getCompileTarget();
|
||||
|
||||
/**
|
||||
* Returns the boot classpath matching the compile target. This is typically android.jar plus
|
||||
* other optional libraries.
|
||||
*
|
||||
* @return a list of jar files.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<String> getBootClasspath();
|
||||
|
||||
/**
|
||||
* Returns a list of folders or jar files that contains the framework source code.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getFrameworkSources();
|
||||
|
||||
/**
|
||||
* Returns the collection of toolchains used to create any native libraries.
|
||||
*
|
||||
* @return collection of toolchains.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<NativeToolchain> getNativeToolchains();
|
||||
|
||||
/**
|
||||
* Returns a list of {@link SigningConfig}.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<SigningConfig> getSigningConfigs();
|
||||
|
||||
/**
|
||||
* Returns the aapt options.
|
||||
*/
|
||||
@NonNull
|
||||
AaptOptions getAaptOptions();
|
||||
|
||||
/**
|
||||
* Returns the lint options.
|
||||
*/
|
||||
@NonNull
|
||||
LintOptions getLintOptions();
|
||||
|
||||
/**
|
||||
* Returns the dependencies that were not successfully resolved. The returned list gets
|
||||
* populated only if the system property {@link #PROPERTY_BUILD_MODEL_ONLY} has been
|
||||
* set to {@code true}.
|
||||
* <p>
|
||||
* Each value of the collection has the format group:name:version, for example:
|
||||
* com.google.guava:guava:15.0.2
|
||||
*
|
||||
* @return the dependencies that were not successfully resolved.
|
||||
* @deprecated use {@link #getSyncIssues()}
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
Collection<String> getUnresolvedDependencies();
|
||||
|
||||
/**
|
||||
* Returns issues found during sync. The returned list gets
|
||||
* populated only if the system property {@link #PROPERTY_BUILD_MODEL_ONLY} has been
|
||||
* set to {@code true}.
|
||||
*
|
||||
* @deprecated request {@link ProjectSyncIssues} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
Collection<SyncIssue> getSyncIssues();
|
||||
|
||||
/**
|
||||
* Returns the compile options for Java code.
|
||||
*/
|
||||
@NonNull
|
||||
JavaCompileOptions getJavaCompileOptions();
|
||||
|
||||
/**
|
||||
* Returns the build folder of this project.
|
||||
*/
|
||||
@NonNull
|
||||
File getBuildFolder();
|
||||
|
||||
/**
|
||||
* Returns the resource prefix to use, if any. This is an optional prefix which can
|
||||
* be set and which is used by the defaults to automatically choose new resources
|
||||
* with a certain prefix, warn if resources are not using the given prefix, etc.
|
||||
* This helps work with resources in the app namespace where there could otherwise
|
||||
* be unintentional duplicated resource names between unrelated libraries.
|
||||
*
|
||||
* @return the optional resource prefix, or null if not set
|
||||
*/
|
||||
@Nullable
|
||||
String getResourcePrefix();
|
||||
|
||||
/**
|
||||
* Returns the build tools version used by this module.
|
||||
* @return the build tools version.
|
||||
*/
|
||||
@NonNull
|
||||
String getBuildToolsVersion();
|
||||
|
||||
/**
|
||||
* Returns the NDK version used by this module.
|
||||
*
|
||||
* @return the NDK version.
|
||||
*/
|
||||
@Nullable
|
||||
String getNdkVersion();
|
||||
|
||||
/**
|
||||
* Returns the generation of the plugin.
|
||||
*
|
||||
* <p>1 is original plugin, 2 is component based plugin (AKA experimental, not used anymore)
|
||||
*
|
||||
* @return the generation value
|
||||
*/
|
||||
int getPluginGeneration();
|
||||
|
||||
/**
|
||||
* Returns true if this is the base feature split.
|
||||
*
|
||||
* @return true if this is the base feature split
|
||||
* @since 2.4
|
||||
*/
|
||||
boolean isBaseSplit();
|
||||
|
||||
/**
|
||||
* Returns the list of dynamic features.
|
||||
*
|
||||
* <p>The values are Gradle path. Only valid for base splits.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@NonNull
|
||||
Collection<String> getDynamicFeatures();
|
||||
|
||||
/** Returns the options for view binding. */
|
||||
@NonNull
|
||||
ViewBindingOptions getViewBindingOptions();
|
||||
|
||||
@Nullable
|
||||
DependenciesInfo getDependenciesInfo();
|
||||
|
||||
/** Returns the AGP flags for this project. */
|
||||
@NonNull
|
||||
AndroidGradlePluginProjectFlags getFlags();
|
||||
|
||||
/**
|
||||
* Returns the minimal information of variants for this project, excluding test related
|
||||
* variants.
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
@NonNull
|
||||
Collection<VariantBuildInformation> getVariantsBuildInformation();
|
||||
|
||||
/** Returns the lint jars that this module uses to run extra lint checks */
|
||||
@NonNull
|
||||
List<File> getLintRuleJars();
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Represents the version of an Android Platform.
|
||||
*
|
||||
* A version is defined by an API level and an optional code name.
|
||||
*
|
||||
* Release versions of the Android platform are identified by their API level (integer),
|
||||
* (technically the code name for release version is "REL" but this class will return
|
||||
* <code>null</code> instead.)
|
||||
*
|
||||
* Preview versions of the platform are identified by a code name. Their API level
|
||||
* is usually set to the value of the previous platform.
|
||||
*/
|
||||
public interface ApiVersion {
|
||||
|
||||
/**
|
||||
* Returns the api level as an integer.
|
||||
* <p>For target that are in preview mode, this can be superseded by
|
||||
* {@link #getCodename()}.
|
||||
*
|
||||
* @see #getCodename()
|
||||
*/
|
||||
int getApiLevel();
|
||||
|
||||
/**
|
||||
* Returns the version code name if applicable, null otherwise.
|
||||
* <p>If the codename is non null, then the API level should be ignored, and this should be
|
||||
* used as a unique identifier of the target instead.
|
||||
*/
|
||||
@Nullable
|
||||
String getCodename();
|
||||
|
||||
/**
|
||||
* Returns the API value as a string.
|
||||
*
|
||||
* If there's a codename, this returns it, otherwise this returns the string version
|
||||
* of the integer api level.
|
||||
* @return a String.
|
||||
*/
|
||||
@NonNull
|
||||
String getApiString();
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Project output for the bundle file of an app. */
|
||||
public interface AppBundleProjectBuildOutput {
|
||||
|
||||
@NonNull
|
||||
Collection<AppBundleVariantBuildOutput> getAppBundleVariantsBuildOutput();
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
|
||||
/** Model that represents the variant build output of a bundle file. */
|
||||
public interface AppBundleVariantBuildOutput {
|
||||
|
||||
/**
|
||||
* Variant full name.
|
||||
*
|
||||
* @return a {@link String} representing this variant's name.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the bundle file output (.aab file).
|
||||
*
|
||||
* @return the output file for this variant.
|
||||
*/
|
||||
@NonNull
|
||||
File getBundleFile();
|
||||
|
||||
/**
|
||||
* Returns the location of the generated APK(s) from the bundle.
|
||||
*
|
||||
* <p>The location is always returned but it may not have been generated if the build request
|
||||
* only built the bundle.
|
||||
*
|
||||
* @return the folder containing the APKs.
|
||||
*/
|
||||
@NonNull
|
||||
File getApkFolder();
|
||||
}
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
|
||||
/**
|
||||
* Meta Data for an Artifact.
|
||||
*/
|
||||
public interface ArtifactMetaData {
|
||||
|
||||
int TYPE_ANDROID = 1;
|
||||
int TYPE_JAVA = 2;
|
||||
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
boolean isTest();
|
||||
|
||||
int getType();
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import com.android.builder.model.level2.DependencyGraphs;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* The base information for all generated artifacts
|
||||
*/
|
||||
public interface BaseArtifact {
|
||||
|
||||
/**
|
||||
* Name of the artifact. This should match {@link ArtifactMetaData#getName()}.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return the name of the task used to compile the code.
|
||||
*/
|
||||
@NonNull
|
||||
String getCompileTaskName();
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate the artifact output(s).
|
||||
*
|
||||
* @return the name of the task.
|
||||
*/
|
||||
@NonNull
|
||||
String getAssembleTaskName();
|
||||
|
||||
/**
|
||||
* Returns the absolute path for the listing file that will get updated after each build. The
|
||||
* model file will contain deployment related information like applicationId, list of APKs.
|
||||
*
|
||||
* @return the path to a json file.
|
||||
*/
|
||||
@NonNull
|
||||
String getAssembleTaskOutputListingFile();
|
||||
|
||||
/**
|
||||
* Returns the folder containing the class files. This is the output of the java compilation.
|
||||
*
|
||||
* @return a folder.
|
||||
*/
|
||||
@NonNull
|
||||
File getClassesFolder();
|
||||
|
||||
/**
|
||||
* Folders or jars containing additional classes (e.g., R.jar or those registered by third-party
|
||||
* plugins like Kotlin).
|
||||
*/
|
||||
@NonNull
|
||||
Set<File> getAdditionalClassesFolders();
|
||||
|
||||
/**
|
||||
* Returns the folder containing resource files that classes form this artifact expect to find
|
||||
* on the classpath.
|
||||
*/
|
||||
@NonNull
|
||||
File getJavaResourcesFolder();
|
||||
|
||||
/**
|
||||
* Return the level 0-1 type dependencies
|
||||
*/
|
||||
@NonNull
|
||||
Dependencies getDependencies();
|
||||
|
||||
/**
|
||||
* Return the level 0-1 type dependencies.
|
||||
* @deprecated use {@link #getDependencies()}
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
Dependencies getCompileDependencies();
|
||||
|
||||
/**
|
||||
* Returns the resolved dependencies for this artifact.
|
||||
*
|
||||
* This is a composite of all the
|
||||
* dependencies for that artifact: default config + build type + flavor(s).
|
||||
*
|
||||
* @return The dependencies.
|
||||
*/
|
||||
@NonNull
|
||||
DependencyGraphs getDependencyGraphs();
|
||||
|
||||
/**
|
||||
* A SourceProvider specific to the variant. This can be null if there is no flavors as
|
||||
* the "variant" is equal to the build type.
|
||||
*
|
||||
* @return the variant specific source provider
|
||||
*/
|
||||
@Nullable
|
||||
SourceProvider getVariantSourceProvider();
|
||||
|
||||
/**
|
||||
* A SourceProvider specific to the flavor combination.
|
||||
*
|
||||
* For instance if there are 2 dimensions, then this would be Flavor1Flavor2, and would be
|
||||
* common to all variant using these two flavors and any of the build type.
|
||||
*
|
||||
* This can be null if there is less than 2 flavors.
|
||||
*
|
||||
* @return the multi flavor specific source provider
|
||||
*/
|
||||
@Nullable
|
||||
SourceProvider getMultiFlavorSourceProvider();
|
||||
|
||||
/**
|
||||
* Returns names of tasks that need to be run when setting up the IDE project. After these
|
||||
* tasks have run, all the generated source files etc. that the IDE needs to know about should
|
||||
* be in place.
|
||||
*/
|
||||
@NonNull
|
||||
Set<String> getIdeSetupTaskNames();
|
||||
|
||||
/**
|
||||
* Returns all the source folders that are generated. This is typically folders for the R,
|
||||
* the aidl classes, and the renderscript classes.
|
||||
*
|
||||
* @return a list of folders.
|
||||
* @since 1.2
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getGeneratedSourceFolders();
|
||||
}
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.build.OutputFile;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Base model to represents a variant or a test variant build output. */
|
||||
@Deprecated
|
||||
public interface BaseBuildOutput {
|
||||
|
||||
/**
|
||||
* Variant full name.
|
||||
*
|
||||
* @return a {@link String} representing this variant's name.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the collection of build output for this Variant.
|
||||
*
|
||||
* @return a possibly empty {@link Collection} of {@link AndroidArtifactOutput} for each output
|
||||
* file from this variant.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<OutputFile> getOutputs();
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Base config object for Build Type and Product flavor.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*/
|
||||
interface BaseConfig: Named {
|
||||
override fun getName(): String
|
||||
/**
|
||||
* The application id suffix applied to this base config.
|
||||
* To get the final application id, use [AndroidArtifact.getApplicationId].
|
||||
*/
|
||||
val applicationIdSuffix: String?
|
||||
|
||||
/**
|
||||
* The version name suffix of this flavor or null if none have been set.
|
||||
* This is only the value set on this product flavor, not necessarily the actual
|
||||
* version name suffix used.
|
||||
*/
|
||||
val versionNameSuffix: String?
|
||||
|
||||
/**
|
||||
* Map of Build Config Fields where the key is the field name.
|
||||
*/
|
||||
val buildConfigFields: Map<String, ClassField>
|
||||
|
||||
/**
|
||||
* Map of generated res values where the key is the res "type/name".
|
||||
*/
|
||||
val resValues: Map<String, ClassField>
|
||||
|
||||
/**
|
||||
* Specifies the ProGuard configuration files that the plugin should use.
|
||||
*
|
||||
* There are two ProGuard rules files that ship with the Android plugin and are used by
|
||||
* default:
|
||||
*
|
||||
* * proguard-android.txt
|
||||
* * proguard-android-optimize.txt
|
||||
*
|
||||
* `proguard-android-optimize.txt` is identical to `proguard-android.txt`,
|
||||
* except with optimizations enabled. You can use [getDefaultProguardFile(String)]
|
||||
* to return the full path of the files.
|
||||
*
|
||||
* @return a non-null collection of files.
|
||||
* @see .getTestProguardFiles
|
||||
*/
|
||||
val proguardFiles: Collection<File>
|
||||
|
||||
/** The collection of proguard rule files for consumers of the library to use. */
|
||||
val consumerProguardFiles: Collection<File>
|
||||
|
||||
/** The collection of proguard rule files to use for the test APK. */
|
||||
val testProguardFiles: Collection<File>
|
||||
|
||||
/**
|
||||
* The map of key value pairs for placeholder substitution in the android manifest file.
|
||||
*
|
||||
* This map will be used by the manifest merger.
|
||||
*/
|
||||
val manifestPlaceholders: Map<String, Any>
|
||||
|
||||
/**
|
||||
* Returns whether multi-dex is enabled.
|
||||
*
|
||||
* This can be null if the flag is not set, in which case the default value is used.
|
||||
*/
|
||||
val multiDexEnabled: Boolean?
|
||||
|
||||
val multiDexKeepFile: File?
|
||||
val multiDexKeepProguard: File?
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* a Build Type. This is only the configuration of the build type.
|
||||
*
|
||||
* It does not include the sources or the dependencies. Those are available on the container
|
||||
* or in the artifact info.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*
|
||||
* @see BuildTypeContainer
|
||||
* @see AndroidArtifact.getDependencies
|
||||
*/
|
||||
interface BuildType : BaseConfig {
|
||||
/** The name of the build type.*/
|
||||
override fun getName(): String
|
||||
|
||||
/** Whether the build type is configured to generate a debuggable apk. */
|
||||
val isDebuggable: Boolean
|
||||
|
||||
/** Whether the build type is configured to be build with support for code coverage. */
|
||||
val isTestCoverageEnabled: Boolean
|
||||
|
||||
/** Whether the build type is configured to be build with support for pseudolocales. */
|
||||
val isPseudoLocalesEnabled: Boolean
|
||||
|
||||
/** Whether the build type is configured to generate an apk with debuggable native code. */
|
||||
val isJniDebuggable: Boolean
|
||||
|
||||
/** Whether the build type is configured to generate an apk with debuggable renderscript code. */
|
||||
val isRenderscriptDebuggable: Boolean
|
||||
|
||||
/** The optimization level of the renderscript compilation. */
|
||||
val renderscriptOptimLevel: Int
|
||||
|
||||
/**
|
||||
* Specifies whether to enable code shrinking for this build type.
|
||||
*
|
||||
* By default, when you enable code shrinking by setting this property to `true`,
|
||||
* the Android plugin uses ProGuard.
|
||||
*
|
||||
* To learn more, read
|
||||
* [Shrink Your Code and Resources](https://developer.android.com/studio/build/shrink-code.html).
|
||||
*/
|
||||
val isMinifyEnabled: Boolean
|
||||
|
||||
/** Whether zipalign is enabled for this build type. */
|
||||
@Deprecated("This property is deprecated.")
|
||||
val isZipAlignEnabled: Boolean
|
||||
|
||||
/**Whether the variant embeds the micro app. */
|
||||
val isEmbedMicroApp: Boolean
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A Container of all the data related to {@link BuildType}.
|
||||
*/
|
||||
public interface BuildTypeContainer {
|
||||
|
||||
/**
|
||||
* The Build Type itself.
|
||||
*
|
||||
* @return the build type
|
||||
*/
|
||||
@NonNull
|
||||
BuildType getBuildType();
|
||||
|
||||
/**
|
||||
* The associated sources of the build type.
|
||||
*
|
||||
* @return the build type source provider.
|
||||
*/
|
||||
@Nullable
|
||||
SourceProvider getSourceProvider();
|
||||
|
||||
/**
|
||||
* Returns a list of ArtifactMetaData/SourceProvider association.
|
||||
*
|
||||
* @return a list of ArtifactMetaData/SourceProvider association.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<SourceProviderContainer> getExtraSourceProviders();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* A Simple class field with name, type and value, all as strings.
|
||||
*/
|
||||
public interface ClassField {
|
||||
@NonNull
|
||||
String getType();
|
||||
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
@NonNull
|
||||
String getValue();
|
||||
|
||||
@NonNull
|
||||
String getDocumentation();
|
||||
|
||||
@NonNull
|
||||
Set<String> getAnnotations();
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
public enum CodeShrinker {
|
||||
PROGUARD,
|
||||
R8,
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* Options for data binding
|
||||
*/
|
||||
interface DataBindingOptions {
|
||||
|
||||
/**
|
||||
* The version of data binding to use.
|
||||
*/
|
||||
val version: String?
|
||||
|
||||
/**
|
||||
* Whether to enable data binding.
|
||||
*
|
||||
* @deprecated use android.features.databinding
|
||||
*/
|
||||
@Deprecated("use android.features.databinding")
|
||||
val isEnabled: Boolean
|
||||
|
||||
/** Whether to add the default data binding adapters. */
|
||||
val addDefaultAdapters: Boolean
|
||||
/**
|
||||
* Whether we want tests to be able to use data binding as well.
|
||||
* <p>
|
||||
* Data Binding classes generated from the application can always be accessed in the test code
|
||||
* but test itself cannot introduce new Data Binding layouts, bindables etc unless this flag
|
||||
* is turned on.
|
||||
* <p>
|
||||
* This settings help with an issue in older devices where class verifier throws an exception
|
||||
* when the application class is overwritten by the test class. It also makes it easier to run
|
||||
* proguarded tests.
|
||||
*/
|
||||
val isEnabledForTests: Boolean
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A set of dependencies for an {@link AndroidArtifact}.
|
||||
*/
|
||||
public interface Dependencies {
|
||||
|
||||
/**
|
||||
* The list of Android library dependencies.
|
||||
*
|
||||
* <p>On versions < 3.0, the list contains direct dependencies only, which themselves contain
|
||||
* their transitive dependencies. Starting with version 3.0, the list is flattened and contains
|
||||
* all the transitive dependencies.
|
||||
*
|
||||
* <p>This includes both modules and external dependencies. They can be differentiated with
|
||||
* {@link Library#getProject()}.
|
||||
*
|
||||
* @return the list of libraries.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<AndroidLibrary> getLibraries();
|
||||
|
||||
/**
|
||||
* The list of Java library dependencies.
|
||||
*
|
||||
* <p>This is a flattened list containing all transitive external dependencies.
|
||||
*
|
||||
* @return the list of Java library dependencies.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<JavaLibrary> getJavaLibraries();
|
||||
|
||||
/**
|
||||
* The list of project dependencies. This is only for non Android module dependencies (which
|
||||
* right now is Java-only modules).
|
||||
*
|
||||
* <p>IMPORTANT: This is not compatible with Composite Builds. This should not be used anymore
|
||||
* starting with version 3.1. This is now superseded by {@link #getJavaModules()}.
|
||||
*
|
||||
* @return the list of projects.
|
||||
* @see #getJavaLibraries()
|
||||
* @see #getJavaModules()
|
||||
*/
|
||||
@NonNull
|
||||
@Deprecated
|
||||
Collection<String> getProjects();
|
||||
|
||||
/** ' A Unique identifier for a project. */
|
||||
interface ProjectIdentifier {
|
||||
/** The build id. This is typically the root dir of the build */
|
||||
@NonNull
|
||||
String getBuildId();
|
||||
|
||||
/** The project path. This is unique for a given build, but not across builds. */
|
||||
@NonNull
|
||||
String getProjectPath();
|
||||
}
|
||||
|
||||
/** Returns the list of Java Modules. @Since 3.1 */
|
||||
@NonNull
|
||||
Collection<ProjectIdentifier> getJavaModules();
|
||||
|
||||
/** Returns the list of runtime only dependency classes. @Since 3.5 */
|
||||
@NonNull
|
||||
Collection<File> getRuntimeOnlyClasses();
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* tooling model representation of resolved dependenciesInfo from the DSL
|
||||
* @see `com.android.build.api.dsl.DependenciesInfo`
|
||||
*/
|
||||
interface DependenciesInfo {
|
||||
val includeInApk: Boolean
|
||||
val includeInBundle: Boolean
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* Interface for objects has a dimension.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*/
|
||||
interface DimensionAware {
|
||||
/**
|
||||
* Specifies the flavor dimension that this product flavor belongs to.
|
||||
*
|
||||
*
|
||||
* When configuring product flavors with Android plugin 3.0.0 and higher, you must specify at
|
||||
* least one flavor dimension, using the `flavorDimensions` property, and then assign each
|
||||
* flavor to a dimension.
|
||||
* Otherwise, you will get the following build error:
|
||||
*
|
||||
* ```
|
||||
* Error:All flavors must now belong to a named flavor dimension.
|
||||
* The flavor 'flavor_name' is not assigned to a flavor dimension.
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* By default, when you specify only one dimension, all flavors you configure automatically
|
||||
* belong to that dimension. If you specify more than one dimension, you need to manually assign
|
||||
* each flavor to a dimension, as shown in the sample below:
|
||||
*
|
||||
* ```
|
||||
* android {
|
||||
* ...
|
||||
* // Specifies the flavor dimensions you want to use. The order in which you
|
||||
* // list each dimension determines its priority, from highest to lowest,
|
||||
* // when Gradle merges variant sources and configurations. You must assign
|
||||
* // each product flavor you configure to one of the flavor dimensions.
|
||||
* flavorDimensions 'api', 'version'
|
||||
*
|
||||
* productFlavors {
|
||||
* demo {
|
||||
* // Assigns this product flavor to the 'version' flavor dimension.
|
||||
* dimension 'version'
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* full {
|
||||
* dimension 'version'
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* minApi24 {
|
||||
* // Assigns this flavor to the 'api' dimension.
|
||||
* dimension 'api'
|
||||
* minSdkVersion '24'
|
||||
* versionNameSuffix "-minApi24"
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* minApi21 {
|
||||
* dimension "api"
|
||||
* minSdkVersion '21'
|
||||
* versionNameSuffix "-minApi21"
|
||||
* ...
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* To learn more about configuring flavor dimensions, read
|
||||
* [Combine multiple flavors](https://developer.android.com/studio/build/build-variants.html#flavor-dimensions).
|
||||
*/
|
||||
val dimension: String?
|
||||
}
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("InjectedProperties")
|
||||
package com.android.builder.model
|
||||
|
||||
// ------------------
|
||||
// PROPERTIES FOR SYNC INVOCATIONS
|
||||
// ------------------
|
||||
|
||||
// Injectable properties to use with -P
|
||||
// Sent by Studio 4.2+
|
||||
const val PROPERTY_BUILD_MODEL_V2_ONLY = "android.injected.build.model.v2"
|
||||
|
||||
// Sent in when external native projects models requires a refresh.
|
||||
const val PROPERTY_REFRESH_EXTERNAL_NATIVE_MODEL =
|
||||
"android.injected.refresh.external.native.model"
|
||||
|
||||
// ------------------
|
||||
// PROPERTIES FOR BUILD INVOCATIONS FROM IDE
|
||||
// ------------------
|
||||
|
||||
// Has the effect of telling the Gradle plugin to
|
||||
// 1) Generate machine-readable errors
|
||||
// 2) Generate build metadata JSON files
|
||||
const val PROPERTY_INVOKED_FROM_IDE = "android.injected.invoked.from.ide"
|
||||
|
||||
// Sent by Studio 2.2+
|
||||
// This property is sent when a run or debug is invoked. APK built with this property should
|
||||
// be marked with android:testOnly="true" in the AndroidManifest.xml such that it will be
|
||||
// rejected by the Play store.
|
||||
const val PROPERTY_TEST_ONLY = "android.injected.testOnly"
|
||||
|
||||
/** Absolute path to the Build Analyzer data file */
|
||||
const val PROPERTY_ATTRIBUTION_FILE_LOCATION = "android.injected.attribution.file.location"
|
||||
|
||||
/** Absolute path to a file containing the result of the `CheckJetifier` task. */
|
||||
const val PROPERTY_CHECK_JETIFIER_RESULT_FILE = "android.injected.checkJetifier.resultFile"
|
||||
|
||||
/** Logging level of native build output. Possible values are "quiet" and "verbose". */
|
||||
const val PROPERTY_NATIVE_BUILD_OUTPUT_LEVEL = "android.native.buildOutput"
|
||||
|
||||
const val PROPERTY_BUILD_WITH_STABLE_IDS = "android.injected.enableStableIds"
|
||||
|
||||
// ------------------
|
||||
// PROPERTIES FOR OPTIMIZED BUILDS
|
||||
// ------------------
|
||||
// Sent by Studio 1.5+
|
||||
// The version api level of the target device.
|
||||
const val PROPERTY_BUILD_API = "android.injected.build.api"
|
||||
|
||||
// The version codename of the target device. Null for released versions,
|
||||
const val PROPERTY_BUILD_API_CODENAME = "android.injected.build.codename"
|
||||
const val PROPERTY_BUILD_ABI = "android.injected.build.abi"
|
||||
const val PROPERTY_BUILD_DENSITY = "android.injected.build.density"
|
||||
|
||||
// ------------------
|
||||
// PROPERTIES FOR RELEASE BUILDS FROM IDE
|
||||
// ------------------
|
||||
const val PROPERTY_SIGNING_STORE_FILE = "android.injected.signing.store.file"
|
||||
const val PROPERTY_SIGNING_STORE_PASSWORD =
|
||||
"android.injected.signing.store.password"
|
||||
const val PROPERTY_SIGNING_KEY_ALIAS = "android.injected.signing.key.alias"
|
||||
const val PROPERTY_SIGNING_KEY_PASSWORD = "android.injected.signing.key.password"
|
||||
const val PROPERTY_SIGNING_STORE_TYPE = "android.injected.signing.store.type"
|
||||
const val PROPERTY_SIGNING_V1_ENABLED = "android.injected.signing.v1-enabled"
|
||||
const val PROPERTY_SIGNING_V2_ENABLED = "android.injected.signing.v2-enabled"
|
||||
/**
|
||||
* Location for APKs. If defined as a relative path, then it is resolved against the
|
||||
* project's path.
|
||||
*/
|
||||
const val PROPERTY_APK_LOCATION = "android.injected.apk.location"
|
||||
|
||||
// ------------------
|
||||
// PROPERTIES FOR DEPLOYMENTS FROM THE IDE
|
||||
// ------------------
|
||||
const val PROPERTY_DEPLOY_AS_INSTANT_APP = "android.injected.deploy.instant-app"
|
||||
const val PROPERTY_APK_SELECT_CONFIG = "android.inject.apkselect.config"
|
||||
const val PROPERTY_EXTRACT_INSTANT_APK = "android.inject.bundle.extractinstant"
|
||||
|
||||
/**
|
||||
* Comma separated list of on-demand dynamic modules or instant app modules names that are
|
||||
* selected by the user for installation on the device during deployment.
|
||||
*/
|
||||
const val PROPERTY_INJECTED_DYNAMIC_MODULES_LIST = "android.injected.modules.install.list"
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Minimal model for an instant app project output. */
|
||||
public interface InstantAppProjectBuildOutput {
|
||||
|
||||
/**
|
||||
* Returns a collection of {@link InstantAppVariantBuildOutput} identifying all the variants for
|
||||
* this project.
|
||||
*
|
||||
* @return a list of {@link InstantAppVariantBuildOutput} per variant.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<InstantAppVariantBuildOutput> getInstantAppVariantsBuildOutput();
|
||||
}
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.build.OutputFile;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Model that represents an instant app variant build output. */
|
||||
public interface InstantAppVariantBuildOutput {
|
||||
|
||||
/**
|
||||
* Variant full name.
|
||||
*
|
||||
* @return a {@link String} representing this variant's name.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* The applicationId for this Variant.
|
||||
*
|
||||
* @return A {@link String} representing this variant's applicationId.
|
||||
*/
|
||||
@NonNull
|
||||
String getApplicationId();
|
||||
|
||||
/**
|
||||
* Returns the build output for this Variant.
|
||||
*
|
||||
* @return a {@link OutputFile} for the output file for this variant.
|
||||
*/
|
||||
@NonNull
|
||||
OutputFile getOutput();
|
||||
|
||||
/**
|
||||
* Returns the collection of feature outputs for this Variant.
|
||||
*
|
||||
* @return a possibly empty {@link Collection} of {@link OutputFile} for each of the APK feature
|
||||
* output files for this Variant.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<OutputFile> getFeatureOutputs();
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Model for InstantRun related information.
|
||||
*/
|
||||
public interface InstantRun {
|
||||
|
||||
/** Instant Run is supported. */
|
||||
int STATUS_SUPPORTED = 0;
|
||||
|
||||
/** Instant Run is not supported for non-debug build variants. */
|
||||
int STATUS_NOT_SUPPORTED_FOR_NON_DEBUG_VARIANT = 1;
|
||||
|
||||
/** Instant Run is not supported because the variant is used for testing. */
|
||||
int STATUS_NOT_SUPPORTED_VARIANT_USED_FOR_TESTING = 2;
|
||||
|
||||
/** Instant Run is not supported when Jack is used. */
|
||||
int STATUS_NOT_SUPPORTED_FOR_JACK = 3;
|
||||
|
||||
/** Instant Run currently does not support projects with external native build system. */
|
||||
int STATUS_NOT_SUPPORTED_FOR_EXTERNAL_NATIVE_BUILD = 4;
|
||||
|
||||
/** Instant Run is currently disabled for the experimental plugin. */
|
||||
int STATUS_NOT_SUPPORTED_FOR_EXPERIMENTAL_PLUGIN = 5;
|
||||
|
||||
/** Instant Run is currently disabled for multi-apk applications (http://b/77685496) */
|
||||
int STATUS_NOT_SUPPORTED_FOR_MULTI_APK = 6;
|
||||
|
||||
/** Instant Run was removed */
|
||||
int STATUS_REMOVED = 7;
|
||||
|
||||
/**
|
||||
* Returns the last incremental build information, including success or failure, verifier
|
||||
* reason for requesting a restart, etc...
|
||||
* @return a file location, possibly not existing.
|
||||
*/
|
||||
@NonNull
|
||||
File getInfoFile();
|
||||
|
||||
/**
|
||||
* Whether the owner artifact supports Instant Run. This may depend on the toolchain used.
|
||||
*/
|
||||
boolean isSupportedByArtifact();
|
||||
|
||||
/**
|
||||
* Returns a status code indicating whether Instant Run is supported and why.
|
||||
*/
|
||||
int getSupportStatus();
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* The information for a generated Java artifact.
|
||||
*/
|
||||
public interface JavaArtifact extends BaseArtifact {
|
||||
|
||||
/** Path to the mockable platform jar generated for this {@link JavaArtifact}, if present. */
|
||||
@Nullable
|
||||
File getMockablePlatformJar();
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
|
||||
/**
|
||||
* Java compile options.
|
||||
*/
|
||||
public interface JavaCompileOptions {
|
||||
|
||||
/**
|
||||
* @return the java compiler encoding setting.
|
||||
*/
|
||||
@NonNull
|
||||
String getEncoding();
|
||||
|
||||
/**
|
||||
* @return the level of compliance Java source code has.
|
||||
*/
|
||||
@NonNull
|
||||
String getSourceCompatibility();
|
||||
|
||||
/**
|
||||
* @return the Java version to be able to run classes on.
|
||||
*/
|
||||
@NonNull
|
||||
String getTargetCompatibility();
|
||||
|
||||
/** @return true if core library desugaring is enabled, false otherwise. */
|
||||
boolean isCoreLibraryDesugaringEnabled();
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A Java library.
|
||||
*/
|
||||
public interface JavaLibrary extends Library {
|
||||
/**
|
||||
* Returns the library's jar file.
|
||||
*/
|
||||
@NonNull
|
||||
File getJarFile();
|
||||
|
||||
/**
|
||||
* Returns the direct dependencies of this library.
|
||||
*/
|
||||
@NonNull
|
||||
List<? extends JavaLibrary> getDependencies();
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
|
||||
public interface Library {
|
||||
|
||||
/**
|
||||
* Returns an optional build identifier.
|
||||
*
|
||||
* <p>This is only valid if {@link #getProject()} is not <code>null</code>. a <code>null</code>
|
||||
* value in this property indicates that this is the root build.
|
||||
*
|
||||
* @return a build identifier or null.
|
||||
*/
|
||||
@Nullable
|
||||
String getBuildId();
|
||||
|
||||
/**
|
||||
* Returns an optional project identifier if the library is output
|
||||
* by a module.
|
||||
*
|
||||
* @return the project identifier
|
||||
*/
|
||||
@Nullable
|
||||
String getProject();
|
||||
|
||||
/**
|
||||
* Returns a user friendly name.
|
||||
*/
|
||||
@Nullable
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns this library's Maven coordinates, as requested in the build file.
|
||||
*/
|
||||
@Nullable
|
||||
MavenCoordinates getRequestedCoordinates();
|
||||
|
||||
/**
|
||||
* Returns this library's Maven coordinates after all the project's dependencies have been
|
||||
* resolved. This coordinate may be different than {@link #getRequestedCoordinates()}.
|
||||
*/
|
||||
@NonNull
|
||||
MavenCoordinates getResolvedCoordinates();
|
||||
|
||||
/**
|
||||
* Returns whether the dependency is skipped.
|
||||
*
|
||||
* This can happen in testing artifacts when the same dependency is present in
|
||||
* both the tested artifact and the test artifact.
|
||||
* @return true if skipped.
|
||||
*/
|
||||
boolean isSkipped();
|
||||
|
||||
/**
|
||||
* Returns whether the dependency is provided.
|
||||
*
|
||||
* This is only valid for dependencies present in the 'compile' graph.
|
||||
*
|
||||
* In the 'package' graph the value is always <code>false</code> since the provided dependencies
|
||||
* are not present
|
||||
*
|
||||
* @return true if provided.
|
||||
*/
|
||||
boolean isProvided();
|
||||
}
|
||||
@@ -1,290 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model
|
||||
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Options for lint. Example:
|
||||
*
|
||||
* ```
|
||||
* android {
|
||||
* lintOptions {
|
||||
* // set to true to turn off analysis progress reporting by lint
|
||||
* quiet true
|
||||
* // if true, stop the gradle build if errors are found
|
||||
* abortOnError false
|
||||
* // set to true to have all release builds run lint on issues with severity=fatal
|
||||
* // and abort the build (controlled by abortOnError above) if fatal issues are found
|
||||
* checkReleaseBuilds true
|
||||
* // if true, only report errors
|
||||
* ignoreWarnings true
|
||||
* // if true, emit full/absolute paths to files with errors (true by default)
|
||||
* //absolutePaths true
|
||||
* // if true, check all issues, including those that are off by default
|
||||
* checkAllWarnings true
|
||||
* // if true, treat all warnings as errors
|
||||
* warningsAsErrors true
|
||||
* // turn off checking the given issue id's
|
||||
* disable 'TypographyFractions','TypographyQuotes'
|
||||
* // turn on the given issue id's
|
||||
* enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'
|
||||
* // check *only* the given issue id's
|
||||
* checkOnly 'NewApi', 'InlinedApi'
|
||||
* // if true, don't include source code lines in the error output
|
||||
* noLines true
|
||||
* // if true, show all locations for an error, do not truncate lists, etc.
|
||||
* showAll true
|
||||
* // whether lint should include full issue explanations in the text error output
|
||||
* explainIssues false
|
||||
* // Fallback lint configuration (default severities, etc.)
|
||||
* lintConfig file("default-lint.xml")
|
||||
* // if true, generate a text report of issues (false by default)
|
||||
* textReport true
|
||||
* // location to write the output; can be a file or 'stdout' or 'stderr'
|
||||
* //textOutput 'stdout'
|
||||
* textOutput file("$reportsDir/lint-results.txt")
|
||||
* // if true, generate an XML report for use by for example Jenkins
|
||||
* xmlReport true
|
||||
* // file to write report to (if not specified, defaults to lint-results.xml)
|
||||
* xmlOutput file("$reportsDir/lint-report.xml")
|
||||
* // if true, generate an HTML report (with issue explanations, sourcecode, etc)
|
||||
* htmlReport true
|
||||
* // optional path to report (default will be lint-results.html in the builddir)
|
||||
* htmlOutput file("$reportsDir/lint-report.html")
|
||||
* // if true, generate a SARIF report for use by for example GitHub
|
||||
* sarifReport true
|
||||
* // file to write report to (if not specified, defaults to lint-results.sarif)
|
||||
* sarifOutput file("$reportsDir/lint-report.sarif.json")
|
||||
* // Set the severity of the given issues to fatal (which means they will be
|
||||
* // checked during release builds (even if the lint target is not included)
|
||||
* fatal 'NewApi', 'InlineApi'
|
||||
* // Set the severity of the given issues to error
|
||||
* error 'Wakelock', 'TextViewEdits'
|
||||
* // Set the severity of the given issues to warning
|
||||
* warning 'ResourceAsColor'
|
||||
* // Set the severity of the given issues to ignore (same as disabling the check)
|
||||
* ignore 'TypographyQuotes'
|
||||
* // Set the severity of the given issues to informational
|
||||
* informational 'StopShip'
|
||||
* // Use (or create) a baseline file for issues that should not be reported
|
||||
* baseline file("lint-baseline.xml")
|
||||
* // Normally most lint checks are not run on test sources (except the checks
|
||||
* // dedicated to looking for mistakes in unit or instrumentation tests, unless
|
||||
* // ignoreTestSources is true). You can turn on normal lint checking in all
|
||||
* // sources with the following flag, false by default:
|
||||
* checkTestSources true
|
||||
* // Like checkTestSources, but always skips analyzing tests -- meaning that it
|
||||
* // also ignores checks that have explicitly asked to look at test sources, such
|
||||
* // as the unused resource check.
|
||||
* ignoreTestSources true
|
||||
* // Normally lint will skip generated sources, but you can turn it on with this flag
|
||||
* checkGeneratedSources true
|
||||
* // Normally lint will analyze all dependencies along with each module; this ensures
|
||||
* // that lint can correctly (for example) determine if a resource declared in a library
|
||||
* // is unused; checking only the library in isolation would not be able to identify this
|
||||
* // problem. However, this leads to quite a bit of extra computation; a library is
|
||||
* // analyzed repeatedly, for each module that it is used in.
|
||||
* checkDependencies false
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface LintOptions {
|
||||
/**
|
||||
* Returns the set of issue id's to suppress. Callers are allowed to modify this collection.
|
||||
* To suppress a given issue, add the lint issue id to the returned set.
|
||||
*/
|
||||
val disable: Set<String>
|
||||
|
||||
/**
|
||||
* Returns the set of issue id's to enable. Callers are allowed to modify this collection.
|
||||
* To enable a given issue, add the lint issue id to the returned set.
|
||||
*/
|
||||
val enable: Set<String>
|
||||
|
||||
/**
|
||||
* Returns the exact set of issues to check, or null to run the issues that are enabled
|
||||
* by default plus any issues enabled via [enable] and without issues disabled via [disable].
|
||||
* If non-null, callers are allowed to modify this collection.
|
||||
*/
|
||||
val check: Set<String>
|
||||
|
||||
/** Whether lint should abort the build if errors are found */
|
||||
val isAbortOnError: Boolean
|
||||
|
||||
/**
|
||||
* Whether lint should display full paths in the error output. By default the paths
|
||||
* are relative to the path lint was invoked from.
|
||||
*/
|
||||
val isAbsolutePaths: Boolean
|
||||
|
||||
/**
|
||||
* Whether lint should include the source lines in the output where errors occurred
|
||||
* (true by default)
|
||||
*/
|
||||
val isNoLines: Boolean
|
||||
|
||||
/**
|
||||
* Returns whether lint should be quiet (for example, not write informational messages
|
||||
* such as paths to report files written)
|
||||
*/
|
||||
val isQuiet: Boolean
|
||||
|
||||
/** Returns whether lint should check all warnings, including those off by default */
|
||||
val isCheckAllWarnings: Boolean
|
||||
|
||||
/** Returns whether lint will only check for errors (ignoring warnings) */
|
||||
val isIgnoreWarnings: Boolean
|
||||
|
||||
/** Returns whether lint should treat all warnings as errors */
|
||||
val isWarningsAsErrors: Boolean
|
||||
|
||||
/**
|
||||
* Returns whether lint should run all checks on test sources, instead of just the
|
||||
* lint checks that have been specifically written to include tests (e.g. checks
|
||||
* looking for specific test errors, or checks that need to consider testing code
|
||||
* such as the unused resource detector)
|
||||
*
|
||||
* @return true to check tests, defaults to false
|
||||
* @since 2.4
|
||||
*/
|
||||
val isCheckTestSources: Boolean
|
||||
|
||||
/**
|
||||
* Like [isCheckTestSources], but always skips analyzing tests -- meaning that it also
|
||||
* ignores checks that have explicitly asked to look at test sources, such as the unused
|
||||
* resource check.
|
||||
*
|
||||
* @since 3.2.0-alpha14
|
||||
*/
|
||||
val isIgnoreTestSources: Boolean
|
||||
|
||||
/**
|
||||
* Returns whether lint should run checks on generated sources.
|
||||
*
|
||||
* @return true to check generated sources, defaults to false
|
||||
* @since 2.4
|
||||
*/
|
||||
val isCheckGeneratedSources: Boolean
|
||||
|
||||
/** Returns whether lint should include explanations for issue errors. (Note that
|
||||
* HTML and XML reports intentionally do this unconditionally, ignoring this setting.) */
|
||||
val isExplainIssues: Boolean
|
||||
|
||||
/**
|
||||
* Returns whether lint should include all output (e.g. include all alternate
|
||||
* locations, not truncating long messages, etc.)
|
||||
*/
|
||||
val isShowAll: Boolean
|
||||
|
||||
/**
|
||||
* Returns an optional path to a lint.xml configuration file
|
||||
*/
|
||||
val lintConfig: File?
|
||||
|
||||
/** Whether we should write an text report. Default false. The location can be
|
||||
* controlled by [textOutput]. */
|
||||
val textReport: Boolean
|
||||
|
||||
/**
|
||||
* The optional path to where a text report should be written. The special value
|
||||
* "stdout" can be used to point to standard output.
|
||||
*/
|
||||
val textOutput: File?
|
||||
|
||||
/** Whether we should write an HTML report. Default true. The location can be
|
||||
* controlled by [htmlOutput]. */
|
||||
val htmlReport: Boolean
|
||||
|
||||
/** The optional path to where an HTML report should be written */
|
||||
val htmlOutput: File?
|
||||
|
||||
/** Whether we should write an XML report. Default true. The location can be
|
||||
* controlled by [xmlOutput]. */
|
||||
val xmlReport: Boolean
|
||||
|
||||
/** The optional path to where an XML report should be written */
|
||||
val xmlOutput: File?
|
||||
|
||||
/**
|
||||
* Whether we should write a SARIF (OASIS Static Analysis Results Interchange Format) report.
|
||||
* Default is false. The location can be controlled by [sarifOutput].
|
||||
*/
|
||||
val sarifReport: Boolean
|
||||
|
||||
/**
|
||||
* The optional path to where a SARIF report (OASIS Static
|
||||
* Analysis Results Interchange Format) should be written.
|
||||
*/
|
||||
val sarifOutput: File?
|
||||
|
||||
/**
|
||||
* Returns whether lint should check for fatal errors during release builds. Default is true.
|
||||
* If issues with severity "fatal" are found, the release build is aborted.
|
||||
*/
|
||||
val isCheckReleaseBuilds: Boolean
|
||||
|
||||
/**
|
||||
* Returns whether lint should check all dependencies too as part of its analysis. Default is
|
||||
* false.
|
||||
*/
|
||||
val isCheckDependencies: Boolean
|
||||
|
||||
/**
|
||||
* Returns the baseline file to use, if any. The baseline file is
|
||||
* an XML report previously created by lint, and any warnings and
|
||||
* errors listed in that report will be ignored from analysis.
|
||||
* <p>
|
||||
* If you have a project with a large number of existing warnings,
|
||||
* this lets you set a baseline and only see newly introduced warnings
|
||||
* until you get a chance to go back and address the "technical debt"
|
||||
* of the earlier warnings.
|
||||
*
|
||||
* @return the baseline file, if any
|
||||
*/
|
||||
val baselineFile: File?
|
||||
|
||||
/**
|
||||
* An optional map of severity overrides. The map maps from issue id's to the corresponding
|
||||
* severity to use, which must be "fatal", "error", "warning", or "ignore".
|
||||
*
|
||||
* @return a map of severity overrides, or null. The severities are one of the constants
|
||||
* [SEVERITY_FATAL], [SEVERITY_ERROR], [SEVERITY_WARNING], [SEVERITY_INFORMATIONAL],
|
||||
* [SEVERITY_IGNORE].
|
||||
*/
|
||||
val severityOverrides: Map<String, Int>?
|
||||
|
||||
companion object {
|
||||
/** A severity for Lint. Corresponds to com.android.tools.lint.detector.api.Severity#FATAL */
|
||||
const val SEVERITY_FATAL = 1
|
||||
/** A severity for Lint. Corresponds to com.android.tools.lint.detector.api.Severity#ERROR */
|
||||
const val SEVERITY_ERROR = 2
|
||||
/** A severity for Lint. Corresponds to com.android.tools.lint.detector.api.Severity#WARNING */
|
||||
const val SEVERITY_WARNING = 3
|
||||
/** A severity for Lint. Corresponds to com.android.tools.lint.detector.api.Severity#INFORMATIONAL */
|
||||
const val SEVERITY_INFORMATIONAL = 4
|
||||
/** A severity for Lint. Corresponds to com.android.tools.lint.detector.api.Severity#IGNORE */
|
||||
const val SEVERITY_IGNORE = 5
|
||||
/**
|
||||
* A severity for lint. This severity means that the severity should be whatever the default
|
||||
* is for this issue (this is used when the DSL just says "enable", and Gradle doesn't know
|
||||
* what the default severity is.)
|
||||
*/
|
||||
const val SEVERITY_DEFAULT_ENABLED = 6
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* Coordinates that uniquely identifies a project in a Maven repository.
|
||||
*/
|
||||
interface MavenCoordinates {
|
||||
/**
|
||||
* Returns the name of the project's group, similar to the Java packaging structure.
|
||||
*/
|
||||
val groupId: String
|
||||
|
||||
/**
|
||||
* Returns the name that the project is known by.
|
||||
*/
|
||||
val artifactId: String
|
||||
|
||||
/**
|
||||
* Returns the version of the project.
|
||||
*/
|
||||
val version: String
|
||||
|
||||
/**
|
||||
* Returns the project's artifact type. It defaults to "jar" if not explicitly set.
|
||||
*/
|
||||
val packaging: String
|
||||
|
||||
/**
|
||||
* Returns the project's classifier. The classifier allows to distinguish artifacts that were
|
||||
* built from the same POM but differ in their content.
|
||||
*/
|
||||
val classifier: String?
|
||||
|
||||
/**
|
||||
* Returns this coordinates Id without the version attribute.
|
||||
* Since 2.3
|
||||
*/
|
||||
val versionlessId: String
|
||||
}
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* The parameter for ModelBuilder to build customized models.
|
||||
*/
|
||||
public interface ModelBuilderParameter {
|
||||
/**
|
||||
* Whether model builder should build variants or not when building {@link AndroidProject}.
|
||||
*
|
||||
* @return true if model builder should build variant.
|
||||
*/
|
||||
boolean getShouldBuildVariant();
|
||||
|
||||
/**
|
||||
* Set whether model builder should build variants or not.
|
||||
*
|
||||
* @param shouldBuildVariant whether model builder should build variants or not.
|
||||
*/
|
||||
void setShouldBuildVariant(boolean shouldBuildVariant);
|
||||
|
||||
/**
|
||||
* Whether model builder should schedule source generation post sync or not when building {@link
|
||||
* Variant}.
|
||||
*
|
||||
* @return true if model builder should schedule source generation.
|
||||
*/
|
||||
boolean getShouldGenerateSources();
|
||||
|
||||
/**
|
||||
* Set whether model builder should should schedule source generation post sync or not.
|
||||
*
|
||||
* @param shouldGenerateSources whether model builder should schedule source generation post
|
||||
* sync or not.
|
||||
*/
|
||||
void setShouldGenerateSources(boolean shouldGenerateSources);
|
||||
|
||||
/**
|
||||
* Returns the name of the variant to build.
|
||||
*
|
||||
* @return the name of the variant to build.
|
||||
*/
|
||||
@Nullable
|
||||
String getVariantName();
|
||||
|
||||
/**
|
||||
* Set the name of the variant to build.
|
||||
*
|
||||
* @param variantName the name of the variant to build.
|
||||
*/
|
||||
void setVariantName(@NonNull String variantName);
|
||||
|
||||
/**
|
||||
* If not null then this is the name of the ABI to build.
|
||||
*
|
||||
* @return the name of the ABI to build.
|
||||
*/
|
||||
@Nullable
|
||||
String getAbiName();
|
||||
|
||||
/**
|
||||
* Sets the ABI to build.
|
||||
*
|
||||
* @param abi the ABI to build.
|
||||
*/
|
||||
void setAbiName(@NonNull String abi);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
/**
|
||||
* Workaround to allow kotlin users to treat name as a field on interfaces that contain getName().
|
||||
*/
|
||||
public interface Named {
|
||||
String getName();
|
||||
}
|
||||
-92
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Entry point for the model of the Android native support.
|
||||
*/
|
||||
public interface NativeAndroidProject {
|
||||
String BUILD_SYSTEM_UNKNOWN = "unknown";
|
||||
String BUILD_SYSTEM_GRADLE = "gradle";
|
||||
String BUILD_SYSTEM_CMAKE = "cmake";
|
||||
String BUILD_SYSTEM_NDK_BUILD = "ndkBuild";
|
||||
|
||||
/** Returns the model version. This is a string in the format X.Y.Z */
|
||||
@NonNull
|
||||
String getModelVersion();
|
||||
|
||||
/**
|
||||
* Returns the model api version.
|
||||
*
|
||||
* <p>This is different from {@link #getModelVersion()} in a way that new model version might
|
||||
* increment model version but keep existing api. That means that code which was built against
|
||||
* particular 'api version' might be safely re-used for all new model versions as long as they
|
||||
* don't change the api.
|
||||
*
|
||||
* <p>Every new model version is assumed to return an 'api version' value which is equal or
|
||||
* greater than the value used by the previous model version.
|
||||
*/
|
||||
int getApiVersion();
|
||||
|
||||
/** Returns the name of the module. */
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns a map of variant name to information about that variant. For example, it contains
|
||||
* this list of ABIs built for that variant.
|
||||
*/
|
||||
@NonNull
|
||||
Map<String, NativeVariantInfo> getVariantInfos();
|
||||
|
||||
/** Returns a collection of files that affects the build. */
|
||||
@NonNull
|
||||
Collection<File> getBuildFiles();
|
||||
|
||||
/** Returns a collection of native artifacts. */
|
||||
@NonNull
|
||||
Collection<NativeArtifact> getArtifacts();
|
||||
|
||||
/** Returns a collection of toolchains. */
|
||||
@NonNull
|
||||
Collection<NativeToolchain> getToolChains();
|
||||
|
||||
/** Returns a collection of all compile settings. */
|
||||
@NonNull
|
||||
Collection<NativeSettings> getSettings();
|
||||
|
||||
/**
|
||||
* Return a map of file extension to each file type.
|
||||
*
|
||||
* <p>The key is the file extension, the value is either "c" or "c++".
|
||||
*/
|
||||
@NonNull
|
||||
Map<String, String> getFileExtensions();
|
||||
|
||||
/** Return the names of build systems used to create the native artifacts. */
|
||||
@NonNull
|
||||
Collection<String> getBuildSystems();
|
||||
|
||||
/** Get the default NDK version. */
|
||||
@NonNull
|
||||
String getDefaultNdkVersion();
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A native artifact.
|
||||
*
|
||||
* Represent an native library.
|
||||
*/
|
||||
public interface NativeArtifact {
|
||||
|
||||
/**
|
||||
* Returns the name of the artifact.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the toolchain used for compilation.
|
||||
*/
|
||||
@NonNull
|
||||
String getToolChain();
|
||||
|
||||
/**
|
||||
* Returns the group this artifact is associated with.
|
||||
*/
|
||||
@NonNull
|
||||
String getGroupName();
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate the artifact output.
|
||||
*/
|
||||
@NonNull
|
||||
String getAssembleTaskName();
|
||||
|
||||
/**
|
||||
* Returns the source files.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<NativeFile> getSourceFiles();
|
||||
|
||||
/**
|
||||
* Returns the folders container headers exported for the library.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getExportedHeaders();
|
||||
|
||||
/**
|
||||
* Returns the target ABI of the artifact.
|
||||
*/
|
||||
@NonNull
|
||||
String getAbi();
|
||||
|
||||
/**
|
||||
* Returns the name of the target that builds this artifact.
|
||||
*/
|
||||
@NonNull
|
||||
String getTargetName();
|
||||
|
||||
/** Returns the output file with debug symbols unstripped. */
|
||||
@Nullable
|
||||
File getOutputFile();
|
||||
|
||||
/**
|
||||
* Returns the files that needs to be deployed with getOutputFile to be executed on device.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getRuntimeFiles();
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* A native source file with compile settings.
|
||||
*/
|
||||
public interface NativeFile {
|
||||
|
||||
/** The source file. */
|
||||
@NonNull
|
||||
File getFilePath();
|
||||
|
||||
/** The name of a {@link NativeSettings} for the source file. */
|
||||
@NonNull
|
||||
String getSettingsName();
|
||||
|
||||
/** The working directory for the compiler. */
|
||||
@Nullable
|
||||
File getWorkingDirectory();
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A Native Library. The configurations used to create a shared object.
|
||||
*
|
||||
* <p>Deprecated since ndk-compile is deprecated.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface NativeLibrary {
|
||||
|
||||
/**
|
||||
* Returns the name of the native library.
|
||||
*
|
||||
* A native library "libfoo.so" would have the name of "foo".
|
||||
*
|
||||
* @return name of the native library.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the ABI of the library.
|
||||
*
|
||||
* @return abi of the library.
|
||||
*/
|
||||
@NonNull
|
||||
String getAbi();
|
||||
|
||||
/**
|
||||
* Returns the name of the toolchain used to compile the native library.
|
||||
*
|
||||
* @return name of the toolchain.
|
||||
*/
|
||||
@NonNull
|
||||
String getToolchainName();
|
||||
|
||||
/**
|
||||
* A list of include directories for compiling C code.
|
||||
*
|
||||
* @return list of include directories.
|
||||
*/
|
||||
@NonNull
|
||||
List<File> getCIncludeDirs();
|
||||
|
||||
/**
|
||||
* A list of include directories for compiling C++ code.
|
||||
*
|
||||
* @return list of include directories.
|
||||
*/
|
||||
@NonNull
|
||||
List<File> getCppIncludeDirs();
|
||||
|
||||
/**
|
||||
* A list of system include directories for compiling C code.
|
||||
*
|
||||
* @return list of include directories.
|
||||
*/
|
||||
@NonNull
|
||||
List<File> getCSystemIncludeDirs();
|
||||
|
||||
/**
|
||||
* A list of system include directories for compiling C++ code.
|
||||
*
|
||||
* @return list of include directories.
|
||||
*/
|
||||
@NonNull
|
||||
List<File> getCppSystemIncludeDirs();
|
||||
|
||||
/**
|
||||
* A list of defines for C code.
|
||||
*
|
||||
* @return list of defines.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getCDefines();
|
||||
|
||||
/**
|
||||
* A list of defines for C++ code.
|
||||
*
|
||||
* @return list of defines.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getCppDefines();
|
||||
|
||||
/**
|
||||
* A list of compiler flags for C code.
|
||||
*
|
||||
* @return list of compiler flags.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getCCompilerFlags();
|
||||
|
||||
/**
|
||||
* A list of compiler flags for C++ code.
|
||||
*
|
||||
* @return list of compiler flags.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getCppCompilerFlags();
|
||||
|
||||
/**
|
||||
* The folders containing built libraries with debug information.
|
||||
*
|
||||
* @return list of paths to locate shared objects with debug information.
|
||||
*/
|
||||
@NonNull
|
||||
List<File> getDebuggableLibraryFolders();
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Compilation settings for a native source file.
|
||||
*/
|
||||
public interface NativeSettings {
|
||||
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
@NonNull
|
||||
List<String> getCompilerFlags();
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Toolchain for building a native library.
|
||||
*/
|
||||
public interface NativeToolchain {
|
||||
|
||||
/**
|
||||
* Returns the name of the toolchain.
|
||||
*
|
||||
* e.g. "x86_64", "arm-linux-androideabi"
|
||||
*
|
||||
* @return name of the toolchain.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the full path of the C compiler.
|
||||
* May be null if project do not contain C sources.
|
||||
*
|
||||
* @return the C compiler path.
|
||||
*/
|
||||
@Nullable
|
||||
File getCCompilerExecutable();
|
||||
|
||||
/**
|
||||
* Returns the full path of the C++ compiler.
|
||||
* May be null if project do not contain C++ sources.
|
||||
*
|
||||
* @return the C++ compiler path.
|
||||
*/
|
||||
@Nullable
|
||||
File getCppCompilerExecutable();
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Contains information about a specific variant + ABI for a native project. This structure is
|
||||
* effectively partial information of a NativeAndroidProject. This is the information that is slow
|
||||
* to compute, for example we need to call cmake.exe to generate a project.
|
||||
*/
|
||||
public interface NativeVariantAbi extends Serializable {
|
||||
/** Returns a collection of files that affect the build. */
|
||||
@NonNull
|
||||
Collection<File> getBuildFiles();
|
||||
|
||||
/** Returns a collection of native artifacts. */
|
||||
@NonNull
|
||||
Collection<NativeArtifact> getArtifacts();
|
||||
|
||||
/** Returns a collection of toolchains. */
|
||||
@NonNull
|
||||
Collection<NativeToolchain> getToolChains();
|
||||
|
||||
/** Returns a collection of all compile settings. */
|
||||
@NonNull
|
||||
Collection<NativeSettings> getSettings();
|
||||
|
||||
/**
|
||||
* Return a map of file extension to each file type.
|
||||
*
|
||||
* <p>The key is the file extension, the value is either "c" or "c++".
|
||||
*/
|
||||
@NonNull
|
||||
Map<String, String> getFileExtensions();
|
||||
|
||||
/** Returns the variant name. */
|
||||
@NonNull
|
||||
String getVariantName();
|
||||
|
||||
/** Returns the abi. */
|
||||
@NonNull
|
||||
String getAbi();
|
||||
}
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Native build information about a specific variant. This is the fast-to-compute information that
|
||||
* is sent to Android Studio during partial sync.
|
||||
*/
|
||||
public interface NativeVariantInfo extends Serializable {
|
||||
/**
|
||||
* Names of ABIs built by this variant. Typical values are: x86, x86_64, armeabi-v7a, and
|
||||
* arm64-v8a Rarer values are: armeabi, mips, and mip64
|
||||
*
|
||||
* @return set of ABI names.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getAbiNames();
|
||||
|
||||
/**
|
||||
* Map of ABI name to corresponding build root folder for that ABI.
|
||||
*
|
||||
* <p>For CMake, the build root folder is the one that contains the generated build system. For
|
||||
* example, this is where build.ninja is emitted. This is also the folder with
|
||||
* compile_commands.json. This is the folder that is set by passing -B [folder] to CMake at
|
||||
* project generation time.
|
||||
*
|
||||
* <p>For both ndk-build and CMake, this is the folder that contains android_gradle_build.json
|
||||
* is emitted.
|
||||
*
|
||||
* <p>In general, this is the folder that contains metadata about the build for this particular
|
||||
* ABI.
|
||||
*
|
||||
* <p>There should be one entry in the map per ABI name returned by getAbiNames().
|
||||
*
|
||||
* @return the map of ABI to build root folder.
|
||||
*/
|
||||
@NonNull
|
||||
Map<String, File> getBuildRootFolderMap();
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
/**
|
||||
* enum describing possible optional compilation steps. This can be used to turn on java byte code
|
||||
* manipulation in order to support instant reloading, or profiling, or anything related to
|
||||
* transforming java compiler .class files before they are processed into .dex files.
|
||||
*
|
||||
* @deprecated this is not used anymore
|
||||
*/
|
||||
@Deprecated
|
||||
public enum OptionalCompilationStep {
|
||||
|
||||
/**
|
||||
* presence will turn on the InstantRun feature.
|
||||
*/
|
||||
INSTANT_DEV,
|
||||
/**
|
||||
* Force rebuild of cold swap artifacts.
|
||||
*
|
||||
* <p>Dex files and/or resources.ap_ for ColdswapMode.MULTIDEX and some split APKs for
|
||||
* ColdswapMode.MULTIAPK.
|
||||
*/
|
||||
RESTART_ONLY,
|
||||
/**
|
||||
* Force rebuild of fresh install artifacts.
|
||||
*
|
||||
* <p>A full apk for ColdswapMode.MULTIDEX and all the split apks for ColdswapMode.MULTIAPK.
|
||||
*/
|
||||
FULL_APK,
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* Options for APK packaging.
|
||||
*/
|
||||
interface PackagingOptions {
|
||||
/**
|
||||
* Glob patterns to exclude from packaging.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val excludes: Set<String>
|
||||
|
||||
/**
|
||||
* Glob patterns to pick first.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val pickFirsts: Set<String>
|
||||
|
||||
/**
|
||||
* Glob patterns to merge.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val merges: Set<String>
|
||||
|
||||
/**
|
||||
* Glob patterns to exclude native libraries from being stripped.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val doNotStrip: Set<String>
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* a Product Flavor. This is only the configuration of the flavor.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*
|
||||
* It does not include the sources or the dependencies. Those are available on the container
|
||||
* or in the artifact info.
|
||||
*
|
||||
* @see ProductFlavorContainer
|
||||
*
|
||||
* @see BaseArtifact.getDependencies
|
||||
*/
|
||||
interface ProductFlavor : BaseConfig, DimensionAware {
|
||||
/** The name of the flavor. */
|
||||
override fun getName(): String
|
||||
|
||||
/**
|
||||
* The name of the product flavor. This is only the value set on this product flavor.
|
||||
* To get the final application id name, use [AndroidArtifact.getApplicationId].
|
||||
*/
|
||||
val applicationId: String?
|
||||
|
||||
/**
|
||||
* The version code associated with this flavor or null if none have been set.
|
||||
* This is only the value set on this product flavor, not necessarily the actual
|
||||
* version code used.
|
||||
*/
|
||||
val versionCode: Int?
|
||||
|
||||
/** The version name. This is only the value set on this product flavor.
|
||||
* To get the final value, use [Variant.getMergedFlavor] with
|
||||
* [.getVersionNameSuffix] and [BuildType.getVersionNameSuffix].
|
||||
*/
|
||||
val versionName: String?
|
||||
|
||||
/** The minSdkVersion, or null if not specified. This is only the value set on this product flavor. */
|
||||
val minSdkVersion: ApiVersion?
|
||||
|
||||
/** The targetSdkVersion, or null if not specified. This is only the value set on this product flavor. */
|
||||
val targetSdkVersion: ApiVersion?
|
||||
|
||||
/** The maxSdkVersion, or null if not specified. This is only the value set on this produce flavor. */
|
||||
val maxSdkVersion: Int?
|
||||
|
||||
/**
|
||||
* The renderscript target api, or null if not specified. This is only the value set on this product flavor.
|
||||
* TODO: make final renderscript target api available through the model
|
||||
*/
|
||||
val renderscriptTargetApi: Int?
|
||||
|
||||
/**
|
||||
* Whether the renderscript code should be compiled in support mode to
|
||||
* make it compatible with older versions of Android.
|
||||
*
|
||||
* True if support mode is enabled, false if not, and null if not specified.
|
||||
*/
|
||||
val renderscriptSupportModeEnabled: Boolean?
|
||||
|
||||
/**
|
||||
* Whether the renderscript BLAS support lib should be used to
|
||||
* make it compatible with older versions of Android.
|
||||
*
|
||||
* True if BLAS support lib is enabled, false if not, and null if not specified.
|
||||
*/
|
||||
val renderscriptSupportModeBlasEnabled: Boolean?
|
||||
|
||||
/**
|
||||
* Whether the renderscript code should be compiled to generate C/C++ bindings.
|
||||
* True for C/C++ generation, false for Java, null if not specified.
|
||||
*/
|
||||
val renderscriptNdkModeEnabled: Boolean?
|
||||
|
||||
/**
|
||||
* The test application id. This is only the value set on this product flavor.
|
||||
* To get the final value, use [Variant.getExtraAndroidArtifacts] with
|
||||
* [AndroidProject.ARTIFACT_ANDROID_TEST] and then
|
||||
* [AndroidArtifact.getApplicationId]
|
||||
*/
|
||||
val testApplicationId: String?
|
||||
|
||||
/**
|
||||
* The test instrumentation runner. This is only the value set on this product flavor.
|
||||
* TODO: make test instrumentation runner available through the model.
|
||||
*/
|
||||
val testInstrumentationRunner: String?
|
||||
|
||||
/** The arguments for the test instrumentation runner.*/
|
||||
val testInstrumentationRunnerArguments: Map<String, String>
|
||||
|
||||
/** The handlingProfile value. This is only the value set on this product flavor. */
|
||||
val testHandleProfiling: Boolean?
|
||||
|
||||
/** The functionalTest value. This is only the value set on this product flavor. */
|
||||
val testFunctionalTest: Boolean?
|
||||
|
||||
/**
|
||||
* The resource configuration for this variant.
|
||||
*
|
||||
* This is the list of -c parameters for aapt.
|
||||
*/
|
||||
val resourceConfigurations: Collection<String>
|
||||
|
||||
val vectorDrawables: VectorDrawablesOptions
|
||||
/**
|
||||
* Whether to enable unbundling mode for embedded wear app.
|
||||
*
|
||||
* If true, this enables the app to transition from an embedded wear app to one
|
||||
* distributed by the play store directly.
|
||||
*/
|
||||
val wearAppUnbundled: Boolean?
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A Container of all the data related to {@link ProductFlavor}.
|
||||
*/
|
||||
public interface ProductFlavorContainer {
|
||||
|
||||
/**
|
||||
* The Product Flavor itself.
|
||||
*
|
||||
* @return the product flavor
|
||||
*/
|
||||
@NonNull
|
||||
ProductFlavor getProductFlavor();
|
||||
|
||||
/**
|
||||
* The associated main sources of the product flavor
|
||||
*
|
||||
* @return the main source provider.
|
||||
*/
|
||||
@Nullable
|
||||
SourceProvider getSourceProvider();
|
||||
|
||||
/**
|
||||
* Returns a list of ArtifactMetaData/SourceProvider association.
|
||||
*
|
||||
* @return a list of ArtifactMetaData/SourceProvider association.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<SourceProviderContainer> getExtraSourceProviders();
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Minimal model for a project output. */
|
||||
@Deprecated
|
||||
public interface ProjectBuildOutput {
|
||||
|
||||
/**
|
||||
* Returns a collection of {@link VariantBuildOutput} identifying all the variants for this
|
||||
* project.
|
||||
*
|
||||
* @return a list of {@link VariantBuildOutput} per variant.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<VariantBuildOutput> getVariantsBuildOutput();
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Model for a project's {@link SyncIssue}s.
|
||||
*
|
||||
* <p>This model should be fetched last (after other models), in order to have all the SyncIssue's
|
||||
* collected and delivered.
|
||||
*/
|
||||
public interface ProjectSyncIssues {
|
||||
|
||||
/** Returns issues found during sync. */
|
||||
@NonNull
|
||||
Collection<SyncIssue> getSyncIssues();
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* A Signing Configuration.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*/
|
||||
interface SigningConfig {
|
||||
/** Returns the name of the Signing config */
|
||||
fun getName(): String
|
||||
|
||||
/** The keystore file. */
|
||||
val storeFile: File?
|
||||
|
||||
/** The keystore password. */
|
||||
val storePassword: String?
|
||||
|
||||
/** The key alias name. */
|
||||
val keyAlias: String?
|
||||
|
||||
/** The key password. */
|
||||
val keyPassword: String?
|
||||
|
||||
/** The store type. */
|
||||
val storeType: String?
|
||||
|
||||
/** Signing using JAR Signature Scheme (aka v1 signing) is enabled. */
|
||||
@Deprecated("This property is deprecated")
|
||||
val isV1SigningEnabled: Boolean
|
||||
|
||||
/** Signing using APK Signature Scheme v2 (aka v2 signing) is enabled. */
|
||||
@Deprecated("This property is deprecated")
|
||||
val isV2SigningEnabled: Boolean
|
||||
|
||||
/**
|
||||
* Whether the config is fully configured for signing.
|
||||
*
|
||||
* i.e. all the required information are present.
|
||||
*/
|
||||
val isSigningReady: Boolean
|
||||
}
|
||||
-154
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.builder.model.v2.CustomSourceDirectory;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Represent a SourceProvider for a given configuration.
|
||||
*
|
||||
* TODO: source filters?
|
||||
*/
|
||||
public interface SourceProvider {
|
||||
|
||||
/**
|
||||
* Returns the name of this source set.
|
||||
*
|
||||
* @return The name. Never returns null.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the manifest file.
|
||||
*
|
||||
* @return the manifest file. It may not exist.
|
||||
*/
|
||||
@NonNull
|
||||
File getManifestFile();
|
||||
|
||||
/**
|
||||
* Returns the java source folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getJavaDirectories();
|
||||
|
||||
/**
|
||||
* Returns the kotlin source folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getKotlinDirectories();
|
||||
|
||||
/**
|
||||
* Returns the java resources folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getResourcesDirectories();
|
||||
|
||||
/**
|
||||
* Returns the aidl source folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getAidlDirectories();
|
||||
|
||||
/**
|
||||
* Returns the renderscript source folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getRenderscriptDirectories();
|
||||
|
||||
/**
|
||||
* Returns the C source folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
* @deprecated since ndk-compile is deprecated
|
||||
*/
|
||||
@NonNull
|
||||
@Deprecated
|
||||
Collection<File> getCDirectories();
|
||||
|
||||
/**
|
||||
* Returns the C++ source folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
* @deprecated since ndk-compile is deprecated
|
||||
*/
|
||||
@NonNull
|
||||
@Deprecated
|
||||
Collection<File> getCppDirectories();
|
||||
|
||||
/**
|
||||
* Returns the android resources folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getResDirectories();
|
||||
|
||||
/**
|
||||
* Returns the android assets folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getAssetsDirectories();
|
||||
|
||||
/**
|
||||
* Returns the native libs folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getJniLibsDirectories();
|
||||
|
||||
/**
|
||||
* Returns the shader folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getShadersDirectories();
|
||||
|
||||
/**
|
||||
* Returns the machine learning models folders.
|
||||
*
|
||||
* @return a list of folders. They may not all exist.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<File> getMlModelsDirectories();
|
||||
|
||||
/**
|
||||
* Returns the map of registered custom directories, key is the name provided when registering
|
||||
* the source set, and value is the list of folders for that custom source set.
|
||||
*
|
||||
* @return a map of source set name to source set folders.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<CustomSourceDirectory> getCustomDirectories();
|
||||
}
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
|
||||
/**
|
||||
* An association of an {@link ArtifactMetaData}'s name and a {@link SourceProvider}.
|
||||
*/
|
||||
public interface SourceProviderContainer {
|
||||
|
||||
/**
|
||||
* Returns the name matching {@link ArtifactMetaData#getName()}
|
||||
*/
|
||||
@NonNull
|
||||
String getArtifactName();
|
||||
|
||||
/**
|
||||
* Returns the source provider
|
||||
*/
|
||||
@NonNull
|
||||
SourceProvider getSourceProvider();
|
||||
}
|
||||
@@ -1,278 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* Class representing a sync issue. The goal is to make these issues not fail the sync but instead
|
||||
* report them at the end of a successful sync.
|
||||
*/
|
||||
interface SyncIssue {
|
||||
/** Returns the severity of the issue. */
|
||||
val severity: Int
|
||||
|
||||
/** Returns the type of the issue. */
|
||||
val type: Int
|
||||
|
||||
/**
|
||||
* Returns the data of the issue.
|
||||
*
|
||||
* This is a machine-readable string used by the IDE for known issue types.
|
||||
*/
|
||||
val data: String?
|
||||
|
||||
/**
|
||||
* Returns the a user-readable message for the issue.
|
||||
*
|
||||
* This is used by IDEs that do not recognize the issue type (ie older IDE released before
|
||||
* the type was added to the plugin).
|
||||
*/
|
||||
val message: String
|
||||
|
||||
/**
|
||||
* Returns the a user-readable nulti-line message for the issue.
|
||||
*
|
||||
* This is an optional extension of [message]
|
||||
*/
|
||||
val multiLineMessage: List<String>?
|
||||
|
||||
companion object {
|
||||
const val SEVERITY_WARNING = 1
|
||||
const val SEVERITY_ERROR = 2
|
||||
|
||||
/** Generic error with no data payload, and no expected quick fix in IDE. */
|
||||
const val TYPE_GENERIC = 0
|
||||
|
||||
/** Data is expiration data. */
|
||||
const val TYPE_PLUGIN_OBSOLETE = 1
|
||||
|
||||
/** Data is dependency coordinate. */
|
||||
const val TYPE_UNRESOLVED_DEPENDENCY = 2
|
||||
|
||||
/** Data is dependency coordinate. */
|
||||
const val TYPE_DEPENDENCY_IS_APK = 3
|
||||
|
||||
/** Data is dependency coordinate. */
|
||||
const val TYPE_DEPENDENCY_IS_APKLIB = 4
|
||||
|
||||
/** Data is local file. */
|
||||
const val TYPE_NON_JAR_LOCAL_DEP = 5
|
||||
|
||||
/** Data is dependency coordinate/path. */
|
||||
const val TYPE_NON_JAR_PACKAGE_DEP = 6
|
||||
|
||||
/** Data is dependency coordinate/path. */
|
||||
const val TYPE_NON_JAR_PROVIDED_DEP = 7
|
||||
|
||||
/** Data is dependency coordinate/path. */
|
||||
const val TYPE_JAR_DEPEND_ON_AAR = 8
|
||||
|
||||
/**
|
||||
* Mismatch dependency version between tested and test app. Data is dep coordinate without the
|
||||
* version (groupId:artifactId)
|
||||
*/
|
||||
const val TYPE_MISMATCH_DEP = 9
|
||||
|
||||
/** Data is dependency coordinate. */
|
||||
const val TYPE_OPTIONAL_LIB_NOT_FOUND = 10
|
||||
|
||||
/** Data is variant name. */
|
||||
const val TYPE_JACK_IS_NOT_SUPPORTED = 11
|
||||
|
||||
/** Data is the min version of Gradle. */
|
||||
const val TYPE_GRADLE_TOO_OLD = 12
|
||||
|
||||
/** Data is the required min build tools version, parsable by Revision. */
|
||||
const val TYPE_BUILD_TOOLS_TOO_LOW = 13
|
||||
|
||||
/**
|
||||
* Found dependency that's the maven published android.jar. Data is the maven artifact
|
||||
* coordinates.
|
||||
*/
|
||||
const val TYPE_DEPENDENCY_MAVEN_ANDROID = 14
|
||||
|
||||
/**
|
||||
* Found dependency that is known to be inside android.jar. Data is maven artifact coordinates.
|
||||
*/
|
||||
const val TYPE_DEPENDENCY_INTERNAL_CONFLICT = 15
|
||||
|
||||
/** Errors configuring NativeConfigValues for individual individual variants */
|
||||
const val TYPE_EXTERNAL_NATIVE_BUILD_CONFIGURATION = 16
|
||||
|
||||
/**
|
||||
* Errors configuring NativeConfigValues. There was a process exception. Data contains STDERR
|
||||
* which should be interpreted by Android Studio.
|
||||
*/
|
||||
const val TYPE_EXTERNAL_NATIVE_BUILD_PROCESS_EXCEPTION = 17
|
||||
|
||||
/** Cannot use Java 8 Language features without Jack. */
|
||||
const val TYPE_JACK_REQUIRED_FOR_JAVA_8_LANGUAGE_FEATURES = 18
|
||||
|
||||
/**
|
||||
* A wearApp configuration was resolved and found more than one apk. Data is the configuration
|
||||
* name.
|
||||
*/
|
||||
const val TYPE_DEPENDENCY_WEAR_APK_TOO_MANY = 19
|
||||
|
||||
/** A wearApp configuration was resolved and found an apk even though unbundled mode is on. */
|
||||
const val TYPE_DEPENDENCY_WEAR_APK_WITH_UNBUNDLED = 20
|
||||
|
||||
/** Data is dependency coordinate/path. */
|
||||
@Deprecated("")
|
||||
const val TYPE_JAR_DEPEND_ON_ATOM = 21
|
||||
|
||||
/** Data is dependency coordinate/path. */
|
||||
@Deprecated("")
|
||||
const val TYPE_AAR_DEPEND_ON_ATOM = 22
|
||||
|
||||
/** Data is dependency coordinate/path. */
|
||||
@Deprecated("")
|
||||
const val TYPE_ATOM_DEPENDENCY_PROVIDED = 23
|
||||
|
||||
/**
|
||||
* Indicates that a required SDK package was not installed. The data field contains the sdklib
|
||||
* package ID of the missing package that the user should install.
|
||||
*/
|
||||
const val TYPE_MISSING_SDK_PACKAGE = 24
|
||||
|
||||
/**
|
||||
* Indicates that the plugin requires a newer version of studio. Minimum version is passed in
|
||||
* the data.
|
||||
*/
|
||||
const val TYPE_STUDIO_TOO_OLD = 25
|
||||
|
||||
/**
|
||||
* Indicates that the module contains flavors but that no dimensions have been named. data is
|
||||
* empty.
|
||||
*/
|
||||
const val TYPE_UNNAMED_FLAVOR_DIMENSION = 26
|
||||
|
||||
/** An incompatible plugin is used. */
|
||||
const val TYPE_INCOMPATIBLE_PLUGIN = 27
|
||||
|
||||
/**
|
||||
* Indicates that the project uses a deprecated DSL. The data paylod is dslElement::removeTarget
|
||||
* where removal target is the version of the plugin where the dsl element is targeted to be
|
||||
* removed.
|
||||
*/
|
||||
const val TYPE_DEPRECATED_DSL = 28
|
||||
|
||||
/**
|
||||
* Indicates that the project uses a deprecated configuration.
|
||||
*
|
||||
*
|
||||
* This type is now replaced with TYPE_USING_DEPRECATED_CONFIGURATION (see
|
||||
* http://issuetracker.google.com/138278313).
|
||||
*/
|
||||
@Deprecated("")
|
||||
const val TYPE_DEPRECATED_CONFIGURATION = 29
|
||||
|
||||
/**
|
||||
* Indicates that the project uses a deprecated DSL, the Data payload is a URL giving context to
|
||||
* the user on how to remove the deprecated element or value.
|
||||
*
|
||||
*
|
||||
* This type is now replaced with TYPE_USING_DEPRECATED_DSL_VALUE (see
|
||||
* http://issuetracker.google.com/138278313).
|
||||
*/
|
||||
@Deprecated("")
|
||||
const val TYPE_DEPRECATED_DSL_VALUE = 29
|
||||
|
||||
/** Indicates that the project contains the min sdk in the android manifest file. */
|
||||
const val TYPE_MIN_SDK_VERSION_IN_MANIFEST = 30
|
||||
|
||||
/** Indicates that the project contains the target sdk in the android manifest file. */
|
||||
const val TYPE_TARGET_SDK_VERSION_IN_MANIFEST = 31
|
||||
|
||||
/** Indicated that an experimental gradle project option is used. */
|
||||
const val TYPE_UNSUPPORTED_PROJECT_OPTION_USE = 32
|
||||
|
||||
/**
|
||||
* Indicates that building the configuration rules for this project requires parsing the
|
||||
* manifest file.
|
||||
*/
|
||||
const val TYPE_MANIFEST_PARSED_DURING_CONFIGURATION = 33
|
||||
|
||||
/**
|
||||
* Indicates that the version of a third-party Gradle plugin (not the Android Gradle plugin) is
|
||||
* not supported and needs to be updated.
|
||||
*/
|
||||
const val TYPE_THIRD_PARTY_GRADLE_PLUGIN_TOO_OLD = 34
|
||||
|
||||
/**
|
||||
* Indicates that the signing configuration is declared in the dynamic-feature gradle file. This
|
||||
* should only be declared in the application module, as dynamic-features use the base module's
|
||||
* signing configuration, and this will be ignored.
|
||||
*/
|
||||
const val TYPE_SIGNING_CONFIG_DECLARED_IN_DYNAMIC_FEATURE = 35
|
||||
|
||||
/**
|
||||
* Indicates that the SDK is missing or invalid, this can either be set in the ANDROID_SDK_ROOT
|
||||
* environment variable or the projects local.properties files.
|
||||
*/
|
||||
const val TYPE_SDK_NOT_SET = 36
|
||||
|
||||
/** Indicates that the user has specified multiple default build types */
|
||||
const val TYPE_AMBIGUOUS_BUILD_TYPE_DEFAULT = 37
|
||||
|
||||
/** Indicates that the user has specified multiple default product flavors */
|
||||
const val TYPE_AMBIGUOUS_PRODUCT_FLAVOR_DEFAULT = 38
|
||||
|
||||
/** Indicates that the compileSdkVersion is missing */
|
||||
const val TYPE_COMPILE_SDK_VERSION_NOT_SET = 39
|
||||
|
||||
/**
|
||||
* Indicates that the `android.useAndroidX` property must be enabled but is currently disabled.
|
||||
*/
|
||||
const val TYPE_ANDROID_X_PROPERTY_NOT_ENABLED = 40
|
||||
|
||||
/** Indicates that the project uses a deprecated configuration. */
|
||||
const val TYPE_USING_DEPRECATED_CONFIGURATION = 41
|
||||
|
||||
/**
|
||||
* Indicates that the project uses a deprecated DSL, the Data payload is a URL giving context to
|
||||
* the user on how to remove the deprecated element or value.
|
||||
*/
|
||||
const val TYPE_USING_DEPRECATED_DSL_VALUE = 42
|
||||
|
||||
/** The user or a plugin has tried to mutate a DSL value after it has been locked. */
|
||||
const val TYPE_EDIT_LOCKED_DSL_VALUE = 43
|
||||
|
||||
/** Indicates that a manifest is missing */
|
||||
const val TYPE_MISSING_ANDROID_MANIFEST = 44
|
||||
|
||||
/** JCenter Maven is deprecated and it should not be used in build scripts. */
|
||||
const val TYPE_JCENTER_IS_DEPRECATED = 45
|
||||
|
||||
/** Java version used by AGP is too low. */
|
||||
const val TYPE_AGP_USED_JAVA_VERSION_TOO_LOW = 46
|
||||
|
||||
/**
|
||||
* Indicates that the project uses a compile SDK version that's newer than
|
||||
* the highest version that the build system has been tested with.
|
||||
*
|
||||
* The data is the maximum supported compile SDK version for this version
|
||||
* of the Android Gradle Plugin.
|
||||
*/
|
||||
const val TYPE_COMPILE_SDK_VERSION_TOO_HIGH = 47
|
||||
|
||||
/** Indicates that the project uses a compile SDK version that's lower than required. */
|
||||
const val TYPE_COMPILE_SDK_VERSION_TOO_LOW = 48
|
||||
|
||||
// NOTE: When adding a new type here, increment the index by 1. This index may not be consistent
|
||||
// with the corresponding value in studio_stats.proto (e.g., it could be lower by 1), because of
|
||||
// an indexing issue in the past (see http://issuetracker.google.com/138278313).
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
/** Test options for running tests - e.g. instrumented or not. */
|
||||
public interface TestOptions {
|
||||
enum Execution {
|
||||
/** On device orchestration is not used in this case. */
|
||||
HOST,
|
||||
/** On device orchestration is used. */
|
||||
ANDROID_TEST_ORCHESTRATOR,
|
||||
/** On device orchestration is used, with androidx class names. */
|
||||
ANDROIDX_TEST_ORCHESTRATOR,
|
||||
}
|
||||
|
||||
boolean getAnimationsDisabled();
|
||||
|
||||
Execution getExecution();
|
||||
}
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
|
||||
/** Model for a test variant build output */
|
||||
public interface TestVariantBuildOutput extends BaseBuildOutput {
|
||||
|
||||
/** Enum for all possible test variant types that can be returned. */
|
||||
enum TestType {
|
||||
UNIT,
|
||||
ANDROID_TEST
|
||||
}
|
||||
|
||||
String UNIT = TestType.UNIT.name();
|
||||
String ANDROID_TEST = TestType.ANDROID_TEST.name();
|
||||
|
||||
/**
|
||||
* Returns the variant name of the tested variant.
|
||||
*
|
||||
* @return the tested variant name.
|
||||
*/
|
||||
@NonNull
|
||||
String getTestedVariantName();
|
||||
|
||||
/**
|
||||
* Returns the test variant type as a String
|
||||
*
|
||||
* @return one of {@link TestType} value as a {@link String}
|
||||
*/
|
||||
@NonNull
|
||||
String getType();
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
|
||||
/**
|
||||
* Class representing the tested variants.
|
||||
*
|
||||
* This is currently used by the test modules, and contains the same pieces of information
|
||||
* as the ones used to define the tested application (and it's variant).
|
||||
*/
|
||||
public interface TestedTargetVariant {
|
||||
/**
|
||||
* Returns the Gradle path of the project that is being tested.
|
||||
*/
|
||||
@NonNull
|
||||
String getTargetProjectPath();
|
||||
|
||||
/**
|
||||
* Returns the variant of the tested project.
|
||||
*/
|
||||
@NonNull
|
||||
String getTargetVariant();
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A build Variant.
|
||||
*
|
||||
* This is the combination of a Build Type and 0+ Product Flavors (exactly one for each existing
|
||||
* Flavor Dimension).
|
||||
*
|
||||
* Build Types and Flavors both contribute source folders, so this Variant is the direct
|
||||
* representation of a set of source folders (and configuration parameters) used to build something.
|
||||
*
|
||||
* However the output of a Variant is not a single item.
|
||||
*
|
||||
* First there can be several artifacts.
|
||||
* - Main Artifact: this is the main Android output(s). The app or the library being generated.
|
||||
* - Extra Android Artifacts: these are ancillary artifacts, most likely test app(s).
|
||||
* - Extra Java artifacts: these are pure-Java ancillary artifacts (junit support for instance).
|
||||
*/
|
||||
public interface Variant {
|
||||
|
||||
/**
|
||||
* Returns the name of the variant. It is made up of the build type and flavors (if applicable)
|
||||
*
|
||||
* @return the name of the variant.
|
||||
*/
|
||||
@NonNull
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns a display name for the variant. It is made up of the build type and flavors
|
||||
* (if applicable)
|
||||
*
|
||||
* @return the name.
|
||||
*/
|
||||
@NonNull
|
||||
String getDisplayName();
|
||||
|
||||
/**
|
||||
* Returns the main artifact for this variant.
|
||||
*
|
||||
* @return the artifact.
|
||||
*/
|
||||
@NonNull
|
||||
AndroidArtifact getMainArtifact();
|
||||
|
||||
@NonNull
|
||||
Collection<AndroidArtifact> getExtraAndroidArtifacts();
|
||||
|
||||
@NonNull
|
||||
Collection<JavaArtifact> getExtraJavaArtifacts();
|
||||
|
||||
/**
|
||||
* Returns the build type. All variants have a build type, so this is never null.
|
||||
*
|
||||
* @return the name of the build type.
|
||||
*/
|
||||
@NonNull
|
||||
String getBuildType();
|
||||
|
||||
/**
|
||||
* Returns the flavors for this variants. This can be empty if no flavors are configured.
|
||||
*
|
||||
* @return a list of flavors which can be empty.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getProductFlavors();
|
||||
|
||||
/**
|
||||
* The result of the merge of all the flavors and of the main default config. If no flavors
|
||||
* are defined then this is the same as the default config.
|
||||
*
|
||||
* This is directly a ProductFlavor instance of a ProductFlavorContainer since this a composite
|
||||
* of existing ProductFlavors.
|
||||
*
|
||||
* @return the merged flavors.
|
||||
*
|
||||
* @see AndroidProject#getDefaultConfig()
|
||||
*/
|
||||
@NonNull
|
||||
ProductFlavor getMergedFlavor();
|
||||
|
||||
/**
|
||||
* Returns the list of target projects and the variants that this variant is testing.
|
||||
* This is specified for the test only variants (ones using the test plugin).
|
||||
*
|
||||
* @return all tested variants
|
||||
*/
|
||||
@NonNull
|
||||
Collection<TestedTargetVariant> getTestedTargetVariants();
|
||||
|
||||
/**
|
||||
* Returns true if this variant is instant app compatible, intended to be possibly built and
|
||||
* served in an instant app context. This is populated during sync from the project's manifest.
|
||||
* Only application modules and dynamic feature modules will set this property.
|
||||
*
|
||||
* @return true if this variant is instant app compatible
|
||||
* @since 3.3
|
||||
*/
|
||||
boolean isInstantAppCompatible();
|
||||
|
||||
/**
|
||||
* Returns all desugared methods including backported methods handled by D8 and methods provided
|
||||
* by core library desugaring. Only D8 backported methods are returned if coreLibraryDesugaring
|
||||
* is disabled or we are not able to find expected lint files from the dependency of
|
||||
* coreLibraryDesugaring configuration.
|
||||
*
|
||||
* @return all desugared methods
|
||||
* @since 4.1
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getDesugaredMethods();
|
||||
}
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model
|
||||
|
||||
/**
|
||||
* Minimum information about variants that always get transferred with the [AndroidProject]
|
||||
* irrespective of per variant sync.
|
||||
*
|
||||
* Adding new elements to this interface should be carefully considered as we want to keep this
|
||||
* instances as small as possible.
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
interface VariantBuildInformation {
|
||||
val variantName: String
|
||||
/**
|
||||
* Returns the name of the task used to generate the artifact output(s).
|
||||
*
|
||||
* @return the name of the task.
|
||||
*/
|
||||
val assembleTaskName: String
|
||||
|
||||
/**
|
||||
* Returns the absolute path for the listing file that will get updated after each build. The
|
||||
* model file will contain deployment related information like applicationId, list of APKs.
|
||||
*
|
||||
* @since 4.0
|
||||
* @return the path to a json file.
|
||||
*/
|
||||
val assembleTaskOutputListingFile: String?
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate the bundle file (.aab), or null if the task is
|
||||
* not supported.
|
||||
*
|
||||
* @since 4.0
|
||||
* @return name of the task used to generate the bundle file (.aab)
|
||||
*/
|
||||
val bundleTaskName: String?
|
||||
|
||||
/**
|
||||
* Returns the path to the listing file generated after each [.getBundleTaskName] task
|
||||
* execution. The listing file will contain a reference to the produced bundle file (.aab).
|
||||
* Returns null when [.getBundleTaskName] returns null.
|
||||
*
|
||||
* @since 4.0
|
||||
* @return the file path for the bundle model file.
|
||||
*/
|
||||
val bundleTaskOutputListingFile: String?
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate APKs via the bundle file (.aab), or null if the
|
||||
* task is not supported.
|
||||
*
|
||||
* @since 4.0
|
||||
* @return name of the task used to generate the APKs via the bundle
|
||||
*/
|
||||
val apkFromBundleTaskName: String?
|
||||
|
||||
/**
|
||||
* Returns the path to the model file generated after each [.getApkFromBundleTaskName]
|
||||
* task execution. The model will contain a reference to the folder where APKs from bundle are
|
||||
* placed into. Returns null when [.getApkFromBundleTaskName] returns null.
|
||||
*
|
||||
* @since 4.0
|
||||
* @return the file path for the [.getApkFromBundleTaskName] output model.
|
||||
*/
|
||||
val apkFromBundleTaskOutputListingFile: String?
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Model that represents a variant build output */
|
||||
@Deprecated
|
||||
public interface VariantBuildOutput extends BaseBuildOutput {
|
||||
|
||||
/**
|
||||
* Returns a possibly empty list of test variants for this variant.
|
||||
*
|
||||
* @return a {@link Collection} of {@link TestVariantBuildOutput} for all the test variants
|
||||
* testing this variant.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<TestVariantBuildOutput> getTestingVariants();
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import com.android.annotations.Nullable;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Options for build-time support for vector drawables.
|
||||
*/
|
||||
public interface VectorDrawablesOptions {
|
||||
|
||||
@Nullable
|
||||
Set<String> getGeneratedDensities();
|
||||
|
||||
@Nullable
|
||||
Boolean getUseSupportLibrary();
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @deprecated use com.android.Version instead
|
||||
* <p>TODO: remove (along with the associated version.properties) once it's no longer used by
|
||||
* the gradle build scan plugin
|
||||
*/
|
||||
@Deprecated
|
||||
public final class Version {
|
||||
public static final String ANDROID_GRADLE_PLUGIN_VERSION;
|
||||
public static final String ANDROID_TOOLS_BASE_VERSION;
|
||||
public static final int BUILDER_MODEL_API_VERSION;
|
||||
public static final int BUILDER_NATIVE_MODEL_API_VERSION;
|
||||
|
||||
static {
|
||||
Properties properties = new Properties();
|
||||
InputStream stream =
|
||||
new BufferedInputStream(Version.class.getResourceAsStream("version.properties"));
|
||||
try {
|
||||
try {
|
||||
properties.load(stream);
|
||||
} finally {
|
||||
stream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
ANDROID_GRADLE_PLUGIN_VERSION = properties.getProperty("buildVersion");
|
||||
ANDROID_TOOLS_BASE_VERSION = properties.getProperty("baseVersion");
|
||||
BUILDER_MODEL_API_VERSION = Integer.parseInt(properties.getProperty("apiVersion"));
|
||||
BUILDER_NATIVE_MODEL_API_VERSION =
|
||||
Integer.parseInt(properties.getProperty("nativeApiVersion"));
|
||||
}
|
||||
|
||||
private Version() {}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model;
|
||||
|
||||
/** Options for view binding */
|
||||
public interface ViewBindingOptions {
|
||||
|
||||
/** Whether to enable view binding. */
|
||||
boolean isEnabled();
|
||||
}
|
||||
-73
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.level2;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.builder.model.AndroidProject;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A set of dependency Graphs.
|
||||
*
|
||||
* It contains both the compile and the package graphs, through the latter could be empty in
|
||||
* non full sync.
|
||||
*
|
||||
* Each graph is fairly lightweight, with each artifact node being mostly an address, children,
|
||||
* and modifiers that are specific to this particular usage of the artifact rather than
|
||||
* artifact properties.*
|
||||
*
|
||||
* @see AndroidProject#PROPERTY_BUILD_MODEL_FEATURE_FULL_DEPENDENCIES
|
||||
*/
|
||||
public interface DependencyGraphs {
|
||||
|
||||
/**
|
||||
* Returns the compile dependency graph.
|
||||
*/
|
||||
@NonNull
|
||||
List<GraphItem> getCompileDependencies();
|
||||
|
||||
/**
|
||||
* Returns the package dependency graph.
|
||||
*
|
||||
* Only valid in full dependency mode.
|
||||
*/
|
||||
@NonNull
|
||||
List<GraphItem> getPackageDependencies();
|
||||
|
||||
/**
|
||||
* Returns the list of provided libraries.
|
||||
*
|
||||
* The values in the list match the values returned by {@link GraphItem#getArtifactAddress()}
|
||||
* and {@link Library#getArtifactAddress()}.
|
||||
*
|
||||
* Only valid in full dependency mode.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getProvidedLibraries();
|
||||
|
||||
/**
|
||||
* Returns the list of skipped libraries.
|
||||
*
|
||||
* The values in the list match the values returned by {@link GraphItem#getArtifactAddress()}
|
||||
* and {@link Library#getArtifactAddress()}.
|
||||
*
|
||||
* Only valid in full dependency mode.
|
||||
*/
|
||||
@NonNull
|
||||
List<String> getSkippedLibraries();
|
||||
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.level2;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.builder.model.AndroidProject;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Global map of all the {@link Library} instances used in a single or multi-module gradle project.
|
||||
*
|
||||
* This is a separate model to query (the same way {@link AndroidProject} is queried). It must
|
||||
* be queried after all the models have been queried for their {@link AndroidProject}.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
public interface GlobalLibraryMap {
|
||||
|
||||
/**
|
||||
* the list of external libraries used by all the variants in the module.
|
||||
*
|
||||
* @return the map of address to library
|
||||
*/
|
||||
@NonNull
|
||||
Map<String, Library> getLibraries();
|
||||
}
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.level2;
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A node in a dependency graph, representing a direct or transitive dependency.
|
||||
*
|
||||
* This does not directly contain artifact information, instead it focuses on the graph
|
||||
* information (transitive dependencies) as well as the usage of this particular dependency
|
||||
* in this node of the graph (ie what are its modifiers: what version was originally requested.)
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
public interface GraphItem {
|
||||
|
||||
/**
|
||||
* Returns the artifact address in a unique way.
|
||||
*
|
||||
* This is either a module path for sub-modules, or a maven coordinate for external
|
||||
* dependencies.
|
||||
*
|
||||
* The maven coordinates are in the format: groupId:artifactId:version[:classifier][@extension]
|
||||
*
|
||||
*/
|
||||
@NonNull
|
||||
String getArtifactAddress();
|
||||
|
||||
/**
|
||||
* Returns this library's Maven coordinates, as requested in the build file.
|
||||
*/
|
||||
@Nullable
|
||||
String getRequestedCoordinates();
|
||||
|
||||
/**
|
||||
* Return the direct dependency of this node.
|
||||
*/
|
||||
@NonNull
|
||||
List<GraphItem> getDependencies();
|
||||
}
|
||||
-246
@@ -1,246 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.level2;
|
||||
|
||||
|
||||
import com.android.annotations.NonNull;
|
||||
import com.android.annotations.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Represent a variant/module/artifact dependency.
|
||||
* @since 2.3
|
||||
*/
|
||||
public interface Library {
|
||||
|
||||
int LIBRARY_ANDROID = 1;
|
||||
int LIBRARY_JAVA = 2;
|
||||
int LIBRARY_MODULE = 3;
|
||||
|
||||
/**
|
||||
* The type of the dependency
|
||||
*
|
||||
* @return the type
|
||||
* @see #LIBRARY_ANDROID
|
||||
* @see #LIBRARY_JAVA
|
||||
* @see #LIBRARY_MODULE
|
||||
*/
|
||||
int getType();
|
||||
|
||||
/**
|
||||
* Returns the artifact address in a unique way.
|
||||
*
|
||||
* This is either a module path for sub-modules (with optional variant name), or a maven
|
||||
* coordinate for external dependencies.
|
||||
*/
|
||||
@NonNull
|
||||
String getArtifactAddress();
|
||||
|
||||
/**
|
||||
* Returns the artifact location.
|
||||
*/
|
||||
@NonNull
|
||||
File getArtifact();
|
||||
|
||||
/**
|
||||
* Returns the build id.
|
||||
*
|
||||
* <p>This is only valid if the {@link #getProjectPath()} is not null. However this can still be
|
||||
* null if this is the root project.
|
||||
*
|
||||
* @return the build id or null.
|
||||
*/
|
||||
@Nullable
|
||||
String getBuildId();
|
||||
|
||||
/**
|
||||
* Returns the gradle path.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_MODULE}
|
||||
*/
|
||||
@Nullable
|
||||
String getProjectPath();
|
||||
|
||||
/**
|
||||
* Returns an optional variant name if the consumed artifact of the library is associated
|
||||
* to one.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_MODULE}
|
||||
*/
|
||||
@Nullable
|
||||
String getVariant();
|
||||
|
||||
/**
|
||||
* Returns the location of the unzipped bundle folder.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*/
|
||||
@NonNull
|
||||
File getFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the manifest relative to the folder.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*/
|
||||
@NonNull
|
||||
String getManifest();
|
||||
|
||||
/**
|
||||
* Returns the location of the jar file to use for compiling and packaging.
|
||||
*
|
||||
* <p>Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}.
|
||||
*
|
||||
* @return the path to the jar file. The path may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
String getJarFile();
|
||||
|
||||
/**
|
||||
* Returns the location of the jar file to use for compilation.
|
||||
*
|
||||
* <p>Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}.
|
||||
*
|
||||
* @return path to the jar file used for compilation. The path may not point to an existing
|
||||
* file.
|
||||
*/
|
||||
@NonNull
|
||||
String getCompileJarFile();
|
||||
|
||||
/**
|
||||
* Returns the location of the res folder.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the res folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
String getResFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the namespaced resources static library (res.apk).
|
||||
*
|
||||
* <p>Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* <p>TODO(b/109854607): When rewriting dependencies, this should be populated with the
|
||||
* rewritten artifact, which will not be in the exploded AAR directory.
|
||||
*
|
||||
* @return the static library apk. Null if the library is not namespaced.
|
||||
*/
|
||||
@Nullable
|
||||
File getResStaticLibrary();
|
||||
|
||||
/**
|
||||
* Returns the location of the assets folder.
|
||||
*
|
||||
* <p>Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the assets folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
String getAssetsFolder();
|
||||
|
||||
/**
|
||||
* Returns the list of local Jar files that are included in the dependency.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a list of File. May be empty but not null.
|
||||
*/
|
||||
@NonNull
|
||||
Collection<String> getLocalJars();
|
||||
|
||||
/**
|
||||
* Returns the location of the jni libraries folder.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
String getJniFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the aidl import folder.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
String getAidlFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the renderscript import folder.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the folder. The file may not point to an existing folder.
|
||||
*/
|
||||
@NonNull
|
||||
String getRenderscriptFolder();
|
||||
|
||||
/**
|
||||
* Returns the location of the proguard files.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
String getProguardRules();
|
||||
|
||||
/**
|
||||
* Returns the location of the lint jar.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the jar file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
String getLintJar();
|
||||
|
||||
/**
|
||||
* Returns the location of the external annotations zip file (which may not exist)
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the zip file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
String getExternalAnnotations();
|
||||
|
||||
/**
|
||||
* Returns the location of an optional file that lists the only
|
||||
* resources that should be considered public.
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*
|
||||
* @return a File for the file. The file may not point to an existing file.
|
||||
*/
|
||||
@NonNull
|
||||
String getPublicResources();
|
||||
|
||||
/**
|
||||
* Returns the location of the text symbol file
|
||||
*
|
||||
* Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID}
|
||||
*/
|
||||
@NonNull
|
||||
String getSymbolFile();
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2
|
||||
|
||||
/**
|
||||
* Base interface for all model interfaces.
|
||||
*/
|
||||
interface AndroidModel
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2
|
||||
|
||||
import java.io.File
|
||||
|
||||
interface CustomSourceDirectory {
|
||||
/**
|
||||
* Source name as represented by the user. It must be unique for the project.
|
||||
*/
|
||||
val sourceTypeName: String
|
||||
|
||||
/**
|
||||
* the single source folder for the source type.
|
||||
*/
|
||||
val directory: File
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2
|
||||
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Represents a model sync file.
|
||||
*
|
||||
* A model sync file is produced by the Android Gradle Plugin during the execution phase and
|
||||
* contains information that cannot be determined at configuration time.
|
||||
*/
|
||||
interface ModelSyncFile {
|
||||
/**
|
||||
* Enum of all sync types supported by this plugin.
|
||||
*/
|
||||
enum class ModelSyncType {
|
||||
|
||||
/**
|
||||
* Sync that will contain elements of type com.android.ide.model.sync.AppIdListSync
|
||||
*/
|
||||
APP_ID_LIST,
|
||||
|
||||
/**
|
||||
* Basic sync type will contain elements of type com.android.ide.model.sync.Variant.
|
||||
*
|
||||
*/
|
||||
BASIC,
|
||||
}
|
||||
|
||||
/**
|
||||
* [ModelSyncType] for this file.
|
||||
*/
|
||||
val modelSyncType: ModelSyncType
|
||||
|
||||
/**
|
||||
* Name of the task that can produce the model sync file. The task must have executed
|
||||
* successfully for the [syncFile] file to be available.
|
||||
*/
|
||||
val taskName: String
|
||||
|
||||
/**
|
||||
* Sync file currently in the proto format.
|
||||
*
|
||||
* The content depends on the [modelSyncType]
|
||||
*/
|
||||
val syncFile: File
|
||||
}
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.dsl
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Base config object for Build Type and Product flavor.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface BaseConfig: AndroidModel {
|
||||
|
||||
/**
|
||||
* The name
|
||||
*/
|
||||
val name: String
|
||||
|
||||
/**
|
||||
* The application id suffix applied to this base config.
|
||||
*/
|
||||
val applicationIdSuffix: String?
|
||||
|
||||
/**
|
||||
* The version name suffix of this flavor or null if none have been set.
|
||||
* This is only the value set on this product flavor, not necessarily the actual
|
||||
* version name suffix used.
|
||||
*/
|
||||
val versionNameSuffix: String?
|
||||
|
||||
/**
|
||||
* Map of Build Config Fields where the key is the field name.
|
||||
* If null, buildConfig is disabled in the project.
|
||||
*/
|
||||
val buildConfigFields: Map<String, ClassField>?
|
||||
|
||||
/**
|
||||
* Map of generated res values where the key is the res name.
|
||||
* If null, res values are disabled in the project.
|
||||
*/
|
||||
val resValues: Map<String, ClassField>?
|
||||
|
||||
/**
|
||||
* Specifies the ProGuard configuration files that the plugin should use.
|
||||
*
|
||||
* There are two ProGuard rules files that ship with the Android plugin and are used by
|
||||
* default:
|
||||
*
|
||||
* * proguard-android.txt
|
||||
* * proguard-android-optimize.txt
|
||||
*
|
||||
* `proguard-android-optimize.txt` is identical to `proguard-android.txt`,
|
||||
* except with optimizations enabled. You can use [getDefaultProguardFile(String)]
|
||||
* to return the full path of the files.
|
||||
*
|
||||
* @return a non-null collection of files.
|
||||
* @see .getTestProguardFiles
|
||||
*/
|
||||
val proguardFiles: Collection<File>
|
||||
|
||||
/** The collection of proguard rule files for consumers of the library to use. */
|
||||
val consumerProguardFiles: Collection<File>
|
||||
|
||||
/** The collection of proguard rule files to use for the test APK. */
|
||||
val testProguardFiles: Collection<File>
|
||||
|
||||
/**
|
||||
* The map of key value pairs for placeholder substitution in the android manifest file.
|
||||
*
|
||||
* This map will be used by the manifest merger.
|
||||
*/
|
||||
val manifestPlaceholders: Map<String, Any>
|
||||
|
||||
/**
|
||||
* Returns whether multi-dex is enabled.
|
||||
*
|
||||
* This can be null if the flag is not set, in which case the default value is used.
|
||||
*/
|
||||
val multiDexEnabled: Boolean?
|
||||
|
||||
val multiDexKeepFile: File?
|
||||
val multiDexKeepProguard: File?
|
||||
|
||||
/**
|
||||
* Whether this is marked as a default value in its dimension
|
||||
*/
|
||||
val isDefault: Boolean?
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.dsl
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* a Build Type. This is only the configuration of the build type.
|
||||
*
|
||||
* It does not include the sources or the dependencies. Those are available on the container
|
||||
* or in the artifact info.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*
|
||||
* @see BuildTypeContainer
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface BuildType : BaseConfig, AndroidModel {
|
||||
/** Whether the build type is configured to generate a debuggable apk. */
|
||||
val isDebuggable: Boolean
|
||||
|
||||
/** Whether the build type is configured to work with profilers. */
|
||||
val isProfileable: Boolean
|
||||
|
||||
/** Whether the build type is configured to be build with support for code coverage. */
|
||||
val isTestCoverageEnabled: Boolean
|
||||
|
||||
/** Whether the build type is configured to be build with support for pseudolocales. */
|
||||
val isPseudoLocalesEnabled: Boolean
|
||||
|
||||
/** Whether the build type is configured to generate an apk with debuggable native code. */
|
||||
val isJniDebuggable: Boolean
|
||||
|
||||
/** Whether the build type is configured to generate an apk with debuggable renderscript code. */
|
||||
val isRenderscriptDebuggable: Boolean
|
||||
|
||||
/** The optimization level of the renderscript compilation. */
|
||||
val renderscriptOptimLevel: Int
|
||||
|
||||
/**
|
||||
* Specifies whether to enable code shrinking for this build type.
|
||||
*
|
||||
* By default, when you enable code shrinking by setting this property to `true`,
|
||||
* the Android plugin uses ProGuard.
|
||||
*
|
||||
* To learn more, read
|
||||
* [Shrink Your Code and Resources](https://developer.android.com/studio/build/shrink-code.html).
|
||||
*/
|
||||
val isMinifyEnabled: Boolean
|
||||
|
||||
/** Whether zipalign is enabled for this build type. */
|
||||
val isZipAlignEnabled: Boolean
|
||||
|
||||
/**Whether the variant embeds the micro app. */
|
||||
val isEmbedMicroApp: Boolean
|
||||
|
||||
/** The associated signing config or null if none are set on the build type. */
|
||||
val signingConfig: String?
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.dsl
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* A Simple class field with name, type and value, all as strings.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface ClassField: AndroidModel {
|
||||
val type: String
|
||||
val name: String
|
||||
val value: String
|
||||
val documentation: String
|
||||
val annotations: Set<String>
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.dsl
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* Information about whether the dependencies are packaged in the apk/bundle.
|
||||
*
|
||||
* @see `com.android.build.api.dsl.DependenciesInfo`
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface DependenciesInfo: AndroidModel {
|
||||
val includeInApk: Boolean
|
||||
val includeInBundle: Boolean
|
||||
}
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.dsl
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* Options for APK packaging.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface PackagingOptions: AndroidModel {
|
||||
/**
|
||||
* Glob patterns to exclude from packaging.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val excludes: Set<String>
|
||||
|
||||
/**
|
||||
* Glob patterns to pick first.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val pickFirsts: Set<String>
|
||||
|
||||
/**
|
||||
* Glob patterns to merge.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val merges: Set<String>
|
||||
|
||||
/**
|
||||
* Glob patterns to exclude native libraries from being stripped.
|
||||
*
|
||||
* @return a set of glob pattern that use forward slash as a separator
|
||||
*/
|
||||
val doNotStrip: Set<String>
|
||||
}
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.dsl
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
import com.android.builder.model.v2.ide.VectorDrawablesOptions
|
||||
import com.android.builder.model.v2.ide.ApiVersion
|
||||
|
||||
/**
|
||||
* a Product Flavor. This is only the configuration of the flavor.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*
|
||||
* It does not include the sources or the dependencies. Those are available on the container
|
||||
* or in the artifact info.
|
||||
*
|
||||
* @see ProductFlavorContainer
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface ProductFlavor : BaseConfig, AndroidModel {
|
||||
|
||||
/**
|
||||
* the optional dimension name.
|
||||
*
|
||||
* This is null for default Config.
|
||||
*/
|
||||
val dimension: String?
|
||||
|
||||
/**
|
||||
* The name of the product flavor. This is only the value set on this product flavor.
|
||||
* To get the final application id name, use [AndroidArtifact.getApplicationId].
|
||||
*/
|
||||
val applicationId: String?
|
||||
|
||||
/**
|
||||
* The version code associated with this flavor or null if none have been set.
|
||||
* This is only the value set on this product flavor, not necessarily the actual
|
||||
* version code used.
|
||||
*/
|
||||
val versionCode: Int?
|
||||
|
||||
/** The version name. This is only the value set on this product flavor.
|
||||
* To get the final value, use [Variant.getMergedFlavor] with
|
||||
* [.getVersionNameSuffix] and [BuildType.getVersionNameSuffix].
|
||||
*/
|
||||
val versionName: String?
|
||||
|
||||
/** The minSdkVersion, or null if not specified. This is only the value set on this product flavor. */
|
||||
val minSdkVersion: ApiVersion?
|
||||
|
||||
/** The targetSdkVersion, or null if not specified. This is only the value set on this product flavor. */
|
||||
val targetSdkVersion: ApiVersion?
|
||||
|
||||
/** The maxSdkVersion, or null if not specified. This is only the value set on this produce flavor. */
|
||||
val maxSdkVersion: Int?
|
||||
|
||||
/**
|
||||
* The renderscript target api, or null if not specified. This is only the value set on this product flavor.
|
||||
* TODO: make final renderscript target api available through the model
|
||||
*/
|
||||
val renderscriptTargetApi: Int?
|
||||
|
||||
/**
|
||||
* Whether the renderscript code should be compiled in support mode to
|
||||
* make it compatible with older versions of Android.
|
||||
*
|
||||
* True if support mode is enabled, false if not, and null if not specified.
|
||||
*/
|
||||
val renderscriptSupportModeEnabled: Boolean?
|
||||
|
||||
/**
|
||||
* Whether the renderscript BLAS support lib should be used to
|
||||
* make it compatible with older versions of Android.
|
||||
*
|
||||
* True if BLAS support lib is enabled, false if not, and null if not specified.
|
||||
*/
|
||||
val renderscriptSupportModeBlasEnabled: Boolean?
|
||||
|
||||
/**
|
||||
* Whether the renderscript code should be compiled to generate C/C++ bindings.
|
||||
* True for C/C++ generation, false for Java, null if not specified.
|
||||
*/
|
||||
val renderscriptNdkModeEnabled: Boolean?
|
||||
|
||||
/**
|
||||
* The test application id. This is only the value set on this product flavor.
|
||||
* To get the final value, use [Variant.getExtraAndroidArtifacts] with
|
||||
* [AndroidProject.ARTIFACT_ANDROID_TEST] and then
|
||||
* [AndroidArtifact.getApplicationId]
|
||||
*/
|
||||
val testApplicationId: String?
|
||||
|
||||
/**
|
||||
* The test instrumentation runner. This is only the value set on this product flavor.
|
||||
* TODO: make test instrumentation runner available through the model.
|
||||
*/
|
||||
val testInstrumentationRunner: String?
|
||||
|
||||
/** The arguments for the test instrumentation runner.*/
|
||||
val testInstrumentationRunnerArguments: Map<String, String>
|
||||
|
||||
/** The handlingProfile value. This is only the value set on this product flavor. */
|
||||
val testHandleProfiling: Boolean?
|
||||
|
||||
/** The functionalTest value. This is only the value set on this product flavor. */
|
||||
val testFunctionalTest: Boolean?
|
||||
|
||||
/**
|
||||
* The resource configuration for this variant.
|
||||
*
|
||||
* This is the list of -c parameters for aapt.
|
||||
*/
|
||||
val resourceConfigurations: Collection<String>
|
||||
|
||||
/** The associated signing config or null if none are set on the product flavor.*/
|
||||
val signingConfig: String?
|
||||
|
||||
val vectorDrawables: VectorDrawablesOptions
|
||||
/**
|
||||
* Whether to enable unbundling mode for embedded wear app.
|
||||
*
|
||||
* If true, this enables the app to transition from an embedded wear app to one
|
||||
* distributed by the play store directly.
|
||||
*/
|
||||
val wearAppUnbundled: Boolean?
|
||||
}
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.dsl
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* A Signing Configuration.
|
||||
*
|
||||
* This is an interface for the gradle tooling api, and should only be used from Android Studio.
|
||||
* It is not part of the DSL & API interfaces of the Android Gradle Plugin.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface SigningConfig: AndroidModel {
|
||||
/** Returns the name of the Signing config */
|
||||
val name: String
|
||||
|
||||
/** The keystore file. */
|
||||
val storeFile: File?
|
||||
|
||||
/** The keystore password. */
|
||||
val storePassword: String?
|
||||
|
||||
/** The key alias name. */
|
||||
val keyAlias: String?
|
||||
|
||||
/** The key password. */
|
||||
val keyPassword: String?
|
||||
|
||||
/** Signing using JAR Signature Scheme (aka v1 scheme) is enabled. */
|
||||
val enableV1Signing: Boolean?
|
||||
|
||||
/** Signing using APK Signature Scheme v2 (aka v2 scheme) is enabled. */
|
||||
val enableV2Signing: Boolean?
|
||||
|
||||
/** Signing using JAR Signature Scheme v3 (aka v3 scheme) is enabled. */
|
||||
val enableV3Signing: Boolean?
|
||||
|
||||
/** Signing using JAR Signature Scheme v4 (aka v4 scheme) is enabled. */
|
||||
val enableV4Signing: Boolean?
|
||||
|
||||
/**
|
||||
* Whether the config is fully configured for signing.
|
||||
*
|
||||
* i.e. all the required information are present.
|
||||
*/
|
||||
val isSigningReady: Boolean
|
||||
}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* Options for aapt, but only those needed by the IDE.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface AaptOptions: AndroidModel {
|
||||
enum class Namespacing {
|
||||
/**
|
||||
* Resources are not namespaced.
|
||||
*
|
||||
*
|
||||
* They are merged at the application level, as was the behavior with AAPT1
|
||||
*/
|
||||
DISABLED,
|
||||
|
||||
/**
|
||||
* Resources must be namespaced.
|
||||
*
|
||||
*
|
||||
* Each library is compiled in to an AAPT2 static library with its own namespace.
|
||||
*
|
||||
*
|
||||
* Projects using this *cannot* consume non-namespaced dependencies.
|
||||
*/
|
||||
REQUIRED
|
||||
// TODO: add more modes as implemented.
|
||||
}
|
||||
|
||||
/** Returns the resource namespacing strategy for this sub-project */
|
||||
val namespacing: Namespacing
|
||||
}
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.ModelSyncFile
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* The base information for all generated artifacts
|
||||
*/
|
||||
interface AbstractArtifact {
|
||||
|
||||
/**
|
||||
* @return the name of the task used to compile the code.
|
||||
*/
|
||||
val compileTaskName: String
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate the artifact output(s).
|
||||
*
|
||||
* @return the name of the task.
|
||||
*/
|
||||
val assembleTaskName: String
|
||||
|
||||
/**
|
||||
* Set of folders containing the result of the compilation step(s)
|
||||
*/
|
||||
val classesFolders: Set<File>
|
||||
|
||||
/**
|
||||
* Returns names of tasks that need to be run when setting up the IDE project. After these
|
||||
* tasks have run, all the generated source files etc. that the IDE needs to know about should
|
||||
* be in place.
|
||||
*/
|
||||
val ideSetupTaskNames: Set<String>
|
||||
|
||||
/**
|
||||
* Returns all the source folders that are generated. This is typically folders for the R,
|
||||
* the aidl classes, and the renderscript classes.
|
||||
*
|
||||
* @return a list of folders.
|
||||
* @since 1.2
|
||||
*/
|
||||
val generatedSourceFolders: Collection<File>
|
||||
|
||||
/**
|
||||
* Returns all the [ModelSyncFile] for this artifact.
|
||||
*
|
||||
* @return a list of [ModelSyncFile]
|
||||
* @since 7.1
|
||||
*/
|
||||
val modelSyncFiles: Collection<ModelSyncFile>
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* Options for adb.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface AdbOptions: AndroidModel {
|
||||
|
||||
/** The time out used for all adb operations. */
|
||||
val timeOutInMs: Int
|
||||
|
||||
/** The list of APK installation options. */
|
||||
val installOptions: Collection<String>?
|
||||
}
|
||||
-123
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* An Android Artifact.
|
||||
*
|
||||
* This is the entry point for the output of a [Variant]. This can be more than one
|
||||
* output in the case of multi-apk where more than one APKs are generated from the same set
|
||||
* of sources.
|
||||
*/
|
||||
interface AndroidArtifact : AbstractArtifact, AndroidModel {
|
||||
|
||||
/**
|
||||
* The min SDK version of this artifact
|
||||
*/
|
||||
val minSdkVersion: ApiVersion
|
||||
|
||||
/**
|
||||
* The target SDK version override. If null, there is no override and the value may
|
||||
* be coming from the manifest(s) if present there.
|
||||
* If not null, this is the final resolved value.
|
||||
*/
|
||||
val targetSdkVersionOverride: ApiVersion?
|
||||
|
||||
/**
|
||||
* The max SDK version of this artifact, or null if not set
|
||||
*/
|
||||
val maxSdkVersion: Int?
|
||||
|
||||
/**
|
||||
* Returns whether the output file is signed. This can only be true for the main apk of an
|
||||
* application project.
|
||||
*
|
||||
* @return true if the app is signed.
|
||||
*/
|
||||
val isSigned: Boolean
|
||||
|
||||
/**
|
||||
* Returns the name of the [SigningConfig] used for the signing. If none are setup or if
|
||||
* this is not the main artifact of an application project, then this is null.
|
||||
*
|
||||
* @return the name of the setup signing config.
|
||||
*/
|
||||
val signingConfigName: String?
|
||||
|
||||
/**
|
||||
* Returns the name of the task used to generate the source code. The actual value might
|
||||
* depend on the build system front end.
|
||||
*
|
||||
* @return the name of the code generating task.
|
||||
*/
|
||||
val sourceGenTaskName: String
|
||||
|
||||
/**
|
||||
* The name of the task used to generate the resources. The actual value might
|
||||
* depend on the build system front end.
|
||||
*
|
||||
* Maybe null if the artifact does not support Android resources
|
||||
*/
|
||||
val resGenTaskName: String?
|
||||
|
||||
/**
|
||||
* Returns all the resource folders that are generated. This is typically the renderscript
|
||||
* output and the merged resources.
|
||||
*
|
||||
* @return a list of folder.
|
||||
*/
|
||||
val generatedResourceFolders: Collection<File>
|
||||
|
||||
/**
|
||||
* Returns the ABI filters associated with the artifact, or null if there are no filters.
|
||||
*
|
||||
* If the list contains values, then the artifact only contains these ABIs and excludes
|
||||
* others.
|
||||
*/
|
||||
val abiFilters: Set<String>?
|
||||
|
||||
/**
|
||||
* Returns the absolute path for the listing file that will get updated after each build. The
|
||||
* model file will contain deployment related information like applicationId, list of APKs.
|
||||
*
|
||||
* This is null for variants that do not generate APKs (libraries).
|
||||
*
|
||||
* @return the path to a json file.
|
||||
*/
|
||||
val assembleTaskOutputListingFile: File?
|
||||
|
||||
/**
|
||||
* The test info, if applicable, otherwise null
|
||||
*/
|
||||
val testInfo: TestInfo?
|
||||
|
||||
/**
|
||||
* The bundle info if applicable, otherwise null.
|
||||
*
|
||||
* This is only applicable to the main artifact of the APPLICATION modules. All other cases
|
||||
* this should be null.
|
||||
*/
|
||||
val bundleInfo: BundleInfo?
|
||||
|
||||
/**
|
||||
* Returns the code shrinker used by this artifact or null if no shrinker is used to build this
|
||||
* artifact.
|
||||
*/
|
||||
val codeShrinker: CodeShrinker?
|
||||
}
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
/**
|
||||
* Represents various AGP project-wide flags.
|
||||
*
|
||||
* This class is only for use in the Gradle tooling model. On the IDE side use
|
||||
* `IdeAndroidGradlePluginProjectFlags` which provides an interpreted view of the flags.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface AndroidGradlePluginProjectFlags {
|
||||
/**
|
||||
* Boolean flags for behavior changes in AGP that Android Studio needs to know about.
|
||||
*
|
||||
* Studio uses the legacy default for AGPs that do not specify that flag.
|
||||
*
|
||||
* Flags **must** never be removed from here. This is to avoid issues when the
|
||||
* current version of studio fetches models from a project that has a legacy flag set. They can
|
||||
* be marked as `@Deprecated` and the getter removed from `IdeAndroidGradlePluginProjectFlags`
|
||||
*/
|
||||
enum class BooleanFlag(
|
||||
/**
|
||||
* The apparent value of this flag from Studio if it is not explicitly set in the AGP model.
|
||||
*
|
||||
* As Studio can open projects from older Android Gradle Plugins this is used
|
||||
* to supply a value if it was not supplied by the build system.
|
||||
*
|
||||
* This could be used because:
|
||||
*
|
||||
* 1. The AGP version used does not support this model at all.
|
||||
* 2. The AGP version used supports this model but predates the introduction of this flag.
|
||||
* 3. The AGP version used supports this model and this flag but did not explicitly set a
|
||||
* value for it.
|
||||
*/
|
||||
private val legacyDefault: Boolean) {
|
||||
/**
|
||||
* Whether the R class in applications and dynamic features has constant IDs.
|
||||
*
|
||||
* If they are constant they can be inlined by the java compiler and used in places that
|
||||
* require constants such as annotations and cases of switch statements.
|
||||
*/
|
||||
APPLICATION_R_CLASS_CONSTANT_IDS(true),
|
||||
|
||||
/**
|
||||
* Whether the R class in instrumentation tests has constant IDs.
|
||||
*
|
||||
* If they are constant they can be inlined by the java compiler and used in places that
|
||||
* require constants such as annotations and cases of switch statements.
|
||||
*/
|
||||
TEST_R_CLASS_CONSTANT_IDS(true),
|
||||
|
||||
/**
|
||||
* Whether the R class generated for this project is transitive.
|
||||
*
|
||||
* If it is transitive it will contain all of the resources defined in its transitive
|
||||
* dependencies alongside those defined in this project. If non-transitive it will only
|
||||
* contain the resources defined in this project.
|
||||
*/
|
||||
TRANSITIVE_R_CLASS(true),
|
||||
|
||||
/** Whether the jetpack Compose feature is enabled for this project. */
|
||||
JETPACK_COMPOSE(false),
|
||||
|
||||
/** Whether the ML model binding feature is enabled for this project. */
|
||||
ML_MODEL_BINDING(false),
|
||||
|
||||
/** Whether the Android Test Platform is enabled for this project. */
|
||||
UNIFIED_TEST_PLATFORM(false),
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* Returns the value of this flag for the given gradle project flags.
|
||||
*
|
||||
* If the value is not supplied by the build system, returns the legacyDefault.
|
||||
*/
|
||||
fun getValue(flags: AndroidGradlePluginProjectFlags): Boolean {
|
||||
return flags.getFlagValue(name) ?: legacyDefault
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not directly call this method, use by BooleanFlag.FLAG_OF_INTEREST.getValue(flags)
|
||||
*
|
||||
* Uses the string of the enum constant rather than the enum itself to avoid the Gradel tooling
|
||||
* api proxy throwing if the enum constant is not present on the AGP side.
|
||||
* Returns null if the flag is unknown, or if the value is not set.
|
||||
*/
|
||||
fun getFlagValue(flagName: String): Boolean?
|
||||
}
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Data for Android external Libraries
|
||||
*/
|
||||
interface AndroidLibraryData {
|
||||
|
||||
/**
|
||||
* The location of the manifest file.
|
||||
*/
|
||||
val manifest: File
|
||||
|
||||
/**
|
||||
* The list of jar files for compilation.
|
||||
*/
|
||||
val compileJarFiles: List<File>
|
||||
|
||||
/**
|
||||
* The list of jar files for runtime/packaging.
|
||||
*/
|
||||
val runtimeJarFiles: List<File>
|
||||
|
||||
/**
|
||||
* The android resource folder.
|
||||
*
|
||||
* The folder may not exist.
|
||||
*/
|
||||
val resFolder: File
|
||||
|
||||
/**
|
||||
* The namespaced resources static library (res.apk).
|
||||
*/
|
||||
val resStaticLibrary: File
|
||||
|
||||
/**
|
||||
* The assets folder.
|
||||
*
|
||||
* The folder may not exist.
|
||||
*/
|
||||
val assetsFolder: File
|
||||
|
||||
/**
|
||||
* The jni libraries folder.
|
||||
*
|
||||
* The folder may not exist.
|
||||
*/
|
||||
val jniFolder: File
|
||||
|
||||
/**
|
||||
* The AIDL import folder
|
||||
*
|
||||
* The folder may not exist.
|
||||
*/
|
||||
val aidlFolder: File
|
||||
|
||||
/**
|
||||
* The RenderScript import folder
|
||||
*
|
||||
* The folder may not exist.
|
||||
*/
|
||||
val renderscriptFolder: File
|
||||
|
||||
/**
|
||||
* The proguard file rule.
|
||||
*
|
||||
* The file may not exist.
|
||||
*/
|
||||
val proguardRules: File
|
||||
|
||||
/**
|
||||
* the zip file with external annotations
|
||||
*
|
||||
* The file may not exist.
|
||||
*/
|
||||
val externalAnnotations: File
|
||||
|
||||
/**
|
||||
* The file listing the public resources
|
||||
*
|
||||
* The file may not exist.
|
||||
*/
|
||||
val publicResources: File
|
||||
|
||||
/**
|
||||
* The symbol list file
|
||||
*
|
||||
* The file may not exist.
|
||||
*/
|
||||
val symbolFile: File
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* Represents the version of an Android Platform.
|
||||
*
|
||||
* A version is defined by an API level and an optional code name.
|
||||
*
|
||||
* Release versions of the Android platform are identified by their API level (integer),
|
||||
* (technically the code name for release version is "REL" but this class will return
|
||||
* `null` instead.)
|
||||
*
|
||||
* Preview versions of the platform are identified by a code name. Their API level
|
||||
* is usually set to the value of the previous platform.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface ApiVersion: AndroidModel {
|
||||
/**
|
||||
* The api level as an integer.
|
||||
*
|
||||
* For target that are in preview mode, this can be superseded by [codename].
|
||||
*
|
||||
* @see codename
|
||||
*/
|
||||
val apiLevel: Int
|
||||
|
||||
/**
|
||||
* The version code name if applicable, null otherwise.
|
||||
*
|
||||
* If the codename is non null, then the API level should be ignored, and this should be
|
||||
* used as a unique identifier of the target instead.
|
||||
*/
|
||||
val codename: String?
|
||||
}
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* The dependencies information for a given artifact.
|
||||
*
|
||||
* It contains the compile graph, always, and optionally the runtime graph.
|
||||
*
|
||||
* Each graph is fairly lightweight, with each artifact node being mostly an address, children,
|
||||
* and modifiers that are specific to this particular usage of the artifact rather than
|
||||
* artifact properties.*
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface ArtifactDependencies: AndroidModel {
|
||||
/**
|
||||
* The compile dependency graph.
|
||||
*/
|
||||
val compileDependencies: List<GraphItem>
|
||||
|
||||
/**
|
||||
* The runtime dependency graph.
|
||||
*/
|
||||
val runtimeDependencies: List<GraphItem>
|
||||
|
||||
val unresolvedDependencies: List<UnresolvedDependency>
|
||||
}
|
||||
|
||||
interface UnresolvedDependency {
|
||||
val name: String
|
||||
val cause: String?
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
/**
|
||||
* The base information for all generated artifacts
|
||||
*/
|
||||
interface BasicArtifact {
|
||||
|
||||
/**
|
||||
* A SourceProvider specific to the variant. This can be null if there is no flavors as
|
||||
* the "variant" is equal to the build type.
|
||||
*/
|
||||
val variantSourceProvider: SourceProvider?
|
||||
|
||||
/**
|
||||
* A SourceProvider specific to the flavor combination.
|
||||
*
|
||||
* For instance if there are 2 dimensions, then this would be Flavor1Flavor2, and would be
|
||||
* common to all variant using these two flavors and any of the build type.
|
||||
*
|
||||
* This can be null if there is less than 2 flavors.
|
||||
*/
|
||||
val multiFlavorSourceProvider: SourceProvider?
|
||||
}
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* Basic information about a build Variant.
|
||||
*
|
||||
* This is basically the source set information.
|
||||
*/
|
||||
interface BasicVariant: AndroidModel {
|
||||
/**
|
||||
* The name of the variant.
|
||||
*/
|
||||
val name: String
|
||||
|
||||
/**
|
||||
* The main artifact for this variant.
|
||||
*/
|
||||
val mainArtifact: BasicArtifact
|
||||
|
||||
/**
|
||||
* The AndroidTest artifact for this variant, if applicable.
|
||||
*/
|
||||
val androidTestArtifact: BasicArtifact?
|
||||
|
||||
/**
|
||||
* The Unit Test artifact for this variant, if applicable.
|
||||
*/
|
||||
val unitTestArtifact: BasicArtifact?
|
||||
|
||||
/**
|
||||
* The TestFixtures artifact for this variant, if applicable.
|
||||
*/
|
||||
val testFixturesArtifact: BasicArtifact?
|
||||
|
||||
/**
|
||||
* The build type name.
|
||||
*
|
||||
* If null, no build type is associated with the variant (this generally means that no build
|
||||
* types exist, which can only happen for libraries)
|
||||
*/
|
||||
val buildType: String?
|
||||
|
||||
/**
|
||||
* The flavors for this variants. This can be empty if no flavors are configured.
|
||||
*/
|
||||
val productFlavors: List<String>
|
||||
}
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Information for artifact that generates bundle
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface BundleInfo: AndroidModel {
|
||||
|
||||
/**
|
||||
* The name of the task used to generate the bundle file (.aab)
|
||||
*/
|
||||
val bundleTaskName: String
|
||||
|
||||
/**
|
||||
* The path to the listing file generated after each [bundleTaskName] task
|
||||
* execution. The listing file will contain a reference to the produced bundle file (.aab).
|
||||
*/
|
||||
val bundleTaskOutputListingFile: File
|
||||
|
||||
/**
|
||||
* The name of the task used to generate APKs via the bundle file (.aab)
|
||||
*/
|
||||
val apkFromBundleTaskName: String
|
||||
|
||||
/**
|
||||
* The path to the model file generated after each [apkFromBundleTaskName]
|
||||
* task execution. The model will contain a reference to the folder where APKs from bundle are
|
||||
* placed into.
|
||||
*/
|
||||
val apkFromBundleTaskOutputListingFile: File
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
/**
|
||||
* Enum for the type of code shrinker used.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
enum class CodeShrinker {
|
||||
PROGUARD, R8
|
||||
}
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
/**
|
||||
* Basic information about dependency components
|
||||
*/
|
||||
interface ComponentInfo {
|
||||
|
||||
/**
|
||||
* The build type attribute of this component.
|
||||
*
|
||||
* Null if the component does not have Android variants
|
||||
*/
|
||||
val buildType: String?
|
||||
|
||||
/**
|
||||
* The product flavor attributes of this component, keyed by flavor dimension name.
|
||||
*
|
||||
* May be empty if the component does not have Android product flavors.
|
||||
*/
|
||||
val productFlavors: Map<String, String>
|
||||
|
||||
/**
|
||||
* The list of attributes associated with the component.
|
||||
*
|
||||
* Build types and product flavor attributes are handled explicitly in [buildType] and
|
||||
* [productFlavors], so they are not included here
|
||||
*/
|
||||
val attributes: Map<String, String>
|
||||
|
||||
/**
|
||||
* The list of capabilities associated with the component
|
||||
*/
|
||||
val capabilities: List<String>
|
||||
|
||||
/**
|
||||
* Indicates whether this component (library or module) is a test fixtures component (i.e. has
|
||||
* a test fixtures capability).
|
||||
*/
|
||||
val isTestFixtures: Boolean
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* A node in a dependency graph, representing a direct or transitive dependency.
|
||||
*
|
||||
* This does not directly contain artifact information, instead it focuses on the graph
|
||||
* information (transitive dependencies) as well as the usage of this particular dependency
|
||||
* in this node of the graph (ie what are its modifiers: what version was originally requested.)
|
||||
*
|
||||
*/
|
||||
interface GraphItem: AndroidModel {
|
||||
/**
|
||||
* A Unique key representing the library, and allowing to match it with a [Library] instance
|
||||
*/
|
||||
val key: String
|
||||
|
||||
/**
|
||||
* Returns this library's Maven coordinates, as requested in the build file.
|
||||
*/
|
||||
val requestedCoordinates: String?
|
||||
|
||||
/**
|
||||
* Return the direct dependency of this node.
|
||||
*/
|
||||
val dependencies: List<GraphItem>
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* The information for a generated Java artifact.
|
||||
*
|
||||
* This artifact is for Java components inside an Android project, which is only unit tests
|
||||
* for now.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface JavaArtifact : AbstractArtifact, AndroidModel {
|
||||
/** Path to the mockable platform jar generated for this [JavaArtifact], if present. */
|
||||
val mockablePlatformJar: File?
|
||||
|
||||
/**
|
||||
* Returns the folder containing resource files that classes from this artifact expect to find
|
||||
* on the classpath.
|
||||
*
|
||||
* This is used to run the unit tests
|
||||
*/
|
||||
val runtimeResourceFolder: File?
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
|
||||
/**
|
||||
* Java compile options.
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
interface JavaCompileOptions: AndroidModel {
|
||||
/**
|
||||
* @return the java compiler encoding setting.
|
||||
*/
|
||||
val encoding: String
|
||||
|
||||
/**
|
||||
* @return the level of compliance Java source code has.
|
||||
*/
|
||||
val sourceCompatibility: String
|
||||
|
||||
/**
|
||||
* @return the Java version to be able to run classes on.
|
||||
*/
|
||||
val targetCompatibility: String
|
||||
|
||||
/** @return true if core library desugaring is enabled, false otherwise.
|
||||
*/
|
||||
val isCoreLibraryDesugaringEnabled: Boolean
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.builder.model.v2.ide
|
||||
|
||||
import com.android.builder.model.v2.AndroidModel
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Represent a variant/module/artifact dependency.
|
||||
*/
|
||||
interface Library: AndroidModel {
|
||||
/**
|
||||
* A Unique key representing the library, and allowing to match it with [GraphItem] instances
|
||||
*/
|
||||
val key: String
|
||||
|
||||
/**
|
||||
* The type of the dependency.
|
||||
*/
|
||||
val type: LibraryType
|
||||
|
||||
/**
|
||||
* Returns the project info to uniquely identify it (and its variant)
|
||||
*
|
||||
* Only valid for instances where [type] is [LibraryType.PROJECT]. It is null in other cases.
|
||||
*/
|
||||
val projectInfo: ProjectInfo?
|
||||
|
||||
/**
|
||||
* Returns the external library info to uniquely identify it (and its variant)
|
||||
*
|
||||
* Only valid for instances where [type] is [LibraryType.ANDROID_LIBRARY], or
|
||||
* [LibraryType.JAVA_LIBRARY]. It is null in other cases.
|
||||
*/
|
||||
val libraryInfo: LibraryInfo?
|
||||
|
||||
/**
|
||||
* The artifact location.
|
||||
*
|
||||
* Only valid for instances where [type] is [LibraryType.LIBRARY_JAVA] or
|
||||
* [LibraryType.ANDROID_LIBRARY]
|
||||
*/
|
||||
val artifact: File?
|
||||
|
||||
/**
|
||||
* The jar containing custom lint checks for consumers to use. This is filled by the
|
||||
* lintPublish configuration.
|
||||
*
|
||||
* The file may not exist.
|
||||
*
|
||||
* Only valid for instances where [type] is [LibraryType.ANDROID_LIBRARY]
|
||||
*/
|
||||
val lintJar: File?
|
||||
|
||||
/**
|
||||
* Data for libraries of type [LibraryType.ANDROID_LIBRARY]. It is null in other cases.
|
||||
*/
|
||||
val androidLibraryData: AndroidLibraryData?
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user