in Android M, you can achieve that by using LOCAL_JACK_ENABLED = disabled variable in your makefile.
In Android N it is more tricky...it is broken and the solution to this is yet to come in AOSP mainline of Android N.
Solution is available in master.
Checked in 7.1.1 Android N.
You need to make use of javac-check target. This has been implemented for this purpose.
make javac-check-$(LOCAL_MODULE)
So, if your module name is "ABCD"
make javac-check-ABCD
This generates a classes-full-debug.jar, in the common\obj\JAVA_LIBRARIES\
ABCD_intermediates.
This is the jar which you can use in your Studio environment.
Most important, this solution is not yet visible in any of the tags on Android N branch. It is part of the master hence you need to add this solution to your branch manually.
commit | 32bd0adf9c5dcd1560d77bdb886c7acc78496657 | [log] [tgz] |
---|---|---|
author | Paul Duffin <paulduffin@google.com> | Thu Sep 15 14:34:42 2016 +0100 |
committer | Paul Duffin <paulduffin@google.com> | Mon Sep 19 13:38:51 2016 +0100 |
tree | 3b33f201ab2661384e386cdee70166172de4b508 | |
parent | 2fcacb5a226b17cd26f61a3ee3becebe3f4eacab [diff] |
Add targets for building individual modules using javac This is needed in order to be able to run error prone (which is a plugin replacement for javac) on a subset of the java code. Bug: 31507496 Test: Build javac-check-core-tests and check the resulting JAR Change-Id: I5a556920572fcdad7b39d67e3f00fe0e0f1f8f46
diff --git a/core/host_java_library.mk b/core/host_java_library.mk index 0a7dd8a..cc26d7c 100644 --- a/core/host_java_library.mk +++ b/core/host_java_library.mk
@@ -73,6 +73,7 @@ $(transform-host-java-to-package) javac-check : $(full_classes_compiled_jar) +javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar) # Run jarjar if necessary, otherwise just copy the file. ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
diff --git a/core/java.mk b/core/java.mk index e505ffb..606b474 100644 --- a/core/java.mk +++ b/core/java.mk
@@ -416,6 +416,7 @@ $(transform-java-to-classes.jar) javac-check : $(full_classes_compiled_jar) +javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar) # Run jarjar if necessary, otherwise just copy the file. ifneq ($(strip $(LOCAL_JARJAR_RULES)),)