diff options
author | mikaelpeltier <mikaelpeltier@google.com> | 2015-04-29 10:59:40 +0200 |
---|---|---|
committer | mikaelpeltier <mikaelpeltier@google.com> | 2015-04-29 10:59:40 +0200 |
commit | 3c94d5c0ee85508ddc39f9ef6d362fa2b842c37f (patch) | |
tree | 12ddde3d632c752b00127042092b6844f684b1b6 | |
parent | a104cd6ab82f535a802bd66928e0a0693836d7b7 (diff) | |
download | toolchain_jack-3c94d5c0ee85508ddc39f9ef6d362fa2b842c37f.zip toolchain_jack-3c94d5c0ee85508ddc39f9ef6d362fa2b842c37f.tar.gz toolchain_jack-3c94d5c0ee85508ddc39f9ef6d362fa2b842c37f.tar.bz2 |
Jayce and dex files must be put into output library
- When generating a library in incremental mode, Jayce and
dex files must be generate into the output library that represent
the incremental state. If output library is not generated, it is
not required to put Jayce and dex files into the incremental state
since Jack merger will take pre-dex directly from the libraries.
Bug: 20063218
Change-Id: I91d5f0b805c0b110290735790fa21fa949d1da70
-rw-r--r-- | jack/src/com/android/jack/Jack.java | 29 | ||||
-rw-r--r-- | jack/src/com/android/jack/incremental/GenerateLibraryFromIncrementalFolder.java | 27 |
2 files changed, 43 insertions, 13 deletions
diff --git a/jack/src/com/android/jack/Jack.java b/jack/src/com/android/jack/Jack.java index b25fc4c..f6018c4 100644 --- a/jack/src/com/android/jack/Jack.java +++ b/jack/src/com/android/jack/Jack.java @@ -69,6 +69,7 @@ import com.android.jack.frontend.VirtualMethodsMarker; import com.android.jack.frontend.java.JackBatchCompiler; import com.android.jack.frontend.java.JackBatchCompiler.TransportExceptionAroundEcjError; import com.android.jack.frontend.java.JackBatchCompiler.TransportJUEAroundEcjError; +import com.android.jack.incremental.GenerateLibraryFromIncrementalFolder; import com.android.jack.incremental.Incremental; import com.android.jack.ir.JackFormatIr; import com.android.jack.ir.JavaSourceIr; @@ -518,6 +519,9 @@ public abstract class Jack { if (config.get(Options.INCREMENTAL_MODE).booleanValue()) { request.addFeature(Incremental.class); } + if (config.get(Options.GENERATE_LIBRARY_FROM_INCREMENTAL_FOLDER).booleanValue()) { + request.addFeature(GenerateLibraryFromIncrementalFolder.class); + } request.addInitialTagsOrMarkers(getJavaSourceInitialTagSet()); request.addInitialTagsOrMarkers(getJackFormatInitialTagSet()); @@ -867,7 +871,6 @@ public abstract class Jack { FeatureSet features = planBuilder.getRequest().getFeatures(); ProductionSet productions = planBuilder.getRequest().getTargetProductions(); boolean hasSanityChecks = features.contains(SanityChecks.class); - Config config = ThreadConfig.getConfig(); // TODO(jack-team): Remove this hack boolean preDexing = !getSession().getImportedLibraries().isEmpty(); @@ -1012,13 +1015,13 @@ public abstract class Jack { } { SubPlanBuilder<JDefinedClassOrInterface> typePlan; - // In incremental library mode, Jayce files must be copied into output library - if (features.contains(Incremental.class) - && ((!config.get(Options.GENERATE_JACK_LIBRARY).booleanValue()) - || config.get(Options.LIBRARY_OUTPUT_CONTAINER_TYPE) != Container.ZIP)) { - typePlan = planBuilder.appendSubPlan(ExcludeTypeFromLibWithBinaryAdapter.class); - } else { + // Jayce files must be copied into output library in incremental library mode or in non + // incremental mode + if (features.contains(GenerateLibraryFromIncrementalFolder.class) + || !features.contains(Incremental.class)) { typePlan = planBuilder.appendSubPlan(JDefinedClassOrInterfaceAdapter.class); + } else { + typePlan = planBuilder.appendSubPlan(ExcludeTypeFromLibWithBinaryAdapter.class); } if (productions.contains(JayceInLibraryProduct.class)) { typePlan.append(JayceInLibraryWriter.class); @@ -1167,13 +1170,13 @@ public abstract class Jack { { SubPlanBuilder<JDefinedClassOrInterface> typePlan; - // In incremental library mode, dex files must be copied into output library - if (features.contains(Incremental.class) - && ((!config.get(Options.GENERATE_JACK_LIBRARY).booleanValue()) - || config.get(Options.LIBRARY_OUTPUT_CONTAINER_TYPE) != Container.ZIP)) { - typePlan = planBuilder.appendSubPlan(ExcludeTypeFromLibWithBinaryAdapter.class); - } else { + // Jayce files must be copied into output library in incremental library mode or in non + // incremental mode + if (features.contains(GenerateLibraryFromIncrementalFolder.class) + || !features.contains(Incremental.class)) { typePlan = planBuilder.appendSubPlan(JDefinedClassOrInterfaceAdapter.class); + } else { + typePlan = planBuilder.appendSubPlan(ExcludeTypeFromLibWithBinaryAdapter.class); } if (productions.contains(DexInLibraryProduct.class)) { typePlan.append(DexInLibraryWriter.class); diff --git a/jack/src/com/android/jack/incremental/GenerateLibraryFromIncrementalFolder.java b/jack/src/com/android/jack/incremental/GenerateLibraryFromIncrementalFolder.java new file mode 100644 index 0000000..276c77a --- /dev/null +++ b/jack/src/com/android/jack/incremental/GenerateLibraryFromIncrementalFolder.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.incremental; + +import com.android.sched.item.Description; +import com.android.sched.item.Feature; + +/** + * A {@link Feature} specifying that a library is generated with incremental support. + */ +@Description("Generate library with incremental support") +public class GenerateLibraryFromIncrementalFolder implements Feature { +} |