java_resource_dirs was using a file list file that was generated
at ninja time to get the list of files to include, which meant
there were no dependencies on the files to cause res.jar to get
rebuilt. Switch to using a glob at soong time instead. This
is substantially similar to a glob in java_resources, except that
java_resource_dirs strips the listed directories off the paths
that end up in the jar.
Test: TestResources in java_test.go
Change-Id: I4b9b38f7b6b38a013cbb4e211187e7282a6795c0
Honor the default resource exclusions in java_resources properties
including *.java.
Test: m -j checkbuild
Change-Id: Ia117a000680161b54c189758926ddb2068a2a2c3
Using a glob as a path failed the existence check. Append the
glob after converting the path to a string.
Test: TestExcludeResources in java_test.go
Change-Id: Ic1fd40aa283f3b0d59c1c589dbeec411583eddf1
Add a properties to allow including files as resources, including
support for filegroups. Also add a flag that causes module sources
to be included in the final jar.
Test: java_test.go TestResources
Change-Id: Ida8ee59b28df9fe66952170f46470d3a09fd5d65
It's not doing anything anymore, and the next patch will need more
complex jar arguments. Just remove it.
Test: m -j checkbuild
Change-Id: I96d15995e86263ec04fd5c13ab0fd54d8b85c788
Make javac rules output a jar file instead of a classes.list.
Combine the output jar, static jar dependencies, and resources
into the final jar using a separate rule. For now, use a shell
command with unzip and soong_zip to create the final jar,
eventually it will be done with a zip2zip-style jar combiner.
Bug: 64691570
Test: java_test.go
Change-Id: Id8e6313e0097b78947d88e86e47b56ad08caca1a
soong_zip produces jar files that are not compatible with java's
ZipInputStream. Switch to jar using ugly sed scripts to munge
file lists into the alternating -C and file arguments required
by jar.
Bug: 64536066
Test: m -j checkbuild
Test: build/soong/scripts/jar_args.sh --test
Change-Id: Ifcc4bdab25e7d02342720eb246c673ff9a58bddb
Move Soong's globbing-with-dependencies support into Blueprint so it can
be used for subdirs= lines in Android.bp files.
Blueprint has a slight change in behavior around subname= lines, it now
always uses the subname and doesn't fall back to Blueprints. To support
the Blueprints files in build/blueprint, use them directly with build=.
Test: build, add source file that matches glob, rebuild
Change-Id: Ifd0b0d3bc061aae0a16d6c7ca9a1cd8672656b4d
This centralizes verification and common operations, like converting the
path to a source file to the path for a built object.
It also embeds the configuration knowledge into the path, so that we can
remove "${SrcDir}/path" from the ninja file. When SrcDir is '.', that
leads to paths like './path' instead of just 'path' like make is doing,
causing differences in compiled binaries.
Change-Id: Ib4e8910a6e867ce1b7b420d927c04f1142a7589e
The source path was being appended to the module out directory
to create the file list file, which was resulting in .. in the
source path moving the file list file up the directory tree.
Use SrcDirRelPath to convert the globbed resource directories
to be relatiave to $srcDir before appending them.
Also do the same fix to generated aidl, logtags, yacc, and lex
files.
Change-Id: I2e636bd30abf03bc1d80a897951a9812cc3e09ef
If resources and java files were compiled from the same directory,
ctx.Glob could try to create a glob file that had the same name
as the directory containing another glob file. Namespace each
call to ctx.Glob so they never conflict.
Change-Id: I4db73af568a2ff2e708e9db64798073b1ed2ff61
To align with the current make build system, add exclude_srcs and
exclude_java_resource_dirs. These replace the functionality of
arch_subtract and glob exclusions that use "-file" to exclude a file.
Change-Id: I91c23d5e3c9409f2d9f7921f950153a03a68ad61
Make common.Glob take an interface that is the intersection of
blueprint.ModuleContext and blueprint.SingletonContext used by
Glob and GlobRule, allowing it to be called on either. Also
move ExpandSources and Glob into AndroidModuleContext.
Change-Id: I8d1a3160c5dd201033afdb37210e82d8065b137d
Handle java resource globbing in two passes, the first on the
list of resource dirs to produce a list of directories, and the
second to glob for files inside those directories using **/*.
Fixes incorrect jarSpec dir errors when the resource directories
list contains globs.
Change-Id: Icea5d8178336eb7de4ad91a9acba4822423d9f60
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