blob: 782e6ab9661dfc4402b5772c75e664137d57fdd2 [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
Stuart Scottb95b1c82015-07-31 17:28:39 +000018import com.android.tradefed.build.FolderBuildInfo;
Brett Chabot7cc0e252011-02-10 09:56:45 -080019import 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
Daniel Xiea41d4972015-10-19 15:35:16 -070034 public static final String CTS_BUILD_VERSION = "6.0_r1";
leozwange42ea3f2015-05-23 22:19:11 -070035 public static final String CTS_PACKAGE = "com.android.cts.tradefed.testtype";
Brett Chabotc51a3502011-10-19 19:11:15 -070036
Brett Chabot05b83572010-09-07 18:21:57 -070037 /**
38 * {@inheritDoc}
39 */
Brian Muramatsua275ecc2011-10-31 11:01:31 -070040 @Override
41 public IBuildInfo getBuild() {
Brett Chabot3fc406b2011-02-14 15:55:00 -080042 if (mCtsRootDirPath == null) {
Brett Chabot05b83572010-09-07 18:21:57 -070043 throw new IllegalArgumentException("Missing --cts-install-path");
44 }
Stuart Scottb95b1c82015-07-31 17:28:39 +000045 IFolderBuildInfo ctsBuild = new FolderBuildInfo(
46 Package.getPackage(CTS_PACKAGE).getImplementationVersion(),
47 "cts", "cts");
Brett Chabot3fc406b2011-02-14 15:55:00 -080048 ctsBuild.setRootDir(new File(mCtsRootDirPath));
Brett Chabot05b83572010-09-07 18:21:57 -070049 return ctsBuild;
50 }
51
52 /**
53 * {@inheritDoc}
54 */
Brian Muramatsua275ecc2011-10-31 11:01:31 -070055 @Override
Brett Chabot05b83572010-09-07 18:21:57 -070056 public void buildNotTested(IBuildInfo info) {
57 // ignore
58 }
Brett Chabot4f8143c2010-12-14 18:29:44 -080059
60 /**
61 * {@inheritDoc}
62 */
Brian Muramatsua275ecc2011-10-31 11:01:31 -070063 @Override
Brett Chabot4f8143c2010-12-14 18:29:44 -080064 public void cleanUp(IBuildInfo info) {
65 // ignore
66 }
Brett Chabot05b83572010-09-07 18:21:57 -070067}