Commit graph

5512 commits

Author SHA1 Message Date
Colin Cross
aa8630ba09 Move SDK prebuilts to new prebuilt_sdk module type
SDK prebuilts need to be treated differently than other prebuilts.
They are used like a normal Java prebuilts when compiling java files,
but they are also used as aapt includes when compiling apps, and they
provide prebuilt aidl files when compiling aidl sources.  Create a
new module type so dependers can determine what kind of dependency
they are.

Change-Id: If426da63cfadcb4b14abda58c7b346554912a07a
2015-04-13 17:31:25 -07:00
Colin Cross
f05fe97df6 Add logtags source file support
Add support for converting logtags files to source files.  Each
.logtags file is converted to a .java file, but only after all
.logtags files have been combined into a merged text file by
the logtagsSingleton.

Change-Id: I375d82874029bd26a7c528e46add2a638ba123f9
2015-04-13 12:25:40 -07:00
Colin Cross
6d1e72d7c6 Fix multi-dex builds
Building with --multi-dex requires passing an output directory
instead of an output file to dx.

Change-Id: I9ffcfe8ff6b96dbdda3eec1076124cd38ae5077f
2015-04-13 12:25:40 -07:00
Colin Cross
2097830df7 Extract classes out of jarjar jar for static java libraries
jarjar modifies the .class files in a jar, when using static java
library dependencies we need to use the modified class files and
not the ones that javac produced.  If jarjar is enabled, use
the prebuilt jar extractor to get the classes out of classes-jarjar.jar
and export them through j.classJarSpecs.

Change-Id: Ia2854f1c26d630da12cab7c421007aad4f793ecd
2015-04-10 17:49:44 -07:00
Colin Cross
8cf1334116 Miscellaneous fixes for java compiling
Remove java out directory before compiling to avoid incremental compile
issues.  Move the rspfile out of the out directory so it doesn't get
deleted.  cc->javac in the javac rule.  Don't call javac if there
are no source files.

Change-Id: I0bb06c214da54a587bd9e7c9d17caaf0ed1e595e
2015-04-10 15:50:37 -07:00
Colin Cross
c0b06f191f Add aidl file support to java builds
Add support for aidl files listed in srcs for java builds, and
an aidl_preprocess module type for framework and sdk aidls.

Change-Id: I3aa537f4483822e5b534c74d0b35f13a938f8947
2015-04-08 16:37:31 -07:00
Colin Cross
6cbb127564 Fix missing bootclasspath error in java compiles
If a java library only links against the same jar as bootclasspath,
the jar was being added to classpath and not bootclasspath, leaving
bootclasspath blank and using the default bootclasspath.  Reverse
the order so that bootclasspath takes effect.

Change-Id: Ib9fbf01897314a57228013d4aef52606390b0aca
2015-04-08 15:19:36 -07:00
Colin Cross
fce532760f Support subtracting sources from globs
Support -file or -path/glob in file lists that contain globs to
subtract files from the resulting glob.  Also move source file
prefixing and handling into a common function.

Change-Id: Ib6d74ce22f53cae7348c4ba35b779976d90359a6
2015-04-08 15:19:30 -07:00
Colin Cross
1332b0035c Move config into common and provide helper
Using ctx.Config().(Config) everywhere is a mouthful, and it is
inefficient to do the type assertion.  Put the Config interface into
the context, and provide an AConfig() to return the Config already
converted to the right type.

Change-Id: I301a1fd7d2a005580aabca7866a37c5d42ad8c69
2015-04-08 15:19:24 -07:00
Colin Cross
65bf4f231c Add jarjar support
If jarjar_rules is set, pass the compiled jar through jarjar to
produce a new intermediate jar.

Change-Id: Ied596433fd5c49d05f07c04245f3abe8b9aadc5e
2015-04-08 15:15:15 -07:00
Colin Cross
e1d62a8b1f Add support for using prebuilt libraries as static dependencies
Extract files out of prebuilt libraries and create list files
for classes and resources in order to allow including them in
other jars.

Change-Id: I9269d1fd6e0f570811a00bf319098ac1f7cdc816
2015-04-03 16:53:05 -07:00
Colin Cross
2fe6687847 Support java libraries, binaries, and prebuilts
Add support for compiling java libraries (.jar files with
or without .dex), java binaries (.jar files with a wrapper
script to run them), and java prebuilts (for the SDK .jars)

Change-Id: Id624da64c92cf20c6d9577c6bb06e5b212af0d1b
2015-04-03 16:24:44 -07:00