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 | |
Brett Chabot | 7cc0e25 | 2011-02-10 09:56:45 -0800 | [diff] [blame] | 18 | import com.android.tradefed.build.FolderBuildInfo; |
| 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 | |
Unsuk Jung | 5ec4699 | 2015-01-15 11:51:53 -0800 | [diff] [blame] | 34 | public static final String CTS_BUILD_VERSION = "5.1_r0.5"; |
Brett Chabot | c51a350 | 2011-10-19 19:11:15 -0700 | [diff] [blame] | 35 | |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 36 | /** |
| 37 | * {@inheritDoc} |
| 38 | */ |
Brian Muramatsu | a275ecc | 2011-10-31 11:01:31 -0700 | [diff] [blame] | 39 | @Override |
| 40 | public IBuildInfo getBuild() { |
Brett Chabot | 3fc406b | 2011-02-14 15:55:00 -0800 | [diff] [blame] | 41 | if (mCtsRootDirPath == null) { |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 42 | throw new IllegalArgumentException("Missing --cts-install-path"); |
| 43 | } |
Brett Chabot | c51a350 | 2011-10-19 19:11:15 -0700 | [diff] [blame] | 44 | IFolderBuildInfo ctsBuild = new FolderBuildInfo(CTS_BUILD_VERSION, "cts", "cts"); |
Brett Chabot | 3fc406b | 2011-02-14 15:55:00 -0800 | [diff] [blame] | 45 | ctsBuild.setRootDir(new File(mCtsRootDirPath)); |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 46 | return ctsBuild; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * {@inheritDoc} |
| 51 | */ |
Brian Muramatsu | a275ecc | 2011-10-31 11:01:31 -0700 | [diff] [blame] | 52 | @Override |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 53 | public void buildNotTested(IBuildInfo info) { |
| 54 | // ignore |
| 55 | } |
Brett Chabot | 4f8143c | 2010-12-14 18:29:44 -0800 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * {@inheritDoc} |
| 59 | */ |
Brian Muramatsu | a275ecc | 2011-10-31 11:01:31 -0700 | [diff] [blame] | 60 | @Override |
Brett Chabot | 4f8143c | 2010-12-14 18:29:44 -0800 | [diff] [blame] | 61 | public void cleanUp(IBuildInfo info) { |
| 62 | // ignore |
| 63 | } |
Brett Chabot | 05b8357 | 2010-09-07 18:21:57 -0700 | [diff] [blame] | 64 | } |