--- a/build-system/builder/build.gradle
+++ b/build-system/builder/build.gradle
@@ -15,9 +15,6 @@
     compile project(':base:manifest-merger')
     compile project(':base:ddmlib')
 
-    compile project(':base:jack:jack-api')
-    compile project(':base:jack:jill-api')
-
     compile 'com.android.tools.analytics-library:protos:debian'
     compile 'com.android.tools.analytics-library:shared:debian'
     compile 'com.android.tools.analytics-library:tracker:debian'
--- a/build-system/builder/src/main/java/com/android/builder/core/BuildToolsServiceLoader.java
+++ b/build-system/builder/src/main/java/com/android/builder/core/BuildToolsServiceLoader.java
@@ -17,8 +17,6 @@
 package com.android.builder.core;
 
 import com.android.annotations.NonNull;
-import com.android.jack.api.JackProvider;
-import com.android.jill.api.JillProvider;
 import com.android.sdklib.BuildToolInfo;
 import com.android.repository.Revision;
 import com.android.utils.ILogger;
@@ -130,17 +128,6 @@
         }
     }
 
-    /**
-     * Jack service description.
-     */
-    public static final Service<JackProvider> JACK =
-            new Service<JackProvider>(ImmutableList.of("jack.jar"), JackProvider.class);
-
-    /**
-     * Jill service description.
-     */
-    public static final Service<JillProvider> JILL =
-            new Service<JillProvider>(ImmutableList.of("jill.jar"), JillProvider.class);
 
     /**
      * build-tools version specific {@link ServiceLoader} helper.
--- a/build-system/builder/src/main/java/com/android/builder/core/AndroidBuilder.java
+++ b/build-system/builder/src/main/java/com/android/builder/core/AndroidBuilder.java
@@ -22,7 +22,6 @@
 import static com.android.SdkConstants.FD_RES_XML;
 import static com.android.builder.core.BuilderConstants.ANDROID_WEAR;
 import static com.android.builder.core.BuilderConstants.ANDROID_WEAR_MICRO_APK;
-import static com.android.builder.core.JackProcessOptions.JACK_MIN_REV;
 import static com.android.manifmerger.ManifestMerger2.Invoker;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
@@ -75,17 +74,6 @@
 import com.android.ide.common.signing.KeytoolException;
 import com.android.io.FileWrapper;
 import com.android.io.StreamException;
-import com.android.jack.api.ConfigNotSupportedException;
-import com.android.jack.api.JackProvider;
-import com.android.jack.api.v01.Api01CompilationTask;
-import com.android.jack.api.v01.CompilationException;
-import com.android.jack.api.v01.ConfigurationException;
-import com.android.jack.api.v01.DebugInfoLevel;
-import com.android.jack.api.v01.MultiDexKind;
-import com.android.jack.api.v01.ReporterKind;
-import com.android.jack.api.v01.UnrecoverableException;
-import com.android.jack.api.v02.Api02Config;
-import com.android.jack.api.v03.Api03Config;
 import com.android.manifmerger.ManifestMerger2;
 import com.android.manifmerger.ManifestSystemProperty;
 import com.android.manifmerger.MergingReport;
@@ -1577,305 +1565,6 @@
     }
 
     /**
-     * Converts Java source code into android byte codes using Jack.
-     *
-     * @param options Options for configuring Jack.
-     * @param isInProcess Whether to run Jack in memory or spawn another Java process.
-     */
-    public void convertByteCodeUsingJack(@NonNull JackProcessOptions options, boolean isInProcess)
-            throws ConfigNotSupportedException, ClassNotFoundException, CompilationException,
-            ConfigurationException, UnrecoverableException, ProcessException {
-        Revision revision = getTargetInfo().getBuildTools().getRevision();
-        if (revision.compareTo(JACK_MIN_REV, Revision.PreviewComparison.IGNORE) < 0) {
-            throw new ConfigNotSupportedException(
-                    "Jack requires Build Tools " + JACK_MIN_REV.toString() + " or later");
-        }
-
-        // Create all the necessary directories if needed.
-        if (options.getDexOutputDirectory() != null) {
-            FileUtils.mkdirs(options.getDexOutputDirectory());
-        }
-
-        if (options.getOutputFile() != null) {
-            FileUtils.mkdirs(options.getOutputFile().getParentFile());
-        }
-
-        if (options.getCoverageMetadataFile() != null) {
-            try {
-                FileUtils.mkdirs(options.getCoverageMetadataFile().getParentFile());
-            } catch (RuntimeException ignored) {
-                getLogger().warning("Cannot create %1$s directory.", options.getCoverageMetadataFile().getParent());
-            }
-        }
-
-        // set the incremental dir if set and either already exists or can be created.
-        if (options.getIncrementalDir() != null) {
-            try {
-                FileUtils.mkdirs(options.getIncrementalDir());
-            } catch (RuntimeException ignored) {
-                getLogger().warning("Cannot create %1$s directory, "
-                        + "jack incremental support disabled", options.getIncrementalDir());
-                // unset the incremental dir if it neither already exists nor can be created.
-                options.setIncrementalDir(null);
-            }
-        }
-
-        if (isInProcess) {
-            final long DEFAULT_SUGGESTED_HEAP_SIZE = 1536 * 1024 * 1024; // 1.5 GiB
-            long maxMemory = DexByteCodeConverter.getUserDefinedHeapSize();
-
-            if (DEFAULT_SUGGESTED_HEAP_SIZE > maxMemory) {
-                mLogger.warning(
-                        "\nA larger heap for the Gradle daemon is recommended for running "
-                                + "jack.\n\n"
-                                + "It currently has %1$d MB.\n"
-                                + "For faster builds, increase the maximum heap size for the "
-                                + "Gradle daemon to at least %2$s MB.\n"
-                                + "To do this set org.gradle.jvmargs=-Xmx%2$sM in the "
-                                + "project gradle.properties.\n"
-                                + "For more information see "
-                                + "https://docs.gradle.org/current/userguide/build_environment.html\n",
-                        maxMemory / (1024 * 1024),
-                        // Add -1 and + 1 to round up the division
-                        ((DEFAULT_SUGGESTED_HEAP_SIZE - 1) / (1024 * 1024)) + 1);
-            }
-
-            convertByteCodeUsingJackApis(options);
-        } else {
-            convertByteCodeUsingJackCli(options, new LoggedProcessOutputHandler(getLogger()));
-        }
-    }
-
-    /**
-     * Converts java source code into android byte codes using the jack integration APIs.
-     * Jack will run in memory.
-     */
-    @SuppressWarnings("WeakerAccess")
-    public void convertByteCodeUsingJackApis(@NonNull JackProcessOptions options)
-            throws ConfigNotSupportedException, ConfigurationException, CompilationException,
-            UnrecoverableException, ClassNotFoundException {
-
-        // Api03 is supported by Duouarn, which is release in the non-preview version of 24.0.0.
-        boolean isApi03Supported =
-                mTargetInfo.getBuildTools().getRevision().compareTo(
-                        JackProcessOptions.DOUARN_REV) >= 0;
-
-        BuildToolServiceLoader buildToolServiceLoader
-                = BuildToolsServiceLoader.INSTANCE.forVersion(mTargetInfo.getBuildTools());
-
-        Api01CompilationTask compilationTask = null;
-        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        Optional<JackProvider> jackProvider =
-                buildToolServiceLoader.getSingleService(getLogger(), BuildToolsServiceLoader.JACK);
-        if (jackProvider.isPresent()) {
-
-            // Get configuration object
-            try {
-                Api02Config config02;
-                Api03Config config03 = null;
-                if (isApi03Supported) {
-                    config03 = jackProvider.get().createConfig(Api03Config.class);
-                    config02 = config03;
-                } else {
-                    config02 = jackProvider.get().createConfig(Api02Config.class);
-                }
-
-                config02.setDebugInfoLevel(
-                        options.isDebuggable() ? DebugInfoLevel.FULL : DebugInfoLevel.NONE);
-
-                config02.setClasspath(options.getClasspaths());
-                if (options.getDexOutputDirectory() != null) {
-                    config02.setOutputDexDir(options.getDexOutputDirectory());
-                }
-                if (options.getOutputFile() != null) {
-                    config02.setOutputJackFile(options.getOutputFile());
-                }
-                config02.setImportedJackLibraryFiles(options.getImportFiles());
-                if (options.getMinSdkVersion() > 0) {
-                    config02.setAndroidMinApiLevel(options.getMinSdkVersion());
-                }
-
-                config02.setProguardConfigFiles(options.getProguardFiles());
-                config02.setJarJarConfigFiles(options.getJarJarRuleFiles());
-
-                if (options.isMultiDex()) {
-                    if (options.getMinSdkVersion() <
-                            BuildToolInfo.SDK_LEVEL_FOR_MULTIDEX_NATIVE_SUPPORT) {
-                        config02.setMultiDexKind(MultiDexKind.LEGACY);
-                    } else {
-                        config02.setMultiDexKind(MultiDexKind.NATIVE);
-                    }
-                }
-
-                config02.setSourceEntries(options.getInputFiles());
-                if (options.getMappingFile() != null) {
-                    config02.setProperty("jack.obfuscation.mapping.dump", "true");
-                    config02.setObfuscationMappingOutputFile(options.getMappingFile());
-                }
-
-                config02.setProperty("jack.import.type.policy", "keep-first");
-                config02.setProperty("jack.import.resource.policy", "keep-first");
-
-                config02.setReporter(ReporterKind.DEFAULT, outputStream);
-
-                if (options.getSourceCompatibility() != null) {
-                    config02.setProperty(
-                            "jack.java.source.version",
-                            options.getSourceCompatibility());
-                }
-
-                if (options.getIncrementalDir() != null
-                        && options.getIncrementalDir().exists()) {
-                    config02.setIncrementalDir(options.getIncrementalDir());
-                }
-
-                ImmutableList.Builder<File> resourcesDir = ImmutableList.builder();
-                for (File file : options.getResourceDirectories()) {
-                    if (file.exists()) {
-                        resourcesDir.add(file);
-                    }
-                }
-                config02.setResourceDirs(resourcesDir.build());
-
-                config02.setProperty("jack.dex.optimize", Boolean.toString(options.getDexOptimize()));
-
-                if (!options.getAnnotationProcessorNames().isEmpty()) {
-                    config02.setProcessorNames(options.getAnnotationProcessorNames());
-                }
-                if (options.getAnnotationProcessorOutputDirectory() != null) {
-                    FileUtils.mkdirs(options.getAnnotationProcessorOutputDirectory());
-                    config02.setProperty(
-                            "jack.annotation-processor.source.output",
-                            options.getAnnotationProcessorOutputDirectory().getAbsolutePath());
-                }
-                try {
-                    config02.setProcessorPath(options.getAnnotationProcessorClassPath());
-                } catch (Exception e) {
-                    mLogger.error(e, "Could not resolve annotation processor path.");
-                    throw new RuntimeException(e);
-                }
-
-                config02.setProcessorOptions(options.getAnnotationProcessorOptions());
-
-                // apply all additional parameters
-                for (String paramKey: options.getAdditionalParameters().keySet()) {
-                    String paramValue = options.getAdditionalParameters().get(paramKey);
-                    config02.setProperty(paramKey, paramValue);
-                }
-
-                if (options.getCoverageMetadataFile() != null) {
-                    if (isApi03Supported) {
-                        String coveragePluginPath = mTargetInfo.getBuildTools().getPath(
-                                BuildToolInfo.PathId.JACK_COVERAGE_PLUGIN);
-                        if (coveragePluginPath == null) {
-                            mLogger.warning(
-                                    "Unknown path id %s.  Disabling code coverage.",
-                                    BuildToolInfo.PathId.JACK_COVERAGE_PLUGIN);
-                        } else {
-                            File coveragePlugin = new File(coveragePluginPath);
-                            if (coveragePlugin.isFile()) {
-                                mLogger.warning(
-                                        "Unable to find coverage plugin '%s'.  Disabling code "
-                                                + "coverage.",
-                                        coveragePlugin.getAbsolutePath());
-                            } else {
-                                config03.setPluginPath(
-                                        ImmutableList.of(new File(coveragePluginPath)));
-                                config03.setPluginNames(
-                                        ImmutableList.of(JackProcessOptions.COVERAGE_PLUGIN_NAME));
-                                config03.setProperty(
-                                        "jack.coverage.metadata.file",
-                                        options.getCoverageMetadataFile().getAbsolutePath());
-                            }
-                        }
-                    } else {
-                        config02.setProperty("jack.coverage", "true");
-                        config02.setProperty(
-                                "jack.coverage.metadata.file",
-                                options.getCoverageMetadataFile().getAbsolutePath());
-                    }
-                }
-
-                compilationTask = config02.getTask();
-            } catch (ConfigNotSupportedException e) {
-                mLogger.error(e,
-                        "jack.jar from build tools "
-                                + mTargetInfo.getBuildTools().getRevision()
-                                + " does not support Jack API v02.");
-                throw e;
-            } catch (ConfigurationException e) {
-                mLogger.error(e, "Jack APIs v02 configuration failed");
-                throw e;
-            }
-        }
-
-        Preconditions.checkNotNull(compilationTask);
-
-        // Run the compilation
-        try {
-            compilationTask.run();
-            mLogger.info(outputStream.toString());
-        } catch (CompilationException | ConfigurationException e) {
-            mLogger.error(e, outputStream.toString());
-            throw e;
-        } catch (UnrecoverableException e) {
-            mLogger.error(e, "Something out of Jack control has happened: " + e.getMessage());
-            throw e;
-        }
-    }
-
-    @SuppressWarnings("WeakerAccess")
-    public void convertByteCodeUsingJackCli(
-            @NonNull JackProcessOptions options,
-            @NonNull ProcessOutputHandler processOutputHandler) throws ProcessException {
-        JackProcessBuilder builder = new JackProcessBuilder(options);
-        mJavaProcessExecutor.execute(
-                builder.build(mTargetInfo.getBuildTools()), processOutputHandler)
-                .rethrowFailure().assertNormalExitValue();
-    }
-
-    public void createJacocoReportWithJackReporter(
-            @NonNull File coverageFile,
-            @NonNull File reportDir,
-            @NonNull List<File> sourceDirs,
-            @NonNull String reportName,
-            @NonNull File metadataFile) throws ProcessException {
-
-        checkNotNull(coverageFile, "coverageFile cannot be null.");
-        checkNotNull(reportDir, "reportDir cannot be null.");
-        checkNotNull(sourceDirs, "sourceDir cannot be null.");
-        checkNotNull(reportName, "reportName cannot be null.");
-        checkNotNull(metadataFile, "metadataFile cannot be null.");
-
-        ProcessInfoBuilder builder = new ProcessInfoBuilder();
-
-        BuildToolInfo buildToolInfo = mTargetInfo.getBuildTools();
-        String jackLocation = System.getenv("USE_JACK_LOCATION");
-        String reporter = jackLocation != null
-                ? jackLocation + File.separator + SdkConstants.FN_JACK_JACOCO_REPORTER
-                : buildToolInfo.getPath(BuildToolInfo.PathId.JACK_JACOCO_REPORTER);
-        if (reporter == null || !new File(reporter).isFile()) {
-            throw new IllegalStateException("jack-jacoco-reporter.jar is missing: " + reporter);
-        }
-
-        builder.setClasspath(reporter);
-        builder.setMain("com.android.jack.tools.jacoco.Main");
-
-        builder.addArgs("--coverage-file", coverageFile.getAbsolutePath());
-        builder.addArgs("--metadata-file", metadataFile.getAbsolutePath());
-        builder.addArgs("--report-dir", reportDir.getAbsolutePath());
-        builder.addArgs("--report-name", reportName);
-        for (File sourceDir : sourceDirs) {
-            builder.addArgs("--source-dir", sourceDir.getAbsolutePath());
-        }
-        JavaProcessInfo javaProcessInfo = builder.createJavaProcess();
-        ProcessResult result = mJavaProcessExecutor.execute(
-                javaProcessInfo,
-                new LoggedProcessOutputHandler(getLogger()));
-        result.rethrowFailure().assertNormalExitValue();
-    }
-
-    /**
      * Packages the apk.
      *
      * <p>If in debug mode (when {@code jniDebugBuild} is {@code true}), when native
--- a/build-system/builder/src/main/java/com/android/builder/internal/compiler/JackConversionCache.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2014 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.builder.internal.compiler;
-
-import com.android.annotations.NonNull;
-import com.android.builder.core.AndroidBuilder;
-import com.android.builder.core.JackProcessOptions;
-import com.android.ide.common.process.ProcessException;
-import com.android.jack.api.ConfigNotSupportedException;
-import com.android.jack.api.v01.CompilationException;
-import com.android.jack.api.v01.ConfigurationException;
-import com.android.jack.api.v01.UnrecoverableException;
-import com.android.utils.FileUtils;
-import com.android.utils.Pair;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import com.google.common.io.Files;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * Cache for jar -> jack conversion, using the Jack --import tool.
- *
- * Since we cannot yet have a single task for each library that needs to be run through Jack
- * (because there is no task-level parallelization), this class allows reusing the output of
- * the Jack process for a library in a project in other projects.
- *
- * Because different project could use different build-tools, both the library to be converted
- * and the version of the build tools are used as keys in the cache.
- *
- * The API is fairly simple, just call {@link #convertLibrary(AndroidBuilder, File, File, JackProcessOptions, boolean)}
- *
- * The call will be blocking until the conversion happened, either through actually running Jack or
- * through copying the output of a previous Jack run.
- *
- * After a build a call to {@link #clear(java.io.File, com.android.utils.ILogger)} with a file
- * will allow saving the known converted libraries for future reuse.
- */
-public class JackConversionCache extends PreProcessCache<JackDexKey> {
-
-    private static final JackConversionCache sSingleton = new JackConversionCache();
-
-    public static JackConversionCache getCache() {
-        return sSingleton;
-    }
-
-    @NonNull
-    @Override
-    protected KeyFactory<JackDexKey> getKeyFactory() {
-        return JackDexKey.FACTORY;
-    }
-
-    /**
-     * Converts a given library to a given output with Jack, using a specific version of the
-     * build-tools.
-     *
-     * @throws ProcessException
-     */
-    public void convertLibrary(
-            @NonNull AndroidBuilder androidBuilder,
-            @NonNull File inputFile,
-            @NonNull File outFile,
-            @NonNull JackProcessOptions options,
-            boolean isJackInProcess)
-            throws ConfigNotSupportedException, ClassNotFoundException, ConfigurationException,
-            CompilationException, UnrecoverableException, ProcessException, InterruptedException,
-            IOException {
-        Preconditions.checkNotNull(androidBuilder.getTargetInfo());
-        JackDexKey itemKey = JackDexKey.of(
-                inputFile,
-                androidBuilder.getTargetInfo().getBuildTools().getRevision(),
-                options.getJumboMode(),
-                options.getDexOptimize(),
-                options.getAdditionalParameters());
-
-        Pair<PreProcessCache.Item, Boolean> pair = getItem(androidBuilder.getLogger(), itemKey);
-        Item item = pair.getFirst();
-
-        // if this is a new item
-        if (pair.getSecond()) {
-            try {
-                // haven't process this file yet so do it and record it.
-
-                androidBuilder.convertByteCodeUsingJack(options, isJackInProcess);
-                item.getOutputFiles().add(outFile);
-
-                incrementMisses();
-            } catch (Exception exception) {
-                // in case of error, delete (now obsolete) output file
-                //noinspection ResultOfMethodCallIgnored - we are throwing an error anyway.
-                outFile.delete();
-                // and rethrow the error
-                throw exception;
-            } finally {
-                // enable other threads to use the output of this pre-dex.
-                // if something was thrown they'll handle the missing output file.
-                item.getLatch().countDown();
-            }
-        } else {
-            // wait until the file is pre-dexed by the first thread.
-            item.getLatch().await();
-
-            // check that the generated file actually exists
-            // while the api allow for 2+ files, there's only ever one in this case.
-            File fromFile = item.getOutputFiles().get(0);
-
-            if (!fromFile.getCanonicalPath().equals(outFile.getCanonicalPath())
-                    && fromFile.isFile()) {
-                // file already pre-dex, just copy the output.
-                // while the api allow for 2+ files, there's only ever one in this case.
-                FileUtils.mkdirs(outFile.getParentFile());
-                Files.copy(fromFile, outFile);
-                incrementHits();
-            }
-        }
-    }
-}
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/profile/ProfilerInitializer.java
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/profile/ProfilerInitializer.java
@@ -22,7 +22,6 @@
 import com.android.annotations.Nullable;
 import com.android.build.gradle.internal.LibraryCache;
 import com.android.build.gradle.internal.LoggerWrapper;
