1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.sdklib.internal.repository.packages;
18
19import com.android.sdklib.repository.SdkRepoConstants;
20
21/**
22 * Interface used to decorate a {@link Package} that has a dependency
23 * on a minimal platform-tools revision, e.g. which XML has a
24 * <code>&lt;min-platform-tools-rev&gt;</code> element.
25 * <p/>
26 * A package that has this dependency can only be installed if the requested platform-tools
27 * revision is present or installed at the same time.
28 */
29public interface IMinPlatformToolsDependency {
30
31    /**
32     * The value of {@link #getMinPlatformToolsRevision()} when the
33     * {@link SdkRepoConstants#NODE_MIN_PLATFORM_TOOLS_REV} was not specified in the XML source.
34     * Since this is a required attribute in the XML schema, it can only happen when dealing
35     * with an invalid repository XML.
36     */
37    public static final FullRevision MIN_PLATFORM_TOOLS_REV_INVALID =
38        new FullRevision(FullRevision.MISSING_MAJOR_REV);
39
40    /**
41     * The minimal revision of the tools package required by this package if > 0,
42     * or {@link #MIN_PLATFORM_TOOLS_REV_INVALID} if the value was missing.
43     * <p/>
44     * This attribute is mandatory and should not be normally missing.
45     * It can only happen when dealing with an invalid repository XML.
46     */
47    public abstract FullRevision getMinPlatformToolsRevision();
48
49}
50