diff options
author | jingwen <jingwen@google.com> | 2017-12-18 08:24:12 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-18 08:25:32 -0800 |
commit | 094caa508fa74081d861e9e8f8eb50934811bf65 (patch) | |
tree | c6911010ba0c7dea50fa13ee718f93719b43eb8a /src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java | |
parent | 310fe150811c6abe0c52232eb5cb0e4380a6e084 (diff) |
Automatic formatting cleanup of Android *.java files.
RELNOTES: None.
PiperOrigin-RevId: 179425421
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java index 13b1c9aa46..86e5ec4d82 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java @@ -364,8 +364,8 @@ public class AndroidResourceProcessingAction { public static void main(String[] args) throws Exception { final Stopwatch timer = Stopwatch.createStarted(); - OptionsParser optionsParser = OptionsParser.newOptionsParser( - Options.class, AaptConfigOptions.class); + OptionsParser optionsParser = + OptionsParser.newOptionsParser(Options.class, AaptConfigOptions.class); optionsParser.enableParamsFileSupport( new ShellQuotedParamsFilePreProcessor(FileSystems.getDefault())); optionsParser.parseAndExitUponError(args); @@ -384,9 +384,7 @@ public class AndroidResourceProcessingAction { final Path dummyManifest = tmp.resolve("manifest-aapt-dummy/AndroidManifest.xml"); Path generatedSources = null; - if (options.srcJarOutput != null - || options.rOutput != null - || options.symbolsOut != null) { + if (options.srcJarOutput != null || options.rOutput != null || options.symbolsOut != null) { generatedSources = tmp.resolve("generated_resources"); } @@ -419,9 +417,7 @@ public class AndroidResourceProcessingAction { ? options.densities : Collections.<String>emptyList(); final List<String> densitiesForManifest = - densitiesToFilter.isEmpty() - ? options.densitiesForManifest - : densitiesToFilter; + densitiesToFilter.isEmpty() ? options.densitiesForManifest : densitiesToFilter; final DensityFilteredAndroidData filteredData = mergedData.filter( @@ -457,14 +453,13 @@ public class AndroidResourceProcessingAction { } if (hasConflictWithPackageUnderTest( - options.packageUnderTest, - processedData.getManifest(), - timer)) { + options.packageUnderTest, processedData.getManifest(), timer)) { logger.log( Level.SEVERE, "Android resources cannot be provided if the instrumentation package is the same as " + "the package under test, but the instrumentation package (in the manifest) and " - + "the package under test both had the same package: " + options.packageUnderTest); + + "the package under test both had the same package: " + + options.packageUnderTest); System.exit(1); } @@ -531,26 +526,23 @@ public class AndroidResourceProcessingAction { /** * Checks if there is a conflict between the package under test and the package being built. * - * When testing Android code, the test can be run in the same or a different process as the code - * being tested. If it's in the same process, we do not allow Android resources to be used by the - * test, as they could overwrite the resources used by the code being tested. If this APK won't - * be testing another APK, the test and code under test are in different processes, or no + * <p>When testing Android code, the test can be run in the same or a different process as the + * code being tested. If it's in the same process, we do not allow Android resources to be used by + * the test, as they could overwrite the resources used by the code being tested. If this APK + * won't be testing another APK, the test and code under test are in different processes, or no * resources are being used, this isn't a concern. * - * To determine whether the test and code under test are run in the same process, we check the + * <p>To determine whether the test and code under test are run in the same process, we check the * package of the code under test, passed into this function, against the target packages of any * <code>instrumentation</code> tags in this APK's manifest. * * @param packageUnderTest the package of the code under test, or null if no code is under test * @param processedManifest the processed manifest for this APK - * * @return true if there is a conflict, false otherwise */ @VisibleForTesting static boolean hasConflictWithPackageUnderTest( - @Nullable String packageUnderTest, - Path processedManifest, - Stopwatch timer) + @Nullable String packageUnderTest, Path processedManifest, Stopwatch timer) throws SAXException, StreamException, ParserConfigurationException, IOException { if (packageUnderTest == null) { return false; |