diff options
author | Alex Ruiz <alruiz@google.com> | 2015-08-01 00:38:21 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-08-01 00:38:21 +0000 |
commit | 69001aea75b52db0d8cb1bb56d11a36894773a86 (patch) | |
tree | 4f05e3dcd508b4428b936b74f9328ea48cbe15d7 /android/src | |
parent | 690756d9bbbbca7f25f143038a83959a16d956f7 (diff) | |
parent | 5723e1e4f24fdc31078e884491acc8356485d426 (diff) | |
download | idea-69001aea75b52db0d8cb1bb56d11a36894773a86.tar.gz |
Merge "Draft a generic AndroidModel interface." into studio-1.4-dev automerge: 1e88256
automerge: 5723e1e
* commit '5723e1e4f24fdc31078e884491acc8356485d426':
Draft a generic AndroidModel interface.
Diffstat (limited to 'android/src')
-rw-r--r-- | android/src/com/android/tools/idea/model/AndroidModel.java | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/android/src/com/android/tools/idea/model/AndroidModel.java b/android/src/com/android/tools/idea/model/AndroidModel.java new file mode 100644 index 00000000000..ff908795eec --- /dev/null +++ b/android/src/com/android/tools/idea/model/AndroidModel.java @@ -0,0 +1,136 @@ +/* + * 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.tools.idea.model; + +import com.android.builder.model.AndroidArtifact; +import com.android.builder.model.BaseArtifact; +import com.android.builder.model.SourceProvider; +import com.android.sdklib.AndroidVersion; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collection; +import java.util.List; + +/** + * A common interface for Android module models. + */ +public interface AndroidModel { + /** + * @return the currently selected main Android artifact produced by this Android module. + * TODO: Remove this method - it exposes Gradle-specific AndroidArtifact. + */ + @Deprecated + @NotNull + AndroidArtifact getMainArtifact(); + + /** + * @return the currently selected test artifact produced by this Android module. + * TODO: Remove this method - it exposes Gradle-specific BaseArtifact. + */ + @Deprecated + @Nullable + BaseArtifact getTestArtifact(); + + /** + * @return the default source provider. + * TODO: To be build-system-agnostic, simplify source provider usage. + * {@link org.jetbrains.android.facet.AndroidFacet#getMainSourceProvider()} + */ + @Deprecated + @NotNull + SourceProvider getDefaultSourceProvider(); + + /** + * @return the currently active (non-test) source providers for this Android module in + * overlay order (meaning that later providers override earlier providers when they redefine + * resources). + * {@link org.jetbrains.android.facet.IdeaSourceProvider#getCurrentSourceProviders} + */ + @Deprecated + @NotNull + List<SourceProvider> getActiveSourceProviders(); + + /** + * @return the currently active test source providers for this Android module in overlay order. + * {@link org.jetbrains.android.facet.IdeaSourceProvider#getCurrentTestSourceProviders} + */ + @Deprecated + @NotNull + List<SourceProvider> getTestSourceProviders(); + + /** + * @return all of the non-test source providers, including those that are not currently active. + * {@link org.jetbrains.android.facet.IdeaSourceProvider#getAllSourceProviders(AndroidFacet)} + */ + @Deprecated + @NotNull + List<SourceProvider> getAllSourceProviders(); + + /** + * @return the current version code for this Android module, or null if not specified. + */ + @Deprecated + @Nullable + Integer getVersionCode(); + + /** + * @return the current application ID. + * See {@link com.android.tools.idea.gradle.IdeaAndroidProject#computePackageName()} + */ + @NotNull + String getApplicationId(); + + /** + * @return all the application IDs of artifacts this Android module could produce. + */ + @NotNull + Collection<String> getAllApplicationIds(); + + /** + * @return whether the manifest package is overriden. + * TODO: Potentially dedupe with computePackageName. + */ + @Deprecated + boolean overridesManifestPackage(); + + /** + * @return whether the application is debuggable, or null if not specified. + * {@link AndroidModuleInfo#isDebuggable()} + */ + Boolean isDebuggable(); + + /** + * @return the minimum supported SDK version. + * {@link AndroidModuleInfo#getMinSdkVersion()} + */ + @Nullable + AndroidVersion getMinSdkVersion(); + + /** + * @return the target SDK version. + * {@link AndroidModuleInfo#getTargetSdkVersion()} + */ + @Nullable + AndroidVersion getTargetSdkVersion(); + + /** + * @return for test execution, the fully-qualified class name of the specified instrumentation runner if present. + */ + @Nullable + @Deprecated + String getTestInstrumentationRunner(); +} |