-import com.android.builder.internal.compiler.JackConversionCache;
 import com.android.builder.internal.compiler.PreDexCache;
 import com.android.builder.profile.AsyncRecorder;
 import com.android.builder.profile.ProcessRecorderFactory;
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/transforms/JackTransform.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright (C) 2016 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.build.gradle.internal.transforms;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.android.annotations.NonNull;
-import com.android.build.api.transform.Format;
-import com.android.build.api.transform.QualifiedContent;
-import com.android.build.api.transform.SecondaryFile;
-import com.android.build.api.transform.Transform;
-import com.android.build.api.transform.TransformException;
-import com.android.build.api.transform.TransformInvocation;
-import com.android.build.api.transform.TransformOutputProvider;
-import com.android.build.gradle.ProguardFiles;
-import com.android.build.gradle.internal.CompileOptions;
-import com.android.build.gradle.internal.TaskManager;
-import com.android.build.gradle.internal.core.GradleVariantConfiguration;
-import com.android.build.gradle.internal.dsl.CoreAnnotationProcessorOptions;
-import com.android.build.gradle.internal.pipeline.TransformManager;
-import com.android.build.gradle.internal.scope.GlobalScope;
-import com.android.build.gradle.internal.scope.VariantScope;
-import com.android.build.gradle.tasks.JackPreDexTransform;
-import com.android.build.gradle.tasks.factory.AbstractCompilesUtil;
-import com.android.builder.core.AndroidBuilder;
-import com.android.builder.core.JackProcessOptions;
-import com.android.ide.common.process.ProcessException;
-import com.android.jack.api.ConfigNotSupportedException;
-import com.android.jack.api.v01.CompilationException;
-import com.android.jack.api.v01.ConfigurationException;
-import com.android.jack.api.v01.UnrecoverableException;
-import com.android.repository.Revision;
-import com.android.sdklib.BuildToolInfo;
-import com.android.utils.StringHelper;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-import org.gradle.api.Project;
-import org.gradle.api.file.ConfigurableFileTree;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Transform for compiling using Jack.
- *
- * <p>Transform inputs:</p>
- * <ul>
- *     <li>Jack format libraries, produced by the for packaged libs {@link JackPreDexTransform}</li>
- *     <li>Jack format classpath, produced by the for runtime libs {@link JackPreDexTransform}
- *         i.e. normally the android.jar</li>
- * </ul>
- * <p>Secondary inputs:</p>
- * <ul>
- *     <li>Java source files to be compiled by Jack.</li>
- *     <li>Proguard config files</li>
- *     <li>JarJar config files</li>
- *     <li>The Jack binary</li>
- * </ul>
- * <p>Transform outputs:</p>
- * <ul>
- *     <li>Dex files for the whole app, including its dependencies</li>
- * </ul>
- * <p>Secondary outputs:</p>
- * <ul>
- *     <li>Proguard mapping file (for decoding stacktraces and test compilation)</li>
- *     <li>Jack file for test compilation</li>
- * </ul>
- */
-public class JackTransform extends Transform {
-    private Project project;
-
-    private AndroidBuilder androidBuilder;
-
-    private JackProcessOptions options;
-
-    private boolean jackInProcess;
-
-    private final List<ConfigurableFileTree> sourceFileTrees = Lists.newArrayList();
-
-    @NonNull
-    @Override
-    public String getName() {
-        return "jack";
-    }
-
-    @NonNull
-    @Override
-    public Collection<SecondaryFile> getSecondaryFiles() {
-        ImmutableList.Builder<SecondaryFile> builder = ImmutableList.builder();
-        builder.addAll(
-                Iterables.transform(options.getProguardFiles(), SecondaryFile::nonIncremental));
-        builder.addAll(
-                Iterables.transform(options.getJarJarRuleFiles(), SecondaryFile::nonIncremental));
-        builder.addAll(
-                Iterables.transform(
-                        options.getAnnotationProcessorClassPath(), SecondaryFile::nonIncremental));
-        builder.addAll(Iterables.transform(getSourceFiles(), SecondaryFile::incremental));
-
-        builder.add(
-                SecondaryFile.nonIncremental(
-                        new File(androidBuilder
-                                .getTargetInfo()
-                                .getBuildTools()
-                                .getPath(BuildToolInfo.PathId.JACK))));
-
-        return builder.build();
-    }
-
-    @NonNull
-    @Override
-    public Collection<File> getSecondaryFileOutputs() {
-        ImmutableList.Builder<File> builder = ImmutableList.builder();
-        if (options.getOutputFile() != null) {
-            builder.add(options.getOutputFile());
-        }
-        if (options.getMappingFile() != null) {
-            builder.add(options.getMappingFile());
-        }
-        return builder.build();
-    }
-
-    @NonNull
-    @Override
-    public Map<String, Object> getParameterInputs() {
-        Map<String, Object> params = Maps.newHashMap();
-        params.put("javaResourcesFolder", options.getResourceDirectories());
-        params.put("isDebugLog", options.isDebugLog());
-        params.put("multiDexEnabled", options.isMultiDex());
-        params.put("minSdkVersion", options.getMinSdkVersion());
-        params.put("javaMaxHeapSize", options.getJavaMaxHeapSize());
-        params.put("sourceCompatibility", options.getSourceCompatibility());
-        params.put("buildToolsRev",
-                androidBuilder.getTargetInfo().getBuildTools().getRevision().toString());
-        return params;
-    }
-
-    @NonNull
-    @Override
-    public Set<QualifiedContent.ContentType> getInputTypes() {
-        return TransformManager.CONTENT_JACK;
-    }
-
-    @NonNull
-    @Override
-    public Set<QualifiedContent.ContentType> getOutputTypes() {
-        return TransformManager.CONTENT_DEX;
-    }
-
-    @NonNull
-    @Override
-    public Set<QualifiedContent.Scope> getScopes() {
-        return TransformManager.SCOPE_FULL_PROJECT;
-    }
-
-    @NonNull
-    @Override
-    public Set<QualifiedContent.Scope> getReferencedScopes() {
-        return Sets.immutableEnumSet(
-                QualifiedContent.Scope.PROVIDED_ONLY,
-                QualifiedContent.Scope.TESTED_CODE);
-    }
-
-    @Override
-    public boolean isIncremental() {
-        return false;
-    }
-
-    @Override
-    public void transform(@NonNull final TransformInvocation transformInvocation)
-            throws TransformException, InterruptedException, IOException {
-        try {
-            runJack(transformInvocation);
-        } catch (ProcessException | ConfigNotSupportedException | CompilationException
-                | ClassNotFoundException | UnrecoverableException | ConfigurationException e) {
-            throw new TransformException(e);
-        }
-    }
-
-    private void runJack(@NonNull TransformInvocation transformInvocation)
-            throws ProcessException, IOException, ConfigNotSupportedException,
-            ClassNotFoundException, CompilationException, ConfigurationException,
-            UnrecoverableException {
-
-        TransformOutputProvider outputProvider = transformInvocation.getOutputProvider();
-        checkNotNull(outputProvider);
-        final File outDirectory = outputProvider.getContentLocation(
-                "main",
-                getOutputTypes(),
-                getScopes(),
-                Format.DIRECTORY);
-
-        options.setDexOutputDirectory(outDirectory);
-        options.setClasspaths(
-                TransformInputUtil.getAllFiles(transformInvocation.getReferencedInputs()));
-        options.setImportFiles(TransformInputUtil.getAllFiles(transformInvocation.getInputs()));
-        options.setInputFiles(getSourceFiles());
-
-        androidBuilder.convertByteCodeUsingJack(options, jackInProcess);
-    }
-
-    private Collection<File> getSourceFiles() {
-        Collection<File> sourceFiles = Lists.newArrayList();
-        for (ConfigurableFileTree fileTree : sourceFileTrees) {
-            sourceFiles.addAll(fileTree.getFiles());
-        }
-        return sourceFiles;
-    }
-
-    public File getMappingFile() {
-        return options.getMappingFile();
-    }
-
-    public void addSource(File sourceFolder) {
-        sourceFileTrees.add(project.fileTree(sourceFolder));
-    }
-
-    public JackTransform(
-            final VariantScope scope,
-            final boolean isDebugLog,
-            final boolean compileJavaSources) {
-
-        options = new JackProcessOptions();
-
-        options.setDebugLog(isDebugLog);
-        GlobalScope globalScope = scope.getGlobalScope();
-
-        androidBuilder = globalScope.getAndroidBuilder();
-
-        project = globalScope.getProject();
-        if (compileJavaSources) {
-            sourceFileTrees.addAll(scope.getVariantData().getJavaSources());
-        }
-        final GradleVariantConfiguration config = scope.getVariantData().getVariantConfiguration();
-        options.setJavaMaxHeapSize(globalScope.getExtension().getDexOptions().getJavaMaxHeapSize());
-        options.setJumboMode(globalScope.getExtension().getDexOptions().getJumboMode());
-        boolean isDebuggable = scope.getVariantConfiguration().getBuildType().isDebuggable();
-        options.setDebuggable(isDebuggable);
-        options.setDexOptimize(
-                Objects.firstNonNull(
-                        globalScope.getExtension().getDexOptions().getOptimize(), !isDebuggable));
-        options.setMultiDex(config.isMultiDexEnabled());
-        options.setMinSdkVersion(config.getMinSdkVersion().getApiLevel());
-        if (!Boolean.FALSE.equals(globalScope.getExtension().getCompileOptions().getIncremental())
-                && androidBuilder.getTargetInfo().getBuildTools().getRevision().compareTo(
-                        new Revision(24, 0, 3), Revision.PreviewComparison.IGNORE) >= 0) {
-            String taskName = StringHelper.combineAsCamelCase(
-                    ImmutableList.of(
-                            "transformJackWith",
-                            getName(),
-                            "for",
-                            scope.getFullVariantName()));
-            options.setIncrementalDir(scope.getIncrementalDir(taskName));
-        }
-        options.setOutputFile(scope.getJackClassesZip());
-        options.setResourceDirectories(ImmutableList.of(scope.getJavaResourcesDestinationDir()));
-
-        CoreAnnotationProcessorOptions annotationProcessorOptions =
-                config.getJavaCompileOptions().getAnnotationProcessorOptions();
-        checkNotNull(annotationProcessorOptions.getIncludeCompileClasspath());
-        options.setAnnotationProcessorClassPath(
-                Lists.newArrayList(
-                        scope.getVariantData().getVariantDependency()
-                                .resolveAndGetAnnotationProcessorClassPath(
-                                        annotationProcessorOptions.getIncludeCompileClasspath(),
-                                        androidBuilder.getErrorReporter())));
-        options.setAnnotationProcessorNames(annotationProcessorOptions.getClassNames());
-        options.setAnnotationProcessorOptions(annotationProcessorOptions.getArguments());
-        options.setAnnotationProcessorOutputDirectory(scope.getAnnotationProcessorOutputDir());
-        options.setEcjOptionFile(scope.getJackEcjOptionsFile());
-        options.setAdditionalParameters(config.getJackOptions().getAdditionalParameters());
-
-        jackInProcess = config.getJackOptions().isJackInProcess();
-
-        if (config.getBuildType().isTestCoverageEnabled()) {
-            options.setCoverageMetadataFile(scope.getJackCoverageMetadataFile());
-        }
-
-        if (config.isMinifyEnabled()) {
-            // since all the output use the same resources, we can use the first output
-            // to query for a proguard file.
-            File sdkDir = scope.getGlobalScope().getSdkHandler().getAndCheckSdkFolder();
-            checkNotNull(sdkDir);
-            File defaultProguardFile = ProguardFiles.getDefaultProguardFile(
-                    TaskManager.DEFAULT_PROGUARD_CONFIG_FILE, project);
-
-            Set<File> proguardFiles = config.getProguardFiles(true /*includeLibs*/,
-                    ImmutableList.of(defaultProguardFile));
-            File proguardResFile = scope.getProcessAndroidResourcesProguardOutputFile();
-            proguardFiles.add(proguardResFile);
-            // for tested app, we only care about their aapt config since the base
-            // configs are the same files anyway.
-            if (scope.getTestedVariantData() != null) {
-                proguardResFile = scope.getTestedVariantData().getScope()
-                        .getProcessAndroidResourcesProguardOutputFile();
-                proguardFiles.add(proguardResFile);
-            }
-            options.setProguardFiles(proguardFiles);
-            options.setMappingFile(new File(scope.getProguardOutputFolder(), "mapping.txt"));
-        }
-
-        ImmutableList.Builder<File> jarJarRuleFiles = ImmutableList.builder();
-        for (File file : config.getJarJarRuleFiles()) {
-            jarJarRuleFiles.add(project.file(file));
-        }
-        options.setJarJarRuleFiles(jarJarRuleFiles.build());
-
-        CompileOptions compileOptions = scope.getGlobalScope().getExtension().getCompileOptions();
-        AbstractCompilesUtil.setDefaultJavaVersion(
-                compileOptions,
-                scope.getGlobalScope().getExtension().getCompileSdkVersion(),
-                true /*jackEnabled*/);
-        options.setSourceCompatibility(compileOptions.getSourceCompatibility().toString());
-    }
-}
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/JackPreDexTransform.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (C) 2016 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.build.gradle.tasks;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.build.api.transform.Format;
-import com.android.build.api.transform.QualifiedContent;
-import com.android.build.api.transform.Transform;
-import com.android.build.api.transform.TransformException;
-import com.android.build.api.transform.TransformInvocation;
-import com.android.build.api.transform.TransformOutputProvider;
-import com.android.build.gradle.internal.dsl.CoreJackOptions;
-import com.android.build.gradle.internal.pipeline.TransformManager;
-import com.android.build.gradle.internal.transforms.TransformInputUtil;
-import com.android.builder.core.AndroidBuilder;
-import com.android.builder.core.JackProcessOptions;
-import com.android.builder.internal.compiler.JackConversionCache;
-import com.android.ide.common.process.ProcessException;
-import com.android.jack.api.ConfigNotSupportedException;
-import com.android.jack.api.v01.CompilationException;
-import com.android.jack.api.v01.ConfigurationException;
-import com.android.jack.api.v01.UnrecoverableException;
-import com.google.common.base.Charsets;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
-import com.google.common.hash.HashCode;
-import com.google.common.hash.HashFunction;
-import com.google.common.hash.Hashing;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Predex Java libraries and convert to class to jayce format using Jack.
- */
-public class JackPreDexTransform extends Transform {
-
-    private AndroidBuilder androidBuilder;
-    private String javaMaxHeapSize;
-    private boolean forPackagedLibs;
-    @NonNull
-    private CoreJackOptions coreJackOptions;
-
-    public JackPreDexTransform(
-            @NonNull AndroidBuilder androidBuilder,
-            @Nullable String javaMaxHeapSize,
-            @NonNull CoreJackOptions coreJackOptions,
-            boolean forPackagedLibs) {
-        this.androidBuilder = androidBuilder;
-        this.javaMaxHeapSize = javaMaxHeapSize;
-        this.coreJackOptions = coreJackOptions;
-        this.forPackagedLibs = forPackagedLibs;
-    }
-
-    @NonNull
-    @Override
-    public String getName() {
-        return forPackagedLibs ? "preJackPackagedLibraries" : "preJackRuntimeLibraries";
-    }
-
-    @NonNull
-    @Override
-    public Set<QualifiedContent.ContentType> getInputTypes() {
-        return TransformManager.CONTENT_CLASS;
-    }
-
-    @NonNull
-    @Override
-    public Set<QualifiedContent.ContentType> getOutputTypes() {
-        return TransformManager.CONTENT_JACK;
-    }
-
-    @NonNull
-    @Override
-    public Set<QualifiedContent.Scope> getScopes() {
-        return forPackagedLibs
-                ? TransformManager.SCOPE_FULL_PROJECT
-                :  Collections.singleton(QualifiedContent.Scope.PROVIDED_ONLY);
-    }
-
-    @Override
-    public boolean isIncremental() {
-        return true;
-    }
-
-    @NonNull
-    @Override
-    public Map<String, Object> getParameterInputs() {
-        return ImmutableMap.of(
-                "buildToolsRev",
-                androidBuilder.getTargetInfo().getBuildTools().getRevision().toString());
-    }
-
-    @Override
-    public void transform(@NonNull final TransformInvocation transformInvocation)
-            throws TransformException, InterruptedException, IOException {
-        try {
-            runJack(transformInvocation);
-        } catch (ProcessException
-                | ConfigurationException
-                | UnrecoverableException
-                | ConfigNotSupportedException
-                | CompilationException
-                | ClassNotFoundException e) {
-            throw new TransformException(e);
-        }
-    }
-
-    private void runJack(@NonNull TransformInvocation transformInvocation)
-            throws ConfigNotSupportedException, CompilationException, ProcessException,
-            UnrecoverableException, ConfigurationException, ClassNotFoundException, IOException,
-            InterruptedException {
-        TransformOutputProvider outputProvider = transformInvocation.getOutputProvider();
-        checkNotNull(outputProvider);
-
-        for (File file : TransformInputUtil.getDirectories(transformInvocation.getInputs())) {
-            JackProcessOptions options = new JackProcessOptions();
-            options.setImportFiles(ImmutableList.of(file));
-            File outDirectory = outputProvider.getContentLocation(
-                    file.getName(),
-                    getOutputTypes(),
-                    getScopes(),
-                    Format.DIRECTORY);
-            options.setDexOutputDirectory(outDirectory);
-            options.setJavaMaxHeapSize(javaMaxHeapSize);
-            options.setAdditionalParameters(coreJackOptions.getAdditionalParameters());
-
-            JackConversionCache.getCache().convertLibrary(
-                    androidBuilder,
-                    file,
-                    outDirectory,
-                    options,
-                    coreJackOptions.isJackInProcess());
-        }
-
-        Iterable<File> jarInputs = forPackagedLibs
-                ? TransformInputUtil.getJarFiles(transformInvocation.getInputs())
-                : Iterables.concat(
-                        TransformInputUtil.getJarFiles(transformInvocation.getInputs()),
-                        androidBuilder.getBootClasspath(true));
-        for (File file : jarInputs) {
-            JackProcessOptions options = new JackProcessOptions();
-            options.setImportFiles(ImmutableList.of(file));
-            File outFile = outputProvider.getContentLocation(
-                    getJackFileName(file),
-                    getOutputTypes(),
-                    getScopes(),
-                    Format.JAR);
-            options.setOutputFile(outFile);
-            options.setJavaMaxHeapSize(javaMaxHeapSize);
-            options.setAdditionalParameters(coreJackOptions.getAdditionalParameters());
-
-            JackConversionCache.getCache().convertLibrary(
-                    androidBuilder,
-                    file,
-                    outFile,
-                    options,
-                    coreJackOptions.isJackInProcess());
-        }
-    }
-
-    /**
-     * Returns a unique file name for the converted library, even if there are 2 libraries with the
-     * same file names (but different paths)
-     *
-     * @param inputFile the library
-     */
-    @NonNull
-    public static String getJackFileName(@NonNull File inputFile) {
-        // get the filename
-        String name = inputFile.getName();
-        // remove the extension
-        int pos = name.lastIndexOf('.');
-        if (pos != -1) {
-            name = name.substring(0, pos);
-        }
-
-        // add a hash of the original file path.
-        String input = inputFile.getAbsolutePath();
-        HashFunction hashFunction = Hashing.sha1();
-        HashCode hashCode = hashFunction.hashString(input, Charsets.UTF_16LE);
-
-        return name + "-" + hashCode.toString();
-    }
-
-    public boolean isForRuntimeLibs() {
-        return !forPackagedLibs;
-    }
-}
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/pipeline/TransformManager.java
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/pipeline/TransformManager.java
@@ -18,7 +18,6 @@
 
 import static com.android.build.api.transform.QualifiedContent.DefaultContentType.CLASSES;
 import static com.android.build.api.transform.QualifiedContent.DefaultContentType.RESOURCES;
