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