1 /*
2  * Copyright (C) 2018 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.tradefed.sandbox;
17 
18 import com.android.tradefed.config.Option;
19 import com.android.tradefed.config.OptionClass;
20 
21 import java.io.File;
22 
23 /** Class that can receive and provide options to a {@link ISandbox}. */
24 @OptionClass(alias = "sandbox", global_namespace = false)
25 public final class SandboxOptions {
26 
27     public static final String TF_LOCATION = "tf-location";
28     public static final String SANDBOX_BUILD_ID = "sandbox-build-id";
29 
30     @Option(
31         name = TF_LOCATION,
32         description = "The path to the Tradefed binary of the version to use for the sandbox."
33     )
34     private File mTfVersion = null;
35 
36     @Option(
37         name = SANDBOX_BUILD_ID,
38         description =
39                 "Provide the build-id to force the sandbox version of Tradefed to be."
40                         + "Mutually exclusive with the tf-location option."
41     )
42     private String mBuildId = null;
43 
44     /**
45      * Returns the provided directories containing the Trade Federation version to use for
46      * sandboxing the run.
47      */
getSandboxTfDirectory()48     public File getSandboxTfDirectory() {
49         return mTfVersion;
50     }
51 
52     /** Returns the build-id forced for the sandbox to be used during the run. */
getSandboxBuildId()53     public String getSandboxBuildId() {
54         return mBuildId;
55     }
56 }
57