-import static com.android.build.gradle.internal.pipeline.ExtendedContentType.JACK;
 import static com.android.utils.StringHelper.capitalize;
 
 import com.android.annotations.NonNull;
@@ -31,7 +30,6 @@
 import com.android.build.gradle.internal.scope.AndroidTask;
 import com.android.build.gradle.internal.scope.AndroidTaskRegistry;
 import com.android.build.gradle.internal.scope.TransformVariantScope;
-import com.android.build.gradle.tasks.JackPreDexTransform;
 import com.android.builder.core.ErrorReporter;
 import com.android.builder.model.AndroidProject;
 import com.android.builder.model.SyncIssue;
@@ -74,7 +72,6 @@
             ExtendedContentType.NATIVE_LIBS);
     public static final Set<ContentType> CONTENT_DEX = ImmutableSet.of(
             ExtendedContentType.DEX);
-    public static final Set<ContentType> CONTENT_JACK = ImmutableSet.of(JACK);
     public static final Set<Scope> SCOPE_FULL_PROJECT = Sets.immutableEnumSet(
             Scope.PROJECT,
             Scope.PROJECT_LOCAL_DEPS,
@@ -408,13 +405,6 @@
 
         // check some scopes are not consumed.
         Set<Scope> scopes = transform.getScopes();
-        // Allow Jack transform to consume provided classes as the .jack files are needed.
-        if (scopes.contains(Scope.PROVIDED_ONLY) && !isJackRuntimeLib(transform)) {
-            errorReporter.handleSyncError(null, SyncIssue.TYPE_GENERIC,
-                    String.format("PROVIDED_ONLY scope cannot be consumed by Transform '%1$s'",
-                            transform.getName()));
-            return false;
-        }
         if (scopes.contains(Scope.TESTED_CODE)) {
             errorReporter.handleSyncError(null, SyncIssue.TYPE_GENERIC,
                     String.format("TESTED_CODE scope cannot be consumed by Transform '%1$s'",
@@ -442,8 +432,4 @@
         return true;
     }
 
-    private static boolean isJackRuntimeLib(@NonNull Transform transform) {
-        return (transform instanceof JackPreDexTransform)
-                && ((JackPreDexTransform) transform).isForRuntimeLibs();
-    }
 }
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/TaskManager.java
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/TaskManager.java
@@ -43,7 +43,6 @@
 import com.android.build.gradle.internal.dependency.VariantDependencies;
 import com.android.build.gradle.internal.dsl.AbiSplitOptions;
 import com.android.build.gradle.internal.dsl.CoreBuildType;
-import com.android.build.gradle.internal.dsl.CoreJackOptions;
 import com.android.build.gradle.internal.dsl.CoreNdkOptions;
 import com.android.build.gradle.internal.dsl.CoreSigningConfig;
 import com.android.build.gradle.internal.dsl.PackagingOptions;
@@ -80,7 +79,6 @@
 import com.android.build.gradle.internal.tasks.FileSupplier;
 import com.android.build.gradle.internal.tasks.GenerateApkDataTask;
 import com.android.build.gradle.internal.tasks.InstallVariantTask;
-import com.android.build.gradle.internal.tasks.JackJacocoReportTask;
 import com.android.build.gradle.internal.tasks.LintCompile;
 import com.android.build.gradle.internal.tasks.MockableAndroidJarTask;
 import com.android.build.gradle.internal.tasks.PrepareDependenciesTask;
@@ -95,7 +93,6 @@
 import com.android.build.gradle.internal.test.TestDataImpl;
 import com.android.build.gradle.internal.transforms.DexTransform;
 import com.android.build.gradle.internal.transforms.ExtractJarsTransform;
-import com.android.build.gradle.internal.transforms.JackTransform;
 import com.android.build.gradle.internal.transforms.JacocoTransform;
 import com.android.build.gradle.internal.transforms.JarMergingTransform;
 import com.android.build.gradle.internal.transforms.MergeJavaResourcesTransform;
@@ -122,7 +119,6 @@
 import com.android.build.gradle.tasks.GenerateBuildConfig;
 import com.android.build.gradle.tasks.GenerateResValues;
 import com.android.build.gradle.tasks.GenerateSplitAbiRes;
-import com.android.build.gradle.tasks.JackPreDexTransform;
 import com.android.build.gradle.tasks.Lint;
 import com.android.build.gradle.tasks.ManifestProcessorTask;
 import com.android.build.gradle.tasks.MergeManifests;
@@ -1449,12 +1445,7 @@
         createMergeJniLibFoldersTasks(tasks, variantScope);
 
         // Add a task to compile the test application
-        CoreJackOptions jackOptions = variantData.getVariantConfiguration().getJackOptions();
-        if (jackOptions.isEnabled()) {
-            AndroidTask<TransformTask> jackTask =
-                    createJackTask(tasks, variantScope, true /*compileJavaSources*/);
-            setJavaCompilerTask(jackTask, tasks, variantScope);
-        } else {
+        {
             AndroidTask<? extends JavaCompile> javacTask = createJavacTask(tasks, variantScope);
             addJavacClassesStream(variantScope);
             setJavaCompilerTask(javacTask, tasks, variantScope);
@@ -1713,11 +1704,7 @@
 
         if (baseVariantData.getVariantConfiguration().getBuildType().isTestCoverageEnabled()) {
             final AndroidTask reportTask;
-            if (baseVariantData.getVariantConfiguration().getJackOptions().isEnabled()) {
-                reportTask = androidTasks.create(
-                        tasks,
-                        new JackJacocoReportTask.ConfigAction(variantScope));
-            } else {
+            {
                 reportTask = androidTasks.create(
                         tasks,
                         new JacocoReportTask.ConfigAction(variantScope));
@@ -2065,83 +2052,6 @@
         task.dependsOn(taskFactory, agentTask);
     }
 
-    @Nullable
-    public AndroidTask<TransformTask> createJackTask(
-            @NonNull final TaskFactory tasks,
-            @NonNull final VariantScope scope,
-            final boolean compileJavaSources) {
-        if (scope.getTestedVariantData() != null) {
-            scope.getTransformManager().addStream(
-                    OriginalStream.builder()
-                            .addContentType(ExtendedContentType.JACK)
-                            .addScope(Scope.TESTED_CODE)
-                            .setJar(scope.getTestedVariantData().getScope().getJackClassesZip())
-                            .setDependency(scope.getTestedVariantData().getScope().getJavaCompilerTask().getName())
-                            .build());
-        }
-
-        // ----- Create PreDex tasks for libraries -----
-        JackPreDexTransform preDexPackagedTransform = new JackPreDexTransform(
-                androidBuilder,
-                globalScope.getExtension().getDexOptions().getJavaMaxHeapSize(),
-                scope.getVariantConfiguration().getJackOptions(),
-                true);
-        AndroidTask<TransformTask> packageTask =
-                scope.getTransformManager().addTransform(tasks, scope, preDexPackagedTransform);
-
-        AndroidTask jacocoTask = getJacocoAgentTask(tasks);
-        if (jacocoTask != null) {
-            packageTask.dependsOn(tasks,
-                    scope.getVariantData().getVariantDependency().getPackageConfiguration()
-                            .getBuildDependencies(),
-                    jacocoTask);
-        }
-
-        JackPreDexTransform preDexRuntimeTransform = new JackPreDexTransform(
-                androidBuilder,
-                globalScope.getExtension().getDexOptions().getJavaMaxHeapSize(),
-                scope.getVariantConfiguration().getJackOptions(),
-                false);
-        scope.getTransformManager().addTransform(tasks, scope, preDexRuntimeTransform);
-
-        // ----- Create Jack Task -----
-        JackTransform jackTransform = new JackTransform(scope, isDebugLog(), compileJavaSources);
-        scope.getVariantData().jackTransform = jackTransform;
-        final AndroidTask<TransformTask> jackTask = scope.getTransformManager().addTransform(
-                tasks, scope, jackTransform,
-                (transform, task) -> {
-                    scope.getVariantData().javaCompilerTask = task;
-
-                    scope.getVariantData().mappingFileProviderTask = new FileSupplier() {
-                        @NonNull
-                        @Override
-                        public Task getTask() {
-                            return task;
-                        }
-
-                        @Override
-                        public File get() {
-                            return transform.getMappingFile();
-                        }
-                    };
-
-                });
-
-        if (jackTask == null) {
-            // Error adding JackTransform. A SyncIssue was already emitted at this point.
-            getLogger().error("Could not create jack transform.", new Throwable());
-            return null;
-        }
-
-        // Jack is compiling and also providing the binary and mapping files.
-        setJavaCompilerTask(jackTask, tasks, scope);
-        setupCompileTaskDependencies(tasks, scope, jackTask);
-
-        jackTask.optionalDependsOn(tasks, scope.getMergeJavaResourcesTask());
-        jackTask.dependsOn(tasks, scope.getSourceGenTask());
-        return jackTask;
-    }
-
     protected void createDataBindingTasks(@NonNull TaskFactory tasks, @NonNull VariantScope scope) {
         if (scope.getVariantConfiguration().getJackOptions().isEnabled()) {
             androidBuilder.getErrorReporter().handleSyncError(
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/ApplicationTaskManager.java
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/ApplicationTaskManager.java
@@ -247,11 +247,7 @@
                         AndroidTask<? extends JavaCompile> javacTask =
                                 createJavacTask(tasks, variantScope);
 
-                        if (jackOptions.isEnabled()) {
-                            AndroidTask<TransformTask> jackTask =
-                                    createJackTask(tasks, variantScope, true /*compileJavaSource*/);
-                            setJavaCompilerTask(jackTask, tasks, variantScope);
-                        } else {
+                        {
                             // Prevent the use of java 1.8 without jack, which would otherwise cause an
                             // internal javac error.
                             if(variantScope.getGlobalScope().getExtension().getCompileOptions()
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/tasks/JackJacocoReportTask.java
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/tasks/JackJacocoReportTask.java
@@ -119,12 +119,6 @@
                     "More than one coverage file found in directory '%1$s', sharding for test "
                             + "coverage is not yet supported for Jack", getCoverageDirectory()));
         }
-        getBuilder().createJacocoReportWithJackReporter(
-                Iterables.getOnlyElement(coverageFiles),
-                getReportDir(),
-                getSourceDir(),
-                getReportName(),
-                getMetadataFile());
     }
 
 
--- a/build-system/gradle/src/main/java/com/android/build/gradle/BasePlugin.java
+++ b/build-system/gradle/src/main/java/com/android/build/gradle/BasePlugin.java
@@ -58,11 +58,9 @@
 import com.android.build.gradle.internal.variant.VariantFactory;
 import com.android.build.gradle.tasks.ExternalNativeBuildTaskUtils;
 import com.android.build.gradle.tasks.ExternalNativeJsonGenerator;
-import com.android.build.gradle.tasks.JackPreDexTransform;
 import com.android.builder.Version;
 import com.android.builder.core.AndroidBuilder;
 import com.android.builder.core.BuilderConstants;
-import com.android.builder.internal.compiler.JackConversionCache;
 import com.android.builder.internal.compiler.PreDexCache;
 import com.android.builder.model.AndroidProject;
 import com.android.builder.model.SyncIssue;
@@ -430,10 +428,6 @@
                                         new File(project.getRootProject().getBuildDir(),
                                                 FD_INTERMEDIATES + "/dex-cache/cache.xml"),
                                         getLogger());
-                                JackConversionCache.getCache().clear(
-                                        new File(project.getRootProject().getBuildDir(),
-                                                FD_INTERMEDIATES + "/jack-cache/cache.xml"),
-                                        getLogger());
                                 libraryCache.unload();
                                 Main.clearInternTables();
                                 return null;
@@ -453,11 +447,6 @@
                                             new File(project.getRootProject().getBuildDir(),
                                                     FD_INTERMEDIATES + "/dex-cache/cache.xml"));
                                     break;
-                                } else if (transform instanceof JackPreDexTransform) {
-                                    JackConversionCache.getCache().load(
-                                            new File(project.getRootProject().getBuildDir(),
-                                                    FD_INTERMEDIATES + "/jack-cache/cache.xml"));
-                                    break;
                                 }
                             }
                         }
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/variant/BaseVariantData.java
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/variant/BaseVariantData.java
@@ -33,7 +33,6 @@
 import com.android.build.gradle.internal.tasks.FileSupplier;
 import com.android.build.gradle.internal.tasks.GenerateApkDataTask;
 import com.android.build.gradle.internal.tasks.PrepareDependenciesTask;
-import com.android.build.gradle.internal.transforms.JackTransform;
 import com.android.build.gradle.tasks.AidlCompile;
 import com.android.build.gradle.tasks.BinaryFileProviderTask;
 import com.android.build.gradle.tasks.ExternalNativeBuildTask;
@@ -122,8 +121,6 @@
     public JavaCompile javacTask;
     @NonNull
     public Collection<ExternalNativeBuildTask> externalNativeBuildTasks = Lists.newArrayList();
-    @Nullable
-    public JackTransform jackTransform = null;
     public Jar classesJarTask;
     // empty anchor compile task to set all compilations tasks as dependents.
     public Task compileTask;
@@ -319,32 +316,26 @@
     }
 
     public void registerJavaGeneratingTask(@NonNull Task task, @NonNull File... generatedSourceFolders) {
-        Preconditions.checkState(javacTask != null || jackTransform != null);
+        Preconditions.checkState(javacTask != null);
         sourceGenTask.dependsOn(task);
 
         for (File f : generatedSourceFolders) {
             if (javacTask != null) {
                 javacTask.source(f);
             }
-            if (jackTransform != null) {
-                jackTransform.addSource(f);
-            }
         }
 
         addJavaSourceFoldersToModel(generatedSourceFolders);
     }
 
     public void registerJavaGeneratingTask(@NonNull Task task, @NonNull Collection<File> generatedSourceFolders) {
-        Preconditions.checkState(javacTask != null || jackTransform != null);
+        Preconditions.checkState(javacTask != null);
         sourceGenTask.dependsOn(task);
 
         for (File f : generatedSourceFolders) {
             if (javacTask != null) {
                 javacTask.source(f);
             }
-            if (jackTransform != null) {
-                jackTransform.addSource(f);
-            }
         }
 
         addJavaSourceFoldersToModel(generatedSourceFolders);
