diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 9c8b297a9..3963f0010 100755 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -11,6 +11,7 @@ + diff --git a/app/src/main/assets/data/common/tooling-api-all.jar b/app/src/main/assets/data/common/tooling-api-all.jar index 90ee00e34..cc02a180c 100644 Binary files a/app/src/main/assets/data/common/tooling-api-all.jar and b/app/src/main/assets/data/common/tooling-api-all.jar differ diff --git a/build-tools/builder-model/.gitignore b/build-tools/builder-model/.gitignore deleted file mode 100644 index 42afabfd2..000000000 --- a/build-tools/builder-model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/build-tools/builder-model/build.gradle b/build-tools/builder-model/build.gradle deleted file mode 100644 index ee8106bf7..000000000 --- a/build-tools/builder-model/build.gradle +++ /dev/null @@ -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 . - */ - -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" -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/build/FilterData.java b/build-tools/builder-model/src/main/java/com/android/build/FilterData.java deleted file mode 100644 index f0684fc54..000000000 --- a/build-tools/builder-model/src/main/java/com/android/build/FilterData.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/build/OutputFile.java b/build-tools/builder-model/src/main/java/com/android/build/OutputFile.java deleted file mode 100644 index 91ddb73a8..000000000 --- a/build-tools/builder-model/src/main/java/com/android/build/OutputFile.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/build/VariantOutput.java b/build-tools/builder-model/src/main/java/com/android/build/VariantOutput.java deleted file mode 100644 index 7e31559cd..000000000 --- a/build-tools/builder-model/src/main/java/com/android/build/VariantOutput.java +++ /dev/null @@ -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 getFilterTypes(); - - /** Returns all the split information used to create the APK. */ - @NonNull - Collection 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 getOutputs(); - - /** - * Returns the version code for this output. - * - *

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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AaptOptions.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AaptOptions.java deleted file mode 100644 index 8941ac876..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AaptOptions.java +++ /dev/null @@ -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. - * - *

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 */ - @NonNull - Namespacing getNamespacing(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AdbOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/AdbOptions.kt deleted file mode 100644 index 821cf3726..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AdbOptions.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidArtifact.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidArtifact.java deleted file mode 100644 index 69ab7a192..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidArtifact.java +++ /dev/null @@ -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. - * - *

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 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. - * - *

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. - * - *

Deprecated, as of 1.2, present in super interface. - * - * @return a list of folders. - */ - @NonNull - @Override - Collection 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 getGeneratedResourceFolders(); - - /** - * 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. - */ - @Nullable - Set getAbiFilters(); - - /** - * Returns the native libraries associated with the artifact. - * - *

Deprecated since ndk-compile has been deprecated. - */ - @Nullable - @Deprecated - Collection 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 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. - * - *

For test artifacts, these will be "buddy APKs" from the {@code androidTestUtil} - * configuration. - * - * @since 3.0 - */ - @NonNull - Collection 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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidArtifactOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidArtifactOutput.java deleted file mode 100644 index 69ee44e4c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidArtifactOutput.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidBundle.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidBundle.java deleted file mode 100644 index b2c11084d..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidBundle.java +++ /dev/null @@ -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}. - * - *

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 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 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(); - -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidGradlePluginProjectFlags.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidGradlePluginProjectFlags.java deleted file mode 100644 index e4879e8f6..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidGradlePluginProjectFlags.java +++ /dev/null @@ -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. - * - *

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. - * - *

Studio uses the legacy default for AGPs that do not specifiy 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 {@code @Deprecated} and the getter removed from {@code - * IdeAndroidGradlePluginProjectFlags} - */ - enum BooleanFlag { - /** - * 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), - ; - - 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. - * - *

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. - * - *

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. - *
- */ - public boolean getLegacyDefault() { - return legacyDefault; - } - } - - Map getBooleanFlagMap(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidLibrary.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidLibrary.java deleted file mode 100644 index 3f8e399ae..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidLibrary.java +++ /dev/null @@ -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 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(); - -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidProject.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidProject.java deleted file mode 100644 index 390f5d957..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AndroidProject.java +++ /dev/null @@ -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. - *

- * 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. - *

- * 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. - * - *

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. - * - *

This is here rather than on {@link AndroidArtifact} because this is common to all - * artifacts as it cannot be changed per variants. - * - *

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 getBuildTypes(); - - /** - * Returns a list of all the {@link ProductFlavor} in their container. - * - * @return a list of product flavor containers. - */ - @NonNull - Collection 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 getVariants(); - - /** - * Returns a list of all the variant names. - * - *

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 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 getFlavorDimensions(); - - /** - * Returns a list of extra artifacts meta data. This does not include the main artifact. - * - * @return a list of extra artifacts - */ - @NonNull - Collection 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 getBootClasspath(); - - /** - * Returns a list of folders or jar files that contains the framework source code. - */ - @NonNull - Collection getFrameworkSources(); - - /** - * Returns the collection of toolchains used to create any native libraries. - * - * @return collection of toolchains. - */ - @NonNull - Collection getNativeToolchains(); - - /** - * Returns a list of {@link SigningConfig}. - */ - @NonNull - Collection 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}. - *

- * 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 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 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. - * - *

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. - * - *

