1 /* 2 * Copyright (C) 2011 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 package com.android.tradefed.build; 17 18 import java.io.File; 19 20 /** 21 * A {@link IBuildInfo} that represents an extracted Android SDK and tests. 22 */ 23 public interface ISdkBuildInfo extends IBuildInfo { 24 25 /** 26 * Returns the directory that contains the extracted SDK build. 27 */ getSdkDir()28 public File getSdkDir(); 29 30 /** 31 * Returns the directory that contains the extracted tests. 32 */ getTestsDir()33 public File getTestsDir(); 34 35 /** 36 * Sets the directory that contains the extracted tests. 37 */ setTestsDir(File testsDir)38 public void setTestsDir(File testsDir); 39 40 /** 41 * Sets the directory that contains the extracted SDK build. 42 * 43 * @param sdkDir the path to the sdk. 44 */ setSdkDir(File sdkDir)45 public void setSdkDir(File sdkDir); 46 47 /** 48 * Sets the directory that contains the extracted SDK build. 49 * 50 * @param sdkDir the path to the sdk 51 * @param deleteParent if <code>true</code>, delete the parent directory of sdkDir on 52 * {@link #cleanUp()}. If <code>false</code>, only sdkDir will be deleted. 53 */ setSdkDir(File sdkDir, boolean deleteParent)54 public void setSdkDir(File sdkDir, boolean deleteParent); 55 56 /** 57 * Helper method to get the absolute file path to the 'android' tool in this sdk build. 58 * <p/> 59 * A valid path must be provided to {@link #setSdkDir(File)} before calling. 60 * 61 * @return the absolute file path to the android tool. 62 * @throws IllegalStateException if sdkDir is not set 63 */ getAndroidToolPath()64 public String getAndroidToolPath(); 65 66 /** 67 * Helper method to get the absolute file path to the 'emulator' tool in this sdk build. 68 * <p/> 69 * A valid path must be provided to {@link #setSdkDir(File)} before calling. 70 * 71 * @return the absolute file path to the android tool. 72 * @throws IllegalStateException if sdkDir is not set 73 */ getEmulatorToolPath()74 public String getEmulatorToolPath(); 75 76 /** 77 * Gets the list of targets installed in this SDK build. 78 * <p/> 79 * A valid path must be provided to {@link #setSdkDir(File)} before calling. 80 * 81 * @return a list of defined targets or <code>null</code> if targets could not be retrieved 82 * @throws IllegalStateException if sdkDir is not set 83 */ getSdkTargets()84 public String[] getSdkTargets(); 85 86 /** 87 * Helper method to ensure all sdk tool binaries are executable. 88 */ makeToolsExecutable()89 public void makeToolsExecutable(); 90 } 91