| // Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| |
| package com.android.tools.r8.utils; |
| |
| import java.io.IOException; |
| import java.nio.file.Files; |
| import java.nio.file.Paths; |
| import java.util.ArrayList; |
| import java.util.List; |
| |
| public class FlagFile { |
| public static String[] expandFlagFiles(String[] args) throws IOException { |
| List<String> flags = new ArrayList<>(args.length); |
| for (String arg : args) { |
| if (arg.startsWith("@")) { |
| flags.addAll(Files.readAllLines(Paths.get(arg.substring(1)))); |
| } else { |
| flags.add(arg); |
| } |
| } |
| return flags.toArray(new String[flags.size()]); |
| } |
| } |