The values are Gradle path. Only valid for base splits. - * - * @return - */ - @NonNull - Collection 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 getVariantsBuildInformation(); - - /** Returns the lint jars that this module uses to run extra lint checks */ - @NonNull - List getLintRuleJars(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ApiVersion.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ApiVersion.java deleted file mode 100644 index bb547f51c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ApiVersion.java +++ /dev/null @@ -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 - * 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. - */ -public interface ApiVersion { - - /** - * Returns the api level as an integer. - *

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. - *

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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AppBundleProjectBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AppBundleProjectBuildOutput.java deleted file mode 100644 index dfcf7f38c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AppBundleProjectBuildOutput.java +++ /dev/null @@ -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 getAppBundleVariantsBuildOutput(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/AppBundleVariantBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/AppBundleVariantBuildOutput.java deleted file mode 100644 index 4bf3d097f..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/AppBundleVariantBuildOutput.java +++ /dev/null @@ -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. - * - *

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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ArtifactMetaData.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ArtifactMetaData.java deleted file mode 100644 index eb2f1157c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ArtifactMetaData.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/BaseArtifact.java b/build-tools/builder-model/src/main/java/com/android/builder/model/BaseArtifact.java deleted file mode 100644 index 23a5b01a3..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/BaseArtifact.java +++ /dev/null @@ -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 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 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 getGeneratedSourceFolders(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/BaseBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/BaseBuildOutput.java deleted file mode 100644 index 76bdf36a0..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/BaseBuildOutput.java +++ /dev/null @@ -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 getOutputs(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/BaseConfig.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/BaseConfig.kt deleted file mode 100644 index db645420d..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/BaseConfig.kt +++ /dev/null @@ -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 - - /** - * Map of generated res values where the key is the res "type/name". - */ - val resValues: Map - - /** - * 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 - - /** The collection of proguard rule files for consumers of the library to use. */ - val consumerProguardFiles: Collection - - /** The collection of proguard rule files to use for the test APK. */ - val testProguardFiles: Collection - - /** - * 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 - - /** - * 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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/BuildType.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/BuildType.kt deleted file mode 100644 index d1dbbca10..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/BuildType.kt +++ /dev/null @@ -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 -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/BuildTypeContainer.java b/build-tools/builder-model/src/main/java/com/android/builder/model/BuildTypeContainer.java deleted file mode 100644 index 525701dcb..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/BuildTypeContainer.java +++ /dev/null @@ -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 getExtraSourceProviders(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ClassField.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ClassField.java deleted file mode 100644 index 380d61067..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ClassField.java +++ /dev/null @@ -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 getAnnotations(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/CodeShrinker.java b/build-tools/builder-model/src/main/java/com/android/builder/model/CodeShrinker.java deleted file mode 100644 index d586ab3ca..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/CodeShrinker.java +++ /dev/null @@ -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, -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/DataBindingOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/DataBindingOptions.kt deleted file mode 100644 index c5ace0051..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/DataBindingOptions.kt +++ /dev/null @@ -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. - *

- * 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. - *

- * 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 -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/Dependencies.java b/build-tools/builder-model/src/main/java/com/android/builder/model/Dependencies.java deleted file mode 100644 index 8ec89976b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/Dependencies.java +++ /dev/null @@ -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. - * - *

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. - * - *

This includes both modules and external dependencies. They can be differentiated with - * {@link Library#getProject()}. - * - * @return the list of libraries. - */ - @NonNull - Collection getLibraries(); - - /** - * The list of Java library dependencies. - * - *

This is a flattened list containing all transitive external dependencies. - * - * @return the list of Java library dependencies. - */ - @NonNull - Collection getJavaLibraries(); - - /** - * The list of project dependencies. This is only for non Android module dependencies (which - * right now is Java-only modules). - * - *

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 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 getJavaModules(); - - /** Returns the list of runtime only dependency classes. @Since 3.5 */ - @NonNull - Collection getRuntimeOnlyClasses(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/DependenciesInfo.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/DependenciesInfo.kt deleted file mode 100644 index 879cb432b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/DependenciesInfo.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/DimensionAware.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/DimensionAware.kt deleted file mode 100644 index fb09b6865..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/DimensionAware.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/InjectedProperties.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/InjectedProperties.kt deleted file mode 100644 index c2449fc49..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/InjectedProperties.kt +++ /dev/null @@ -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" diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/InstantAppProjectBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/InstantAppProjectBuildOutput.java deleted file mode 100644 index 1d617b018..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/InstantAppProjectBuildOutput.java +++ /dev/null @@ -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 getInstantAppVariantsBuildOutput(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/InstantAppVariantBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/InstantAppVariantBuildOutput.java deleted file mode 100644 index 416b3e668..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/InstantAppVariantBuildOutput.java +++ /dev/null @@ -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 getFeatureOutputs(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/InstantRun.java b/build-tools/builder-model/src/main/java/com/android/builder/model/InstantRun.java deleted file mode 100644 index 8706d3d26..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/InstantRun.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/JavaArtifact.java b/build-tools/builder-model/src/main/java/com/android/builder/model/JavaArtifact.java deleted file mode 100644 index 7919598b4..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/JavaArtifact.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/JavaCompileOptions.java b/build-tools/builder-model/src/main/java/com/android/builder/model/JavaCompileOptions.java deleted file mode 100644 index c27b769d2..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/JavaCompileOptions.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/JavaLibrary.java b/build-tools/builder-model/src/main/java/com/android/builder/model/JavaLibrary.java deleted file mode 100644 index 068620fbc..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/JavaLibrary.java +++ /dev/null @@ -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 getDependencies(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/Library.java b/build-tools/builder-model/src/main/java/com/android/builder/model/Library.java deleted file mode 100644 index 7f9703035..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/Library.java +++ /dev/null @@ -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. - * - *

This is only valid if {@link #getProject()} is not null. a null - * 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 false since the provided dependencies - * are not present - * - * @return true if provided. - */ - boolean isProvided(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/LintOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/LintOptions.kt deleted file mode 100644 index e0cf1d5b2..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/LintOptions.kt +++ /dev/null @@ -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 - - /** - * 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 - - /** - * 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 - - /** 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. - *

- * 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? - - 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 - } -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/MavenCoordinates.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/MavenCoordinates.kt deleted file mode 100644 index cb146d92b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/MavenCoordinates.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ModelBuilderParameter.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ModelBuilderParameter.java deleted file mode 100644 index 4c7ba618b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ModelBuilderParameter.java +++ /dev/null @@ -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); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/Named.java b/build-tools/builder-model/src/main/java/com/android/builder/model/Named.java deleted file mode 100644 index 7a6de061b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/Named.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeAndroidProject.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeAndroidProject.java deleted file mode 100644 index 9e8639d34..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeAndroidProject.java +++ /dev/null @@ -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. - * - *

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. - * - *

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 getVariantInfos(); - - /** Returns a collection of files that affects the build. */ - @NonNull - Collection getBuildFiles(); - - /** Returns a collection of native artifacts. */ - @NonNull - Collection getArtifacts(); - - /** Returns a collection of toolchains. */ - @NonNull - Collection getToolChains(); - - /** Returns a collection of all compile settings. */ - @NonNull - Collection getSettings(); - - /** - * Return a map of file extension to each file type. - * - *

The key is the file extension, the value is either "c" or "c++". - */ - @NonNull - Map getFileExtensions(); - - /** Return the names of build systems used to create the native artifacts. */ - @NonNull - Collection getBuildSystems(); - - /** Get the default NDK version. */ - @NonNull - String getDefaultNdkVersion(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeArtifact.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeArtifact.java deleted file mode 100644 index cff1afae7..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeArtifact.java +++ /dev/null @@ -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 getSourceFiles(); - - /** - * Returns the folders container headers exported for the library. - */ - @NonNull - Collection 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 getRuntimeFiles(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeFile.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeFile.java deleted file mode 100644 index d46d309e5..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeFile.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeLibrary.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeLibrary.java deleted file mode 100644 index 84d2718c3..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeLibrary.java +++ /dev/null @@ -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. - * - *

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 getCIncludeDirs(); - - /** - * A list of include directories for compiling C++ code. - * - * @return list of include directories. - */ - @NonNull - List getCppIncludeDirs(); - - /** - * A list of system include directories for compiling C code. - * - * @return list of include directories. - */ - @NonNull - List getCSystemIncludeDirs(); - - /** - * A list of system include directories for compiling C++ code. - * - * @return list of include directories. - */ - @NonNull - List getCppSystemIncludeDirs(); - - /** - * A list of defines for C code. - * - * @return list of defines. - */ - @NonNull - List getCDefines(); - - /** - * A list of defines for C++ code. - * - * @return list of defines. - */ - @NonNull - List getCppDefines(); - - /** - * A list of compiler flags for C code. - * - * @return list of compiler flags. - */ - @NonNull - List getCCompilerFlags(); - - /** - * A list of compiler flags for C++ code. - * - * @return list of compiler flags. - */ - @NonNull - List getCppCompilerFlags(); - - /** - * The folders containing built libraries with debug information. - * - * @return list of paths to locate shared objects with debug information. - */ - @NonNull - List getDebuggableLibraryFolders(); - -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeSettings.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeSettings.java deleted file mode 100644 index 4fdbe67cf..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeSettings.java +++ /dev/null @@ -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 getCompilerFlags(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeToolchain.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeToolchain.java deleted file mode 100644 index dbb1dcdf5..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeToolchain.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeVariantAbi.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeVariantAbi.java deleted file mode 100644 index a6ccde948..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeVariantAbi.java +++ /dev/null @@ -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 getBuildFiles(); - - /** Returns a collection of native artifacts. */ - @NonNull - Collection getArtifacts(); - - /** Returns a collection of toolchains. */ - @NonNull - Collection getToolChains(); - - /** Returns a collection of all compile settings. */ - @NonNull - Collection getSettings(); - - /** - * Return a map of file extension to each file type. - * - *

The key is the file extension, the value is either "c" or "c++". - */ - @NonNull - Map getFileExtensions(); - - /** Returns the variant name. */ - @NonNull - String getVariantName(); - - /** Returns the abi. */ - @NonNull - String getAbi(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeVariantInfo.java b/build-tools/builder-model/src/main/java/com/android/builder/model/NativeVariantInfo.java deleted file mode 100644 index bd91a1124..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/NativeVariantInfo.java +++ /dev/null @@ -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 getAbiNames(); - - /** - * Map of ABI name to corresponding build root folder for that ABI. - * - *

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. - * - *

For both ndk-build and CMake, this is the folder that contains android_gradle_build.json - * is emitted. - * - *

In general, this is the folder that contains metadata about the build for this particular - * ABI. - * - *

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 getBuildRootFolderMap(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/OptionalCompilationStep.java b/build-tools/builder-model/src/main/java/com/android/builder/model/OptionalCompilationStep.java deleted file mode 100644 index b25aece3d..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/OptionalCompilationStep.java +++ /dev/null @@ -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. - * - *

Dex files and/or resources.ap_ for ColdswapMode.MULTIDEX and some split APKs for - * ColdswapMode.MULTIAPK. - */ - RESTART_ONLY, - /** - * Force rebuild of fresh install artifacts. - * - *

A full apk for ColdswapMode.MULTIDEX and all the split apks for ColdswapMode.MULTIAPK. - */ - FULL_APK, -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/PackagingOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/PackagingOptions.kt deleted file mode 100644 index f4c8efb1e..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/PackagingOptions.kt +++ /dev/null @@ -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 - - /** - * Glob patterns to pick first. - * - * @return a set of glob pattern that use forward slash as a separator - */ - val pickFirsts: Set - - /** - * Glob patterns to merge. - * - * @return a set of glob pattern that use forward slash as a separator - */ - val merges: Set - - /** - * 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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ProductFlavor.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/ProductFlavor.kt deleted file mode 100644 index 065475dcc..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ProductFlavor.kt +++ /dev/null @@ -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 - - /** 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 - - 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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ProductFlavorContainer.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ProductFlavorContainer.java deleted file mode 100644 index 089b97ecd..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ProductFlavorContainer.java +++ /dev/null @@ -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 getExtraSourceProviders(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ProjectBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ProjectBuildOutput.java deleted file mode 100644 index dc743bd36..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ProjectBuildOutput.java +++ /dev/null @@ -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 getVariantsBuildOutput(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ProjectSyncIssues.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ProjectSyncIssues.java deleted file mode 100644 index 6ae3446d2..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ProjectSyncIssues.java +++ /dev/null @@ -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. - * - *

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 getSyncIssues(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/SigningConfig.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/SigningConfig.kt deleted file mode 100644 index 3437b5bb1..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/SigningConfig.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/SourceProvider.java b/build-tools/builder-model/src/main/java/com/android/builder/model/SourceProvider.java deleted file mode 100644 index 69270285f..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/SourceProvider.java +++ /dev/null @@ -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 getJavaDirectories(); - - /** - * Returns the kotlin source folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection getKotlinDirectories(); - - /** - * Returns the java resources folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection getResourcesDirectories(); - - /** - * Returns the aidl source folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection getAidlDirectories(); - - /** - * Returns the renderscript source folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection 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 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 getCppDirectories(); - - /** - * Returns the android resources folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection getResDirectories(); - - /** - * Returns the android assets folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection getAssetsDirectories(); - - /** - * Returns the native libs folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection getJniLibsDirectories(); - - /** - * Returns the shader folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection getShadersDirectories(); - - /** - * Returns the machine learning models folders. - * - * @return a list of folders. They may not all exist. - */ - @NonNull - Collection 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 getCustomDirectories(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/SourceProviderContainer.java b/build-tools/builder-model/src/main/java/com/android/builder/model/SourceProviderContainer.java deleted file mode 100644 index 0ac83872f..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/SourceProviderContainer.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/SyncIssue.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/SyncIssue.kt deleted file mode 100644 index b702cc07f..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/SyncIssue.kt +++ /dev/null @@ -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? - - 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). - } -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/TestOptions.java b/build-tools/builder-model/src/main/java/com/android/builder/model/TestOptions.java deleted file mode 100644 index a94dbf183..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/TestOptions.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/TestVariantBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/TestVariantBuildOutput.java deleted file mode 100644 index d648fa62b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/TestVariantBuildOutput.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/TestedTargetVariant.java b/build-tools/builder-model/src/main/java/com/android/builder/model/TestedTargetVariant.java deleted file mode 100644 index be9d0d858..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/TestedTargetVariant.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/Variant.java b/build-tools/builder-model/src/main/java/com/android/builder/model/Variant.java deleted file mode 100644 index 49fa0aa5b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/Variant.java +++ /dev/null @@ -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 getExtraAndroidArtifacts(); - - @NonNull - Collection 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 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 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 getDesugaredMethods(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/VariantBuildInformation.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/VariantBuildInformation.kt deleted file mode 100644 index f6d57a5ed..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/VariantBuildInformation.kt +++ /dev/null @@ -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? -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/VariantBuildOutput.java b/build-tools/builder-model/src/main/java/com/android/builder/model/VariantBuildOutput.java deleted file mode 100644 index 791dd49f9..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/VariantBuildOutput.java +++ /dev/null @@ -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 getTestingVariants(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/VectorDrawablesOptions.java b/build-tools/builder-model/src/main/java/com/android/builder/model/VectorDrawablesOptions.java deleted file mode 100644 index a7d6bb902..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/VectorDrawablesOptions.java +++ /dev/null @@ -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 getGeneratedDensities(); - - @Nullable - Boolean getUseSupportLibrary(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/Version.java b/build-tools/builder-model/src/main/java/com/android/builder/model/Version.java deleted file mode 100644 index 102850cf1..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/Version.java +++ /dev/null @@ -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 - *

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() {} -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/ViewBindingOptions.java b/build-tools/builder-model/src/main/java/com/android/builder/model/ViewBindingOptions.java deleted file mode 100644 index 4e560041a..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/ViewBindingOptions.java +++ /dev/null @@ -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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/DependencyGraphs.java b/build-tools/builder-model/src/main/java/com/android/builder/model/level2/DependencyGraphs.java deleted file mode 100644 index 42130b2d5..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/DependencyGraphs.java +++ /dev/null @@ -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 getCompileDependencies(); - - /** - * Returns the package dependency graph. - * - * Only valid in full dependency mode. - */ - @NonNull - List 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 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 getSkippedLibraries(); - -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/GlobalLibraryMap.java b/build-tools/builder-model/src/main/java/com/android/builder/model/level2/GlobalLibraryMap.java deleted file mode 100644 index 8165bfb65..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/GlobalLibraryMap.java +++ /dev/null @@ -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 getLibraries(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/GraphItem.java b/build-tools/builder-model/src/main/java/com/android/builder/model/level2/GraphItem.java deleted file mode 100644 index 334e9631c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/GraphItem.java +++ /dev/null @@ -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 getDependencies(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/Library.java b/build-tools/builder-model/src/main/java/com/android/builder/model/level2/Library.java deleted file mode 100644 index 3a10b1b4a..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/level2/Library.java +++ /dev/null @@ -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. - * - *

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. - * - *

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. - * - *

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). - * - *

Only valid for Android Library where {@link #getType()} is {@link #LIBRARY_ANDROID} - * - *

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. - * - *

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 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(); -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/AndroidModel.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/AndroidModel.kt deleted file mode 100644 index be747fcfb..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/AndroidModel.kt +++ /dev/null @@ -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 \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/CustomSourceDirectory.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/CustomSourceDirectory.kt deleted file mode 100644 index 375d6ea78..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/CustomSourceDirectory.kt +++ /dev/null @@ -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 -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ModelSyncFile.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ModelSyncFile.kt deleted file mode 100644 index 60c8a2c44..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ModelSyncFile.kt +++ /dev/null @@ -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 -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/BaseConfig.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/BaseConfig.kt deleted file mode 100644 index adeb3d6c5..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/BaseConfig.kt +++ /dev/null @@ -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? - - /** - * Map of generated res values where the key is the res name. - * If null, res values are disabled in the project. - */ - val resValues: Map? - - /** - * 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 - - /** The collection of proguard rule files for consumers of the library to use. */ - val consumerProguardFiles: Collection - - /** The collection of proguard rule files to use for the test APK. */ - val testProguardFiles: Collection - - /** - * 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 - - /** - * 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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/BuildType.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/BuildType.kt deleted file mode 100644 index f5a82869b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/BuildType.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/ClassField.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/ClassField.kt deleted file mode 100644 index d5dcc3446..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/ClassField.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/DependenciesInfo.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/DependenciesInfo.kt deleted file mode 100644 index 7f33d3237..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/DependenciesInfo.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/PackagingOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/PackagingOptions.kt deleted file mode 100644 index d737c3408..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/PackagingOptions.kt +++ /dev/null @@ -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 - - /** - * Glob patterns to pick first. - * - * @return a set of glob pattern that use forward slash as a separator - */ - val pickFirsts: Set - - /** - * Glob patterns to merge. - * - * @return a set of glob pattern that use forward slash as a separator - */ - val merges: Set - - /** - * 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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/ProductFlavor.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/ProductFlavor.kt deleted file mode 100644 index b8811ac15..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/ProductFlavor.kt +++ /dev/null @@ -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 - - /** 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 - - /** 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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/SigningConfig.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/SigningConfig.kt deleted file mode 100644 index 8f9235b48..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/dsl/SigningConfig.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AaptOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AaptOptions.kt deleted file mode 100644 index c3a3e85be..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AaptOptions.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AbstractArtifact.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AbstractArtifact.kt deleted file mode 100644 index ffad32bf6..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AbstractArtifact.kt +++ /dev/null @@ -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 - - /** - * 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 - - /** - * 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 - - /** - * Returns all the [ModelSyncFile] for this artifact. - * - * @return a list of [ModelSyncFile] - * @since 7.1 - */ - val modelSyncFiles: Collection -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AdbOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AdbOptions.kt deleted file mode 100644 index 09766db37..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AdbOptions.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidArtifact.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidArtifact.kt deleted file mode 100644 index f1fd0d865..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidArtifact.kt +++ /dev/null @@ -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 - - /** - * 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? - - /** - * 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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidGradlePluginProjectFlags.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidGradlePluginProjectFlags.kt deleted file mode 100644 index 7565bdae8..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidGradlePluginProjectFlags.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidLibraryData.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidLibraryData.kt deleted file mode 100644 index adc7637ea..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/AndroidLibraryData.kt +++ /dev/null @@ -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 - - /** - * The list of jar files for runtime/packaging. - */ - val runtimeJarFiles: List - - /** - * 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 -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ApiVersion.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ApiVersion.kt deleted file mode 100644 index 301799a40..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ApiVersion.kt +++ /dev/null @@ -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? -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ArtifactDependencies.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ArtifactDependencies.kt deleted file mode 100644 index 3de5d896c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ArtifactDependencies.kt +++ /dev/null @@ -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 - - /** - * The runtime dependency graph. - */ - val runtimeDependencies: List - - val unresolvedDependencies: List -} - -interface UnresolvedDependency { - val name: String - val cause: String? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BasicArtifact.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BasicArtifact.kt deleted file mode 100644 index f11f4fbd8..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BasicArtifact.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BasicVariant.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BasicVariant.kt deleted file mode 100644 index a1458fb09..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BasicVariant.kt +++ /dev/null @@ -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 -} - diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BundleInfo.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BundleInfo.kt deleted file mode 100644 index 32fec9a29..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/BundleInfo.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/CodeShrinker.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/CodeShrinker.kt deleted file mode 100644 index 7eefd841c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/CodeShrinker.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ComponentInfo.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ComponentInfo.kt deleted file mode 100644 index 0c482d106..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ComponentInfo.kt +++ /dev/null @@ -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 - - /** - * 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 - - /** - * The list of capabilities associated with the component - */ - val capabilities: List - - /** - * Indicates whether this component (library or module) is a test fixtures component (i.e. has - * a test fixtures capability). - */ - val isTestFixtures: Boolean -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/GraphItem.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/GraphItem.kt deleted file mode 100644 index ed24849b3..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/GraphItem.kt +++ /dev/null @@ -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 -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/JavaArtifact.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/JavaArtifact.kt deleted file mode 100644 index ece99d362..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/JavaArtifact.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/JavaCompileOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/JavaCompileOptions.kt deleted file mode 100644 index 6b86f8d8c..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/JavaCompileOptions.kt +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/Library.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/Library.kt deleted file mode 100644 index 03973f437..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/Library.kt +++ /dev/null @@ -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? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LibraryInfo.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LibraryInfo.kt deleted file mode 100644 index 58f579378..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LibraryInfo.kt +++ /dev/null @@ -1,26 +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 - -/** - * Information to identify an external library dependencies - */ -interface LibraryInfo: ComponentInfo { - val group: String - val name: String - val version: String -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LibraryType.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LibraryType.kt deleted file mode 100644 index cacdf4d35..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LibraryType.kt +++ /dev/null @@ -1,44 +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 - -/** - * The type of Library dependency. - */ -enum class LibraryType { - - /** - * The dependency is a sub-project of the build. - */ - PROJECT, - - /** - * The dependency is an external Android Library (AAR) - */ - ANDROID_LIBRARY, - - /** - * The dependency is an external Java Library (JAR) - */ - JAVA_LIBRARY, - - /** - * The dependency is an external dependency with no artifact, pointing to a different artifact - * (via Gradle's available-at feature, and possibly via POM's relocation feature.) - */ - RELOCATED; -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LintOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LintOptions.kt deleted file mode 100644 index 1b1ce5636..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/LintOptions.kt +++ /dev/null @@ -1,184 +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.ide - -import com.android.builder.model.v2.AndroidModel -import java.io.File - -/** - * Options for lint. -*/ -interface LintOptions: AndroidModel { - /** - * The set of issue id's to suppress. - */ - val disable: Set - - /** - * The set of issue id's to enable. - */ - val enable: Set - - /** Issues that have severity overridden to 'informational' */ - val informational: Set - - /** Issues that have severity overridden to 'warning' */ - val warning: Set - - /** Issues that have severity overridden to 'error' */ - val error: Set - - /** Issues that have severity overridden to 'fatal' */ - val fatal: Set - - /** - * The exact set of issues to check. If empty lint will detect the issues that are enabled - * by default plus any issues enabled via [enable] and without issues disabled via [disable]. - */ - val checkOnly: Set - - /** Whether lint should abort the build if errors are found */ - val abortOnError: 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 absolutePaths: Boolean - - /** - * Whether lint should include the source lines in the output where errors occurred - * (true by default) - */ - val noLines: Boolean - - /** - * Returns whether lint should be quiet (for example, not write informational messages - * such as paths to report files written) - */ - val quiet: Boolean - - /** Returns whether lint should check all warnings, including those off by default */ - val checkAllWarnings: Boolean - - /** Returns whether lint will only check for errors (ignoring warnings) */ - val ignoreWarnings: Boolean - - /** Returns whether lint should treat all warnings as errors */ - val warningsAsErrors: 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) - */ - val checkTestSources: 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. - */ - val ignoreTestSources: Boolean - - /** - * Whether lint should ignore all testFixtures sources. - */ - val ignoreTestFixturesSources: Boolean - - /** - * Returns whether lint should run checks on generated sources. - */ - val checkGeneratedSources: Boolean - - /** Returns whether lint should include explanations for issue errors. (Note that - * HTML and XML reports intentionally do this unconditionally, ignoring this setting.) */ - val explainIssues: Boolean - - /** - * Returns whether lint should include all output (e.g. include all alternate - * locations, not truncating long messages, etc.) - */ - val showAll: 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 [.getTextOutput]. */ - 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 [.getHtmlOutput]. */ - 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 [.getXmlOutput]. */ - 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. - * Setting this property will also turn on [sarifOutput]. - */ - 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 checkReleaseBuilds: Boolean - - /** - * Returns whether lint should check all dependencies too as part of its analysis. Default is - * false. - */ - val checkDependencies: 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. - * - * - * 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. - */ - val baseline: File? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ProjectInfo.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ProjectInfo.kt deleted file mode 100644 index 5fe1f7acb..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ProjectInfo.kt +++ /dev/null @@ -1,33 +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 - -/** - * Information to identify a sub-project dependency. - */ -interface ProjectInfo: ComponentInfo { - - /** - * The build id. - */ - val buildId: String - - /** - * The project path. - */ - val projectPath: String -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ProjectType.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ProjectType.kt deleted file mode 100644 index a31bdb106..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ProjectType.kt +++ /dev/null @@ -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.ide - -/** - * The type of the project. This matches the type of the plugin - * - * @since 4.2 - */ -enum class ProjectType { - APPLICATION, - LIBRARY, - DYNAMIC_FEATURE, - TEST, - FUSED_LIBRARIES -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SourceProvider.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SourceProvider.kt deleted file mode 100644 index aa42819bf..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SourceProvider.kt +++ /dev/null @@ -1,120 +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.CustomSourceDirectory -import com.android.builder.model.v2.AndroidModel -import java.io.File - -/** - * Represent a SourceProvider for a given configuration. - * - * TODO: source filters? - * - * @since 4.2 - */ -interface SourceProvider: AndroidModel { - /** - * Returns the name of this source set. - * - * @return The name. Never returns null. - */ - val name: String - - /** - * Returns the manifest file. - * - * @return the manifest file. It may not exist. - */ - val manifestFile: File - - /** - * Returns the java source folders. - * - * @return a list of folders. They may not all exist. - */ - val javaDirectories: Collection - - /** - * Returns the kotlin source folders. - * - * @return a list of folders. They may not all exist. - */ - val kotlinDirectories: Collection - - /** - * Returns the java resources folders. - * - * @return a list of folders. They may not all exist. - */ - val resourcesDirectories: Collection - - /** - * Returns the aidl source folders or null if aidl is disabled - * - * @return a list of folders. They may not all exist. - */ - val aidlDirectories: Collection? - - /** - * Returns the renderscript source folders or null if renderscript is disabled - * - * @return a list of folders. They may not all exist. - */ - val renderscriptDirectories: Collection? - - /** - * Returns the android resources folders, or null if resource processing is disabled - * - * @return a list of folders. They may not all exist. - */ - val resDirectories: Collection? - - /** - * Returns the android assets folders or null if assets processing is disabled - * - * @return a list of folders. They may not all exist. - */ - val assetsDirectories: Collection? - - /** - * Returns the native libs folders. - * - * @return a list of folders. They may not all exist. - */ - val jniLibsDirectories: Collection - - /** - * Returns the shader folders or null if shaders are disabled. - * - * @return a list of folders. They may not all exist. - */ - val shadersDirectories: Collection? - - /** - * Returns the machine learning models folders or null if ML is disabled - * - * @return a list of folders. They may not all exist. - */ - val mlModelsDirectories: Collection? - - /** - * Returns a [Collection] of all registered custom directories. - * - * @return a [Collection] of custom directories. - */ - val customDirectories: Collection? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SourceSetContainer.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SourceSetContainer.kt deleted file mode 100644 index 77cdfcfcf..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SourceSetContainer.kt +++ /dev/null @@ -1,45 +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 - -/** - * A container of source sets for a given dimension value (ie a build type or a flavor) - */ -interface SourceSetContainer: AndroidModel { - - /** - * The production source set - */ - val sourceProvider: SourceProvider - - /** - * The optional source set for the AndroidTest component - */ - val androidTestSourceProvider: SourceProvider? - - /** - * The optional source set for the UnitTest component - */ - val unitTestSourceProvider: SourceProvider? - - /** - * The optional source set for the TestFixtures component - */ - val testFixturesSourceProvider: SourceProvider? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SyncIssue.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SyncIssue.kt deleted file mode 100644 index 9c888eacc..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/SyncIssue.kt +++ /dev/null @@ -1,264 +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 - -/** - * 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. - * - * @since 4.2 - */ -interface SyncIssue: AndroidModel { - /** 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? - - 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 - - // 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). - - /** Indicates that a manifest is missing */ - const val TYPE_MISSING_ANDROID_MANIFEST = 44 - } -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/TestInfo.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/TestInfo.kt deleted file mode 100644 index 13538122a..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/TestInfo.kt +++ /dev/null @@ -1,63 +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 test Artifacts. - * - * This includes both Android test components in app/lib modules, and the main component - * in test modules. - * - * @since 4.2 - */ -interface TestInfo: AndroidModel { - - enum class 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 - } - - val animationsDisabled: Boolean - val execution: Execution? - - /** - * Returns a list of additional APKs that need to installed on the device for this artifact to - * work correctly. - * - * - * For test artifacts, these will be "buddy APKs" from the `androidTestUtil` - * configuration. - */ - val additionalRuntimeApks: Collection - - /** - * 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 - */ - val instrumentedTestTaskName: String -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/TestedTargetVariant.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/TestedTargetVariant.kt deleted file mode 100644 index 6195f0ad4..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/TestedTargetVariant.kt +++ /dev/null @@ -1,38 +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.v2.ide - -import com.android.builder.model.v2.AndroidModel - -/** - * 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). - * - * @since 4.2 - */ -interface TestedTargetVariant: AndroidModel { - /** - * Returns the Gradle path of the project that is being tested. - */ - val targetProjectPath: String - - /** - * Returns the variant of the tested project. - */ - val targetVariant: String -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/Variant.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/Variant.kt deleted file mode 100644 index 291802486..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/Variant.kt +++ /dev/null @@ -1,73 +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 - -/** - * A build Variant. - */ -interface Variant: AndroidModel { - /** - * The name of the variant. - */ - val name: String - - /** - * The display name for the variant. - */ - val displayName: String - - /** - * The main artifact for this variant. - */ - val mainArtifact: AndroidArtifact - - /** - * The AndroidTest artifact for this variant, if applicable. - */ - val androidTestArtifact: AndroidArtifact? - - /** - * The Unit Test artifact for this variant, if applicable. - */ - val unitTestArtifact: JavaArtifact? - - /** - * The TestFixtures artifact for this variant, if applicable. - */ - val testFixturesArtifact: AndroidArtifact? - - /** - * For standalone test plugins: information about the tested project. - * - * For other plugin types, this is null - */ - val testedTargetVariant: TestedTargetVariant? - - /** - * Whether the variant is instant app compatible. - * - * Only application modules and dynamic feature modules will set this property. - */ - val isInstantAppCompatible: Boolean - - /** - * Desugared methods supported by D8 and core library desugaring. - */ - val desugaredMethods: List -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/VectorDrawablesOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/VectorDrawablesOptions.kt deleted file mode 100644 index 1a9590ed1..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/VectorDrawablesOptions.kt +++ /dev/null @@ -1,28 +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.v2.ide - -import com.android.builder.model.v2.AndroidModel - -/** - * Options for build-time support for vector drawables. - * - * @since 4.2 - */ -interface VectorDrawablesOptions: AndroidModel { - val generatedDensities: Set? - val useSupportLibrary: Boolean? -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ViewBindingOptions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ViewBindingOptions.kt deleted file mode 100644 index 5d5c07248..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/ide/ViewBindingOptions.kt +++ /dev/null @@ -1,28 +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 - -import com.android.builder.model.v2.AndroidModel - -/** - * Options for view binding - * - * @since 4.2 - */ -interface ViewBindingOptions: AndroidModel { - /** Whether to enable view binding. */ - val isEnabled: Boolean -} \ No newline at end of file diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/AndroidDsl.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/AndroidDsl.kt deleted file mode 100644 index 55ec3f873..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/AndroidDsl.kt +++ /dev/null @@ -1,91 +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.models - -import com.android.builder.model.v2.AndroidModel -import com.android.builder.model.v2.dsl.BuildType -import com.android.builder.model.v2.dsl.DependenciesInfo -import com.android.builder.model.v2.dsl.ProductFlavor -import com.android.builder.model.v2.dsl.SigningConfig -import com.android.builder.model.v2.ide.AaptOptions -import com.android.builder.model.v2.ide.LintOptions -import com.android.builder.model.v2.ide.ProjectType - -interface AndroidDsl: AndroidModel { - - /** - * Returns the optional group-id of the artifact represented by this project. - */ - val groupId: String? - - /** - * The default config information - */ - val defaultConfig: ProductFlavor - - /** - * A list of all the [BuildType] - */ - val buildTypes: List - - /** - * The list of all the flavor dimensions, may be empty. - */ - val flavorDimensions: Collection - - /** - * The list of all the [ProductFlavor] values, across all dimensions - * - * See [ProductFlavor.dimension] to know which dimension a flavor belongs to. - */ - val productFlavors: List - - /** - * 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 - */ - val compileTarget: String - - /** - * Returns a list of [SigningConfig]. - */ - val signingConfigs: Collection - - /** - * Returns the aapt options. - */ - val aaptOptions: AaptOptions - - /** - * Returns the lint options. - */ - val lintOptions: LintOptions - - /** - * The build tools version used by this module. - */ - val buildToolsVersion: String - - /** - * The options for Dependencies inclusion in APKs. - * - * Only non-null for [projectType] with values [ProjectType.APPLICATION] - */ - val dependenciesInfo: DependenciesInfo? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/AndroidProject.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/AndroidProject.kt deleted file mode 100644 index 854a3a1e4..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/AndroidProject.kt +++ /dev/null @@ -1,200 +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.models - -import com.android.builder.model.v2.AndroidModel -import com.android.builder.model.v2.ModelSyncFile -import com.android.builder.model.v2.ide.AndroidGradlePluginProjectFlags -import com.android.builder.model.v2.ide.JavaCompileOptions -import com.android.builder.model.v2.ide.ProjectType -import com.android.builder.model.v2.ide.Variant -import com.android.builder.model.v2.ide.ViewBindingOptions -import java.io.File - -/** - * Extended information for Android modules. - * - * See [BasicAndroidProject] - */ -@Suppress("unused") -interface AndroidProject : AndroidModel { - - companion object { - // Injectable properties to use with -P - // Sent by Studio 4.2+ - const val PROPERTY_BUILD_MODEL_ONLY = "android.injected.build.model.v2" - - // 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. - const val PROPERTY_ANDROID_SUPPORT_VERSION = "android.injected.studio.version" - - // Sent in when external native projects models requires a refresh. - const val PROPERTY_REFRESH_EXTERNAL_NATIVE_MODEL = - "android.injected.refresh.external.native.model" - - // 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" - - // 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" - - // 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" - 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" - const val PROPERTY_DEPLOY_AS_INSTANT_APP = "android.injected.deploy.instant-app" - const val PROPERTY_SIGNING_COLDSWAP_MODE = "android.injected.coldswap.mode" - const val PROPERTY_APK_SELECT_CONFIG = "android.inject.apkselect.config" - const val PROPERTY_EXTRACT_INSTANT_APK = "android.inject.bundle.extractinstant" - - /** Version code to be used in the built APK. */ - const val PROPERTY_VERSION_CODE = "android.injected.version.code" - - /** Version name to be used in the built APK. */ - const val PROPERTY_VERSION_NAME = "android.injected.version.name" - - /** - * 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" - - /** - * Location of the build attribution file produced by the gradle plugin to be deserialized - * and used in the IDE build attribution. - */ - const val PROPERTY_ATTRIBUTION_FILE_LOCATION = "android.injected.attribution.file.location" - - /** - * 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" - - const val FD_INTERMEDIATES = "intermediates" - const val FD_LOGS = "logs" - const val FD_OUTPUTS = "outputs" - const val FD_GENERATED = "generated" - } - - /** - * The namespace of the main artifact. - * - * This is here rather than on [com.android.builder.model.v2.ide.AndroidArtifact] because this - * is common to all artifacts as it cannot be changed per variants. - */ - val namespace: String - - /** - * The namespace of the AndroidTest artifact. - * - * This is here rather than on [com.android.builder.model.v2.ide.AndroidArtifact] because this - * is common to all artifacts as it cannot be changed per variants. - * - * If there are no AndroidTest components, this returns null. - */ - val androidTestNamespace: String? - - /** - * The namespace of the Test Fixtures artifact. - * - * This is here rather than on [com.android.builder.model.v2.ide.AndroidArtifact] because this - * is common to all artifacts as it cannot be changed per variants. - * - * If there are no AndroidTest components, this returns null. - */ - val testFixturesNamespace: String? - - /** - * 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. - */ - val variants: Collection - - /** Returns the compile options for Java code. */ - val javaCompileOptions: JavaCompileOptions - - /** - * 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 - */ - val resourcePrefix: String? - - /** - * The list of dynamic features. - * - * The values are Gradle project paths. - * - * Only non-null for [projectType] with values [ProjectType.APPLICATION] - */ - val dynamicFeatures: Collection? - - /** - * The options for view binding. - * - * Only non-null if view-binding is enabled - */ - val viewBindingOptions: ViewBindingOptions? - - /** Returns the AGP flags for this project. */ - val flags: AndroidGradlePluginProjectFlags - - /** - * The lint jars that this module uses to run extra lint checks on this project. - * - * This is the resolution of the `lintCheck` configuration. - */ - val lintChecksJars: List - - /** - * Returns all the [ModelSyncFile] for this project. - * - * @return a list of [ModelSyncFile] - * @since 7.3 - */ - val modelSyncFiles: Collection -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/BasicAndroidProject.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/BasicAndroidProject.kt deleted file mode 100644 index 3fa6eb7f3..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/BasicAndroidProject.kt +++ /dev/null @@ -1,76 +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.models - -import com.android.builder.model.v2.AndroidModel -import com.android.builder.model.v2.ide.BasicVariant -import com.android.builder.model.v2.ide.ProjectType -import com.android.builder.model.v2.ide.SourceSetContainer -import java.io.File - -/** - * Basic Entry point for the model of the Android Projects. This models a single module, whether the - * module is an app project, a library project, an Instant App feature project, an instantApp bundle - * project, or a dynamic feature split project. - * - * This part only contains the most basic information: the source folders. For more information - * see [AndroidProject] - */ -interface BasicAndroidProject: AndroidModel { - - /** - * The path of the module. - */ - val path: String - - /** - * Then name of the build this project belongs to. - */ - val buildName: String - - /** - * The type of project: Android application, library, feature, instantApp. - */ - val projectType: ProjectType - - val mainSourceSet: SourceSetContainer? - - val buildTypeSourceSets: Collection - - val productFlavorSourceSets: Collection - - /** - * The list of all the variants. - * - * This does not include test variant. Test variants are additional artifacts in their - * respective variant info. - * - * This only contains the most basic information about the variant: their buildtype/flavors - * and their source sets. - */ - val variants: Collection - - /** - * The boot classpath matching the compile target. This is typically android.jar plus - * other optional libraries. - */ - val bootClasspath: Collection - - /** - * Returns the build folder of this project. - */ - val buildFolder: File -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/BuildMap.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/BuildMap.kt deleted file mode 100644 index 6407708d3..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/BuildMap.kt +++ /dev/null @@ -1,37 +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.models - -import com.android.builder.model.v2.AndroidModel -import java.io.File - -/** - * A Simple model that contains a map of (build-name, build rootDir). - * - * This can be queried on any Android module (and returns the same value regardless of the module) - */ -interface BuildMap: AndroidModel { - - /** - * Map of build-ID, for composite builds. - * - * The map contais (name to rootDir) where rootDir is what is typically - * returned by [org.gradle.tooling.model.BuildIdentifier.BuildIdenfier.rootDir] while name is - * what is returned by [org.gradle.api.artifacts.component.BuildIdentifier.getName] - */ - val buildIdMap: Map -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ModelBuilderParameter.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ModelBuilderParameter.kt deleted file mode 100644 index 102f9e2e5..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ModelBuilderParameter.kt +++ /dev/null @@ -1,30 +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.v2.models - -/** - * The parameter for ModelBuilder to specify what to sync. - * - * This interface is implemented and instantiated on the fly by Gradle when using - * [org.gradle.tooling.BuildController.findModel] - */ -interface ModelBuilderParameter { - - /** - * The name of the variant for which to return [VariantDependencies] - */ - var variantName: String -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ProjectSyncIssues.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ProjectSyncIssues.kt deleted file mode 100644 index 03e1824e0..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ProjectSyncIssues.kt +++ /dev/null @@ -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.models - -import com.android.builder.model.v2.AndroidModel -import com.android.builder.model.v2.ide.SyncIssue - -/** - * Model for a project's [SyncIssue]s. - * - * This model should be fetched last (after other models), in order to have all the SyncIssue's - * collected and delivered. - */ -interface ProjectSyncIssues: AndroidModel { - /** Returns issues found during sync. */ - val syncIssues: Collection -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/VariantDependencies.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/VariantDependencies.kt deleted file mode 100644 index c2ad54106..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/VariantDependencies.kt +++ /dev/null @@ -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.models - -import com.android.builder.model.v2.AndroidModel -import com.android.builder.model.v2.ide.ArtifactDependencies -import com.android.builder.model.v2.ide.Library - -/** - * The dependencies for a given variants. - * - * This will contain the dependencies for the variant's main artifact as well as its tests (if - * applicable) - */ -interface VariantDependencies: AndroidModel { - /** - * Returns the name of the variant. It is made up of the build type and flavors (if applicable) - * - * @return the name of the variant. - */ - val name: String - - val mainArtifact: ArtifactDependencies - - val androidTestArtifact: ArtifactDependencies? - val unitTestArtifact: ArtifactDependencies? - val testFixturesArtifact: ArtifactDependencies? - - /** - * The list of external libraries used by all the variants in the module. - * - * The key for the map entries is the keys found via [com.android.builder.model.v2.ide.GraphItem.key] - * and [Library.key] - */ - val libraries: Map -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/Versions.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/Versions.kt deleted file mode 100644 index 5aa043690..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/Versions.kt +++ /dev/null @@ -1,46 +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.models - -import com.android.builder.model.v2.AndroidModel - -/** - * Basic model providing version information about the actual models. - * - * This model is meant to be very stable and never change, so that Studio can safely query it. - */ -interface Versions: AndroidModel { - interface Version { - val major: Int - val minor: Int - } - - val versions: Map - - companion object { - const val BASIC_ANDROID_PROJECT = "basic_android_project" - const val ANDROID_PROJECT = "android_project" - const val ANDROID_DSL = "android_dsl" - const val VARIANT_DEPENDENCIES = "variant_dependencies" - const val NATIVE_MODULE = "native_module" - } - - /** - * The version of AGP. - */ - val agp: String -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeAbi.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeAbi.kt deleted file mode 100644 index d05e2527b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeAbi.kt +++ /dev/null @@ -1,71 +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.models.ndk - -import com.android.builder.model.v2.AndroidModel -import java.io.File - -/** - * Response returned by Gradle to Android Studio containing information about a native ABI under a - * module and variant. - */ -interface NativeAbi: AndroidModel { - /** - * The ABI name. This value aligns with [com.android.build.gradle.internal.core.Abi.tag]. For - * example, "x86_64", "arm64-v8a". - */ - val name: String - - /** - * File containing compiler flags. - * - * As for now this file is always a compile_commands.json. See - * https://clang.llvm.org/docs/JSONCompilationDatabase.html for details of the format. - * - * This file is generated if requested in [NativeModelBuilderParameter]. - */ - val sourceFlagsFile: File - - /** - * Text file containing a list of folders that contains shared libraries used by the APK. - * - * This file is generated if requested in [NativeModelBuilderParameter]. - */ - val symbolFolderIndexFile: File - - /** - * Text file containing a list of build files for the native build system used by this projects. - * - * For example, if CMake is used, this file contains a list of CMakeLists.txt used by the - * project. - * - * This file is generated if requested in [NativeModelBuilderParameter]. - */ - val buildFileIndexFile: File - - /** - * Text file containing a list of additional project files that are known to the build system. - * - * For example, if CMake is used, this file contains explicitly listed header files for a user - * library. - * - * This file is generated if requested in [NativeModelBuilderParameter]. - * - * @since 7.0 - */ - val additionalProjectFilesIndexFile: File -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeModelBuilderParameter.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeModelBuilderParameter.kt deleted file mode 100644 index 5d732d34b..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeModelBuilderParameter.kt +++ /dev/null @@ -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.models.ndk - -import java.io.Serializable - -/** Parameter sent by Android Studio when querying Gradle. */ -interface NativeModelBuilderParameter : Serializable { - - /** - * Variants for which the build information should be generated. Unrecognized variants are - * ignored. - * - * If null, it means the build information should be generated for all variants. - * - * Build information includes the following: - * - * - compile_commands.json - * - build_file_index.txt - * - symbol_folder_index.txt - */ - var variantsToGenerateBuildInformation: List? - - /** - * ABIs for which the build information should be generated. - * - * If null, it means the build information should be generated for all ABIs. Unrecognized ABIs are - * ignored. - * - * Build information includes the following: - * - * - compile_commands.json - * - build_file_index.txt - * - symbol_folder_index.txt - */ - var abisToGenerateBuildInformation: List? -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeModule.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeModule.kt deleted file mode 100644 index 5c66789f8..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeModule.kt +++ /dev/null @@ -1,58 +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.models.ndk - -import com.android.builder.model.v2.AndroidModel -import java.io.File - -enum class NativeBuildSystem { - NDK_BUILD, CMAKE, NINJA -} - -/** - * Response returned by Gradle to Android Studio containing information about an Android module that - * contains native code. - */ -interface NativeModule : AndroidModel { - - /** The name of the module. For example "HelloWorld.app". */ - val name: String - - /** Variants in this module. */ - val variants: List - - /** The native build system used by this module. */ - val nativeBuildSystem: NativeBuildSystem - - /** - * The version of NDK used to build the native part of this module. For example "21.1.6352462". - */ - val ndkVersion: String - - /** - * The NDK version used by this Android Gradle Plugin if the build author has not specified - * a different version in [ndkVersion]. For example "21.1.6352462". - * This is constant for any particular Android Gradle Plugin Version. - */ - val defaultNdkVersion: String - - /** - * The absolute path of the root external build file. For example, - * "/app/src/main/cpp/CMakeLists.txt". - */ - val externalNativeBuildFile: File -} diff --git a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeVariant.kt b/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeVariant.kt deleted file mode 100644 index 9f42c7246..000000000 --- a/build-tools/builder-model/src/main/java/com/android/builder/model/v2/models/ndk/NativeVariant.kt +++ /dev/null @@ -1,31 +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.models.ndk - -import com.android.builder.model.v2.AndroidModel - -/** - * Response returned by Gradle to Android Studio containing information about a variant in a native - * module. - */ -interface NativeVariant: AndroidModel { - /** Name of the variant. For example "debug", "release". */ - val name: String - - /** ABIs in this variant. */ - val abis: List -} \ No newline at end of file diff --git a/build-tools/tooling-api-impl/build.gradle b/build-tools/tooling-api-impl/build.gradle index e1b5d65fe..8c551dee8 100644 --- a/build-tools/tooling-api-impl/build.gradle +++ b/build-tools/tooling-api-impl/build.gradle @@ -15,6 +15,8 @@ * along with AndroidIDE. If not, see . */ +import org.apache.tools.ant.filters.ReplaceTokens + plugins { id 'com.github.johnrengelman.shadow' version '7.1.2' id 'java-library' @@ -34,6 +36,16 @@ jar { } } +task processSource(type: Sync) { + from sourceSets.main.java + filter(ReplaceTokens, tokens: [AGP_VERSION: project.property ("androidide.tooling.supportedAgpVersion")]) + into "$buildDir/src" +} + +compileJava { + source = processSource.outputs +} + shadowJar { archiveBaseName.set ('tooling-api') archiveClassifier.set ('all') diff --git a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/Main.java b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/Main.java index 70688cfff..d8a37602a 100644 --- a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/Main.java +++ b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/Main.java @@ -36,6 +36,7 @@ import java.util.concurrent.Future; public class Main { private static final ILogger LOG = newInstance("ToolingApiMain"); + public static final String SUPPORTED_AGP_VERSION = "@AGP_VERSION@"; public static IToolingApiClient client; public static Future future; diff --git a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/util/ProjectReader.java b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/util/ProjectReader.java index 8b41d587a..a2558ccf3 100644 --- a/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/util/ProjectReader.java +++ b/build-tools/tooling-api-impl/src/main/java/com/itsaky/androidide/tooling/impl/util/ProjectReader.java @@ -74,7 +74,7 @@ public class ProjectReader { return buildGradleProjectModel(ideaProject, controller, outIssues); }); - finalizeLauncher (buildActionExecutor); + finalizeLauncher(buildActionExecutor); applyAndroidModelBuilderProps(buildActionExecutor); final var logger = ILogger.newInstance("ProjectReader"); @@ -186,6 +186,7 @@ public class ProjectReader { return null; } + System.err.println(versions); System.err.println("Fetching basic project model..."); final var basicAndroid = controller.findModel(gradle, BasicAndroidProject.class); @@ -296,8 +297,8 @@ public class ProjectReader { private static > void applyAndroidModelBuilderProps( ConfigurableLauncher launcher) { - addProperty(launcher, AndroidProject.PROPERTY_BUILD_MODEL_ONLY, true); - addProperty(launcher, AndroidProject.PROPERTY_INVOKED_FROM_IDE, true); + addProperty(launcher, IdeAndroidModule.PROPERTY_BUILD_MODEL_ONLY, true); + addProperty(launcher, IdeAndroidModule.PROPERTY_INVOKED_FROM_IDE, true); } private static void addProperty( diff --git a/build-tools/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/ToolingApiImplTest.kt b/build-tools/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/ToolingApiImplTest.kt index 2ae555a06..ace01f2dd 100644 --- a/build-tools/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/ToolingApiImplTest.kt +++ b/build-tools/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/ToolingApiImplTest.kt @@ -28,11 +28,13 @@ import com.itsaky.androidide.tooling.api.model.IdeAndroidModule import com.itsaky.androidide.tooling.api.model.IdeGradleProject import com.itsaky.androidide.tooling.api.model.IdeJavaModule import com.itsaky.androidide.tooling.api.util.ToolingApiLauncher +import com.itsaky.androidide.tooling.events.ProgressEvent import com.itsaky.androidide.utils.ILogger import java.io.BufferedReader import java.io.File import java.io.InputStream import java.io.InputStreamReader +import java.util.concurrent.* import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 @@ -121,7 +123,10 @@ class ToolingApiImplTest { override fun onBuildFailed(result: BuildResult) {} override fun onProgressEvent(event: ProgressEvent) { - log.debug(event.javaClass) + } + + override fun getBuildArguments(): CompletableFuture> { + return CompletableFuture.completedFuture(emptyList()) } } diff --git a/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar b/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar index f3afc55c7..58cb7290b 100644 Binary files a/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar and b/build-tools/tooling-api-impl/src/test/test-home/.androidide/init/model.jar differ diff --git a/build-tools/tooling-api-model/build.gradle b/build-tools/tooling-api-model/build.gradle index 00c1f0430..5e3405116 100644 --- a/build-tools/tooling-api-model/build.gradle +++ b/build-tools/tooling-api-model/build.gradle @@ -34,7 +34,7 @@ repositories { dependencies { implementation project (path: ':build-tools:logger') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - api project (':build-tools:builder-model') + api "com.android.tools.build:builder-model:${project.property ("androidide.tooling.supportedAgpVersion")}" } task copyToTestDir (type: Copy) { diff --git a/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/IdeAndroidModule.kt b/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/IdeAndroidModule.kt index 83c0eb97f..f1e22120a 100644 --- a/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/IdeAndroidModule.kt +++ b/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/IdeAndroidModule.kt @@ -50,7 +50,7 @@ class IdeAndroidModule( override var variants: Collection, override var viewBindingOptions: DefaultViewBindingOptions?, override val lintChecksJars: List, - override val modelSyncFiles: List, + val modelSyncFiles: List, ) : IdeGradleProject(name, description, path, projectDir, buildDir, buildScript, parent, tasks), IdeModule, @@ -61,6 +61,87 @@ class IdeAndroidModule( var mainSourceSet: DefaultSourceSetContainer? = null var variantDependencies: MutableMap = mutableMapOf() + @Suppress("unused") + companion object { + // Injectable properties to use with -P + // Sent by Studio 4.2+ + const val PROPERTY_BUILD_MODEL_ONLY = "android.injected.build.model.v2" + + // 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. + const val PROPERTY_ANDROID_SUPPORT_VERSION = "android.injected.studio.version" + + // Sent in when external native projects models requires a refresh. + const val PROPERTY_REFRESH_EXTERNAL_NATIVE_MODEL = + "android.injected.refresh.external.native.model" + + // 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" + + // 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" + + // 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" + 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" + const val PROPERTY_DEPLOY_AS_INSTANT_APP = "android.injected.deploy.instant-app" + const val PROPERTY_SIGNING_COLDSWAP_MODE = "android.injected.coldswap.mode" + const val PROPERTY_APK_SELECT_CONFIG = "android.inject.apkselect.config" + const val PROPERTY_EXTRACT_INSTANT_APK = "android.inject.bundle.extractinstant" + + /** Version code to be used in the built APK. */ + const val PROPERTY_VERSION_CODE = "android.injected.version.code" + + /** Version name to be used in the built APK. */ + const val PROPERTY_VERSION_NAME = "android.injected.version.name" + + /** + * 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" + + /** + * Location of the build attribution file produced by the gradle plugin to be deserialized + * and used in the IDE build attribution. + */ + const val PROPERTY_ATTRIBUTION_FILE_LOCATION = "android.injected.attribution.file.location" + + /** + * 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" + + const val FD_INTERMEDIATES = "intermediates" + const val FD_LOGS = "logs" + const val FD_OUTPUTS = "outputs" + const val FD_GENERATED = "generated" + } + fun copy(): IdeAndroidModule { return IdeAndroidModule( name, @@ -83,9 +164,7 @@ class IdeAndroidModule( } override fun getGeneratedJar(variant: String): File { - return File( - buildDir, - "${AndroidProject.FD_INTERMEDIATES}/compile_library_classes_jar/$variant/classes.jar") + return File(buildDir, "$FD_INTERMEDIATES/compile_library_classes_jar/$variant/classes.jar") } // These properties are not supported on newer versions diff --git a/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/internal/DefaultVariant.kt b/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/internal/DefaultVariant.kt index 06ce6411e..fc082d0c1 100644 --- a/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/internal/DefaultVariant.kt +++ b/build-tools/tooling-api-model/src/main/java/com/itsaky/androidide/tooling/api/model/internal/DefaultVariant.kt @@ -27,7 +27,7 @@ class DefaultVariant : Variant, Serializable { override var androidTestArtifact: DefaultAndroidArtifact? = null override var displayName: String = "" override var isInstantAppCompatible: Boolean = false - override var desugaredMethods: List = emptyList() + var desugaredMethods: List = emptyList() override var mainArtifact: DefaultAndroidArtifact = DefaultAndroidArtifact() override var name: String = "" override var testFixturesArtifact: DefaultAndroidArtifact? = null diff --git a/gradle.properties b/gradle.properties index 32d47fc41..adef3ec9a 100755 --- a/gradle.properties +++ b/gradle.properties @@ -14,3 +14,4 @@ org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" android.useAndroidX=true android.enableJetifier=true +androidide.tooling.supportedAgpVersion=7.2.0-rc02 diff --git a/settings.gradle b/settings.gradle index 581c4b0d9..d6ece6c33 100755 --- a/settings.gradle +++ b/settings.gradle @@ -17,11 +17,9 @@ include ':lsp:testing' include ':build-tools' include ':build-tools:builder-api' -include ':build-tools:builder-model' include ':build-tools:framework-stubs' include ':build-tools:google-java-format' include ':build-tools:javac' -include ':build-tools:jsonrpc' include ':build-tools:logger' include ':build-tools:tooling-api' include ':build-tools:tooling-api-events'