blob: 8544a934d332398ebf09b802dcf2a60a5c704fdc [file] [log] [blame]
Brett Chabot05b83572010-09-07 18:21:57 -07001/*
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 */
Brett Chabot7cc0e252011-02-10 09:56:45 -080016package com.android.cts.tradefed.build;
Brett Chabot05b83572010-09-07 18:21:57 -070017
Brett Chabot7cc0e252011-02-10 09:56:45 -080018import com.android.tradefed.build.FolderBuildInfo;
19import com.android.tradefed.build.IBuildInfo;
20import com.android.tradefed.build.IBuildProvider;
21import com.android.tradefed.build.IFolderBuildInfo;
Brett Chabot05b83572010-09-07 18:21:57 -070022import com.android.tradefed.config.Option;
Brett Chabot05b83572010-09-07 18:21:57 -070023
24import java.io.File;
25
26/**
27 * A simple {@link IBuildProvider} that uses a pre-existing CTS install.
28 */
29public class CtsBuildProvider implements IBuildProvider {
30
31 @Option(name="cts-install-path", description="the path to the cts installation to use")
Brett Chabot3fc406b2011-02-14 15:55:00 -080032 private String mCtsRootDirPath = System.getProperty("CTS_ROOT");
Brett Chabot05b83572010-09-07 18:21:57 -070033
Unsuk Jung5ec46992015-01-15 11:51:53 -080034 public static final String CTS_BUILD_VERSION = "5.1_r0.5";
Brett Chabotc51a3502011-10-19 19:11:15 -070035
Brett Chabot05b83572010-09-07 18:21:57 -070036 /**
37 * {@inheritDoc}
38 */
Brian Muramatsua275ecc2011-10-31 11:01:31 -070039 @Override
40 public IBuildInfo getBuild() {
Brett Chabot3fc406b2011-02-14 15:55:00 -080041 if (mCtsRootDirPath == null) {
Brett Chabot05b83572010-09-07 18:21:57 -070042 throw new IllegalArgumentException("Missing --cts-install-path");
43 }
Brett Chabotc51a3502011-10-19 19:11:15 -070044 IFolderBuildInfo ctsBuild = new FolderBuildInfo(CTS_BUILD_VERSION, "cts", "cts");
Brett Chabot3fc406b2011-02-14 15:55:00 -080045 ctsBuild.setRootDir(new File(mCtsRootDirPath));
Brett Chabot05b83572010-09-07 18:21:57 -070046 return ctsBuild;
47 }
48
49 /**
50 * {@inheritDoc}
51 */
Brian Muramatsua275ecc2011-10-31 11:01:31 -070052 @Override
Brett Chabot05b83572010-09-07 18:21:57 -070053 public void buildNotTested(IBuildInfo info) {
54 // ignore
55 }
Brett Chabot4f8143c2010-12-14 18:29:44 -080056
57 /**
58 * {@inheritDoc}
59 */
Brian Muramatsua275ecc2011-10-31 11:01:31 -070060 @Override
Brett Chabot4f8143c2010-12-14 18:29:44 -080061 public void cleanUp(IBuildInfo info) {
62 // ignore
63 }
Brett Chabot05b83572010-09-07 18:21:57 -070064}