Home | History | Annotate | Download | only in build
      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  */
     16 package com.android.cts.tradefed.build;
     17 
     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;
     22 import com.android.tradefed.config.Option;
     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")
     32     private String mCtsRootDirPath = System.getProperty("CTS_ROOT");
     33 
     34     public static final String CTS_BUILD_VERSION = "4.4_r3";
     35 
     36     /**
     37      * {@inheritDoc}
     38      */
     39     @Override
     40     public IBuildInfo getBuild() {
     41         if (mCtsRootDirPath == null) {
     42             throw new IllegalArgumentException("Missing --cts-install-path");
     43         }
     44         IFolderBuildInfo ctsBuild = new FolderBuildInfo(CTS_BUILD_VERSION, "cts", "cts");
     45         ctsBuild.setRootDir(new File(mCtsRootDirPath));
     46         return ctsBuild;
     47     }
     48 
     49     /**
     50      * {@inheritDoc}
     51      */
     52     @Override
     53     public void buildNotTested(IBuildInfo info) {
     54         // ignore
     55     }
     56 
     57     /**
     58      * {@inheritDoc}
     59      */
     60     @Override
     61     public void cleanUp(IBuildInfo info) {
     62         // ignore
     63     }
     64 }
     65