Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 1 | // Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | package utils; |
| 5 | |
Jean-Marie Henaff | 34d85f7 | 2017-06-14 10:32:04 +0200 | [diff] [blame] | 6 | import java.io.File; |
| 7 | |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 8 | public class Utils { |
| 9 | public static String toolsDir() { |
Jean-Marie Henaff | 39587a8 | 2017-06-08 15:20:13 +0200 | [diff] [blame] | 10 | String osName = System.getProperty("os.name"); |
| 11 | if (osName.equals("Mac OS X")) { |
| 12 | return "mac"; |
| 13 | } else if (osName.contains("Windows")) { |
| 14 | return "windows"; |
| 15 | } else { |
| 16 | return "linux"; |
| 17 | } |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 18 | } |
Jean-Marie Henaff | 34d85f7 | 2017-06-14 10:32:04 +0200 | [diff] [blame] | 19 | |
| 20 | public static File dexMergerExecutable() { |
| 21 | String executableName = Utils.toolsDir().equals("windows") ? "dexmerger.bat" : "dexmerger"; |
| 22 | return new File("tools/" + Utils.toolsDir() + "/dx/bin/" + executableName); |
| 23 | } |
| 24 | } |