Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 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 | */ |
Brett Chabot | 7cc0e25 | 2011-02-10 09:56:45 -0800 | [diff] [blame] | 16 | package com.android.cts.tradefed.build; |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 17 | |
Stuart Scott | b95b1c8 | 2015-07-31 17:28:39 +0000 | [diff] [blame] | 18 | import com.android.tradefed.build.FolderBuildInfo; |
Brett Chabot | 7cc0e25 | 2011-02-10 09:56:45 -0800 | [diff] [blame] | 19 | import com.android.tradefed.build.IBuildInfo; |
| 20 | import com.android.tradefed.build.IBuildProvider; |
| 21 | import com.android.tradefed.build.IFolderBuildInfo; |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 22 | import com.android.tradefed.config.Option; |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 23 | |
| 24 | import java.io.File; |
| 25 | |
| 26 | /** |
| 27 | * A simple {@link IBuildProvider} that uses a pre-existing CTS install. |
| 28 | */ |
| 29 | public class CtsBuildProvider implements IBuildProvider { |
| 30 | |
| 31 | @Option(name="cts-install-path", description="the path to the cts installation to use") |
Brett Chabot | 3fc406b | 2011-02-14 15:55:00 -0800 | [diff] [blame] | 32 | private String mCtsRootDirPath = System.getProperty("CTS_ROOT"); |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 33 | |
Daniel Xie | a41d497 | 2015-10-19 15:35:16 -0700 | [diff] [blame] | 34 | public static final String CTS_BUILD_VERSION = "6.0_r1"; |
leozwang | e42ea3f | 2015-05-23 22:19:11 -0700 | [diff] [blame] | 35 | public static final String CTS_PACKAGE = "com.android.cts.tradefed.testtype"; |
Brett Chabot | c51a350 | 2011-10-19 19:11:15 -0700 | [diff] [blame] | 36 | |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 37 | /** |
| 38 | * {@inheritDoc} |
| 39 | */ |
Brian Muramatsu | a275ecc | 2011-10-31 11:01:31 -0700 | [diff] [blame] | 40 | @Override |
| 41 | public IBuildInfo getBuild() { |
Brett Chabot | 3fc406b | 2011-02-14 15:55:00 -0800 | [diff] [blame] | 42 | if (mCtsRootDirPath == null) { |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 43 | throw new IllegalArgumentException("Missing --cts-install-path"); |
| 44 | } |
Stuart Scott | b95b1c8 | 2015-07-31 17:28:39 +0000 | [diff] [blame] | 45 | IFolderBuildInfo ctsBuild = new FolderBuildInfo( |
| 46 | Package.getPackage(CTS_PACKAGE).getImplementationVersion(), |
| 47 | "cts", "cts"); |
Brett Chabot | 3fc406b | 2011-02-14 15:55:00 -0800 | [diff] [blame] | 48 | ctsBuild.setRootDir(new File(mCtsRootDirPath)); |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 49 | return ctsBuild; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * {@inheritDoc} |
| 54 | */ |
Brian Muramatsu | a275ecc | 2011-10-31 11:01:31 -0700 | [diff] [blame] | 55 | @Override |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 56 | public void buildNotTested(IBuildInfo info) { |
| 57 | // ignore |
| 58 | } |
Brett Chabot | 4f8143c | 2010-12-14 18:29:44 -0800 | [diff] [blame] | 59 | |
| 60 | /** |
| 61 | * {@inheritDoc} |
| 62 | */ |
Brian Muramatsu | a275ecc | 2011-10-31 11:01:31 -0700 | [diff] [blame] | 63 | @Override |
Brett Chabot | 4f8143c | 2010-12-14 18:29:44 -0800 | [diff] [blame] | 64 | public void cleanUp(IBuildInfo info) { |
| 65 | // ignore |
| 66 | } |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 67 | } |