DexOptions.java revision 69dd411c7ef47e3ea3f6ff8be9a4d903f545f0d5
1/*
2 * Copyright (C) 2011 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
17package com.android.dx.dex;
18
19/**
20 * Container for options used to control details of dex file generation.
21 */
22public class DexOptions {
23    /** target API level */
24    public int targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES;
25
26    /** force generation of jumbo opcodes */
27    public boolean forceJumbo = false;
28
29    /**
30     * Gets the dex file magic number corresponding to this instance.
31     */
32    public String getMagic() {
33        return DexFormat.apiToMagic(targetApiLevel);
34    }
35
36    /**
37     * Returns whether extended opcodes are allowed. This became
38     * allowed as of Ice Cream Sandwich.
39     */
40    public boolean canUseExtendedOpcodes() {
41        return targetApiLevel >= DexFormat.API_CURRENT;
42    }
43}
44