Commit graph

8324 commits

Author SHA1 Message Date
Colin Cross
d59dab94c4 Add a --symlinks argument to soong_zip
Add a --symlinks argument that defaults to true to soong_zip.
Passing --symlinks=false will cause it to follow symlinks instead
of storing them in the zip file.

Bug: 112843624
Test: glob_test.go
Test: m checkbuild
Change-Id: I4deb98daa9d4ba9f94e3d7670c117fe00381d2ba
2018-09-21 16:08:16 -07:00
Colin Cross
08e28abc4e soong_zip: support globs in -f and -D arguments
-f and -D arguments can now take globs in the Soong format.

Also update the use of soong_zip that jars resources to escape the
globs in the arguments, and then shell-escape them when writing to
the rsp file so the glob escape are not intepreted by ReadRespFile.

Also remove an unused argument to the buildAAR rule that could
have contained values that needed escaping.

Test: m checkbuild
Change-Id: I7f20bb169dc01f952d2a7681ec6ee9c05737ed37
2018-09-21 16:08:16 -07:00
Colin Cross
3f4d116496 Update soong for ShouldFollowSymlinks argument to pathtools.Glob
pathtools.Glob now takes a ShouldFollowSymlinks argument.  Add
pathtools.FollowSymlinks to all the calls to pathtools.Glob to
maintain current behavior.

Test: m checkbuild
Change-Id: I0215efb212be4ba4513669612d88c2baade43747
2018-09-21 16:08:16 -07:00
Chih-Hung Hsieh
9e5d8a60e2 Use WITH_TIDY_FLAGS env variable.
This variable is a space separated string of clang-tidy flags to be passed
to clang-tidy before any other system required extra flags.
Note that when this flag or local tidy_flags is defined,
the default -header-filter flag is suppressed.

Test: make with WITH_TIDY=1 WITH_TIDY_FLAGS="-extra-arg=-DABCD1=1 -extra-arg=-DABCD2=2"
Bug: 32668284
Change-Id: If7bd31c65404ef7fe6c3499d51f0f209a704efd9
2018-09-21 15:19:24 -07:00
Chih-Hung Hsieh
60bd4bf079 Use DEFAULT_TIDY_HEADER_DIRS env variable.
This variable is a regular expression to be passed as
additional patterns to the -header-filter flag for clang-tidy.
For example, when make with WITH_TIDY=1 DEFAULT_TIDY_HEADER_DIRS="d1/d2|mydir/*"
for a project in external/xyz, clang-tidy will be called with additional flag
  -header-filter=\"(external/xyz|d1/d2|mydir/*)\"

Test: make with WITH_TIDY=1 DEFAULT_TIDY_HEADER_DIRS="d1/d2|mydir/*"
Bug: 32668284
Change-Id: I6051f4f80bc6dbab882bd81435ccbc772772ac63
2018-09-21 10:34:25 -07:00
Treehugger Robot
21e2a790ca Merge "Hide warning on static executables in strip.sh" 2018-09-20 03:59:09 +00:00
Colin Cross
c4fa0822cd Merge "soong_zip: add support for -j to junk paths" 2018-09-20 02:45:14 +00:00
Anton Hansson
cba8587bd7 Merge "Sanity check the tree before building." 2018-09-20 02:01:13 +00:00
Colin Cross
8e877af5f4 Hide warning on static executables in strip.sh
Stripping static executables prints a warning:
bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-nm: No such file or directory

The message is harmless, just hide it.

Also turn on pipefail so that the script will exit if the command
returns an error.

Bug: 24409581
Test: m checkbuild
Change-Id: I9647c55c3509e4573e6d4f2f6d88119bdf31e9fb
2018-09-19 23:23:51 +00:00
Colin Cross
b7c6911dd1 soong_zip: add support for -j to junk paths
When -j is specified ignore the path to the source file and just
zip it with its filename.  -j overrides -C, and -C overrides -j,
so -j -f path1 -C dir -f path2 will junk the path for path1, but
treat path2 as relative to dir.

Remove the filepath.Clean for the FileArgs, it would convert ""
to "." sometimes, and everything gets cleaned in zip already for
the non-command-line use cases.

Test: m checkbuild
Change-Id: I7d90572c622ee0c6f35967ff31d067b5312c72eb
2018-09-19 15:40:09 -07:00
Anton Hansson
ecf0f10d3d Sanity check the tree before building.
Check for the presence of Android.mk or CleanSpec.mk, which
are somewhat common problems.

Bug: 113147143
Test: m (with and without files present)
Change-Id: I31cf60c325e7f6c6fce7aec54712c1cb802055c2
2018-09-19 22:48:48 +01:00
Nan Zhang
2b2b6a72d3 Merge "Fix race condition for jdiff/apicheck" 2018-09-19 18:28:20 +00:00
Nan Zhang
23a1ba687d Fix race condition for jdiff/apicheck
Some build breakages happening on git_master/docs because jdiff rule and
apicheck rule may start in the same time, and jdiff may delete the same
srcjars and out dirs when apicheck trying to read which can cause
apicheck to be failed.

So change the dir names used by jdiff to not mix with dirs used by
apicheck.

Test: m -j docs
Bug: b/114368000
Change-Id: I90a53e0ef5f1ff947db7eb8cc73744919a9b93cb
2018-09-19 11:19:39 -07:00
Treehugger Robot
f8202802f6 Merge "Allow patch_module attribute in target: { android: { ... } } block." 2018-09-19 17:56:29 +00:00
Dan Willemsen
105de3443d Merge "*_OUT_INTERMEDIATE_LIBRARIES has been removed from Make" 2018-09-19 17:19:37 +00:00
Tobias Thierer
dda713d6fc Allow patch_module attribute in target: { android: { ... } } block.
patch_module is currently only used for non-host targets, although
there's a slim chance that there might be use cases on host in
future.

Currently, the only use case is patch_module: "java.base" in
device targets. To avoid erroneously carrying the patch_module
attribute over into the host version of the target, this CL
lets them place it into the target: { android: { ... } } block.

Test: Treehugger
Test: EXPERIMENTAL_USE_OPENJDK9=true make android-icu4j-tests
Bug: 115604102

Change-Id: If025d503d9c5681748a502a1d7433e8dbec3cac1
2018-09-19 16:31:30 +01:00
Nan Zhang
d23ac69a35 Export Api-versions.xml generated by Soong
Test: m -j
out/target/common/obj/PACKAGING/api-stubs-docs_generated-api-versions.xml
Bug: b/78245848

Change-Id: I951ac6294b1cdab3904009897efb8139c7c4f1a2
Merged-In: I951ac6294b1cdab3904009897efb8139c7c4f1a2
2018-09-19 05:39:46 +00:00
Treehugger Robot
fd20eade07 Merge "Add jdiff support for Soong" 2018-09-19 03:02:19 +00:00
Colin Cross
dbfc481996 Merge "soong_zip: move the -j flag to -parallel" 2018-09-19 01:42:24 +00:00
Colin Cross
df3f4c81f3 soong_zip: move the -j flag to -parallel
The -j flag is going to be repurposed to match --junk-paths in zip.

Test: m checkbuild
Change-Id: Id3809d6e5e3da375531269f2372eefc565091cc2
2018-09-18 16:31:09 -07:00
Nan Zhang
71bbe63526 Add jdiff support for Soong
Test: api-stubs-docs-diff
Bug: b/78245848
Change-Id: I069f6f8b1f9aa74ae1425cd5b792643d05b26820
2018-09-18 14:07:30 -07:00
Brandon Lee
5d45c6f6f8 Collect modules' info to create IDE project file.
- Register a singleton and implement GenerateBuildActions func in java/jdeps.go.
- Declare a interface and a struct to collect info in android/module.go.
- Implement IDEInfo for Library & Import module in java/jdeps.go.
- Implement IDEInfo for Genrule module in genrule/genrule.go.
- Implement IDEInfo for fileGroup module in android/filegroup.go.
- Test codes for jdeps.go in java/jdeps_test.go.

Bug: 111044346

Test: export SOONG_COLLECT_JAVA_DEPS=1;mmm packages/apps/Settings
      out/soong/module_bp_java_deps.json will be generated

Change-Id: If61da77b4d7614c2c5da438b6af4c725ceccc5c3
2018-09-18 17:44:10 +00:00
Colin Cross
cfbea98a57 Merge "Allow instrumenting android_test modules." 2018-09-18 17:22:22 +00:00
Steven Moreland
f7873ecf6d Merge "Add libbinder_ndk to the NDK." 2018-09-18 15:19:44 +00:00
Mathieu Chartier
ab033dc684 Merge "Revert "Change LibartImgDeviceBaseAddress to 0x60000000"" 2018-09-18 07:11:33 +00:00
Mathieu Chartier
d42f19cd7a Revert "Change LibartImgDeviceBaseAddress to 0x60000000"
This reverts commit 0c7bb7f31b.

Reason for revert: Some tests failing

Change-Id: I354ab0055aa8a7dea688422871d13aa78fa0018d

Exempt-From-Owner-Approval: bypass
Test: make
Bug: 112670831
Bug: 115828232
2018-09-18 07:10:36 +00:00
Søren Gjesse
49c1cb35f3 Merge "Don't include data resources when running R8" 2018-09-18 06:22:21 +00:00
Treehugger Robot
cc737f6fe0 Merge "Link msvcr110.a after mingwex.a" 2018-09-18 05:20:36 +00:00
Treehugger Robot
6b3cc607f3 Merge "Change the dist file path for sdk library" 2018-09-18 02:29:44 +00:00
Colin Cross
5067db9d02 Allow instrumenting android_test modules.
android_test modules should have Instrument = true like android_app
modules so that they get instrumented when EMMA_INSTRUMENT=true.

Bug: 115929955
Test: m EMMA_INSTRUMENT=true
Change-Id: I2c0e8ab95d2cdc47fc28af9c7264ab544d0e7a28
2018-09-17 16:46:35 -07:00
Pirama Arumuga Nainar
e5d974d67a Link msvcr110.a after mingwex.a
Bug: http://b/115909626

Some executables linked with msvcr110.a before mingwex.a loop on start
up with the following message:
    err:ntdll:RtlpWaitForCriticalSection section 0x7fdcb000 "?" wait
        timed out in thread 0009, blocked by 0000, retrying (60 sec)

https://android-review.googlesource.com/c/758688/ has a reproducer.

Test: The reproducer above works, and verify that few Windows binaries
behave correctly (print help message and such).

Change-Id: I837f421532d86f73713d70b3d93609b50d238af9
2018-09-17 23:33:28 +00:00
Colin Cross
37dc2c26f0 Merge "Don't attempt to deflate when compression level is 0" 2018-09-17 21:20:59 +00:00
Treehugger Robot
cc2746d1f2 Merge "Add OutputFile to cc.Module" 2018-09-17 20:03:09 +00:00
Sundong Ahn
4fd04bb506 Change the dist file path for sdk library
The dist file path is changed from apistubs/{api_scope}/*.jar to
apistubs/{owner}/{api_scope}/*.jar. it makes easy to get stub files
when updating prebuilts/sdk by making it possible to distinguish
between Android libraries and Google libraries.
And Onwer() function is added to ModuleBase for getting onwer info.

Test: make -j40 PRODUCT-sdk_phone_armv7-sdk dist sdk_repo
Change-Id: I50069aff6664901e6c9129d69643a414ee5e41d0
2018-09-17 09:43:30 +00:00
Dan Willemsen
2e224cae8e *_OUT_INTERMEDIATE_LIBRARIES has been removed from Make
So LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES is no longer necessary. And just
export the object paths directly to make instead of copying into the
intermediate libraries directory.

Test: m
Change-Id: Iba1523aec642fc81e9bf61da3125f714e91cd557
2018-09-15 10:46:17 -07:00
Colin Cross
d321629155 Don't attempt to deflate when compression level is 0
soong_zip -L 0 would attempt to compress with deflate at compression
level 0, then pick store instead of deflate because the overhead of
deflate would always make it larger than the uncompressed size.  Just
use store instead.

Test: m checkbuild
Change-Id: I69610bd755b55d97a47b8c6cf4fbbee3b5632db6
2018-09-14 20:20:13 -07:00
Colin Cross
446c666672 Don't pass -pie for Windows binaries
Passing -pie to clang for Windows binaries causes a warning:
clang-7: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

Bug: 115776263
Test: m checkbuild
Change-Id: Ie502a05dac32c192c38953c684dc80d1db24b792
2018-09-14 23:02:31 +00:00
Mathieu Chartier
1278a6ce77 Merge "Change LibartImgDeviceBaseAddress to 0x60000000" 2018-09-14 19:35:45 +00:00
Søren Gjesse
24f1702872 Don't include data resources when running R8
The change https://r8-review.googlesource.com/c/r8/+/26482 made R8
process data resources by default. This is not expected for the
Android Platform build

Test: m -j PRODUCT-aosp_x86-userdebug core-oj
Change-Id: Idb17e39dae524dacf4b258c9f27be86e3179667f
2018-09-14 15:20:42 +02:00
Colin Cross
ec06db2709 Merge changes from topic "hostdex"
* changes:
  Allow exclude_java_resources to affect java_resource_dirs
  Allow '$' in some paths
2018-09-13 22:49:21 +00:00
Colin Cross
cedd4768f5 Allow exclude_java_resources to affect java_resource_dirs
Allow excluding files from directory globbed by java_resource_dirs.

Test: java_test.go
Change-Id: I9922842248be1a386ab111a5187608438638ffb1
2018-09-13 18:28:03 +00:00
Colin Cross
fe4bc36f87 Allow '$' in some paths
The icu resource directories contain filenames that have '$'
characters.

Allow paths returned by the Glob functions to contain '$', on the
assumption that real paths on disk are unlikely to contain strings
that are valid ninja variables.  Fix the Build rules to escape any
paths that are passed as Path arguments.  Fix the resource rules to
manually escape the paths that are passed as strings.

Test: m checkbuild
Change-Id: Ie631bc6d96259e592adb280491a365c0df7ed0e2
2018-09-13 18:27:50 +00:00
Jiyong Park
c20eee3605 Add OutputFile to cc.Module
APEX needs to know the location of the output file of cc.Module to copy
it to an intermediate directory and package there.

Bug: 112672359
Test: m apex.test
Change-Id: Iaa19b29c2859df96f50716001dbd57df3f596050
2018-09-13 12:45:00 +09:00
Nan Zhang
9c69a126d5 Add Api level annotations support for Metalava.
Test: m -j docs with Api level annotations enabled.
Bug: b/78245848

Change-Id: Ife93899cdcf5b54ee0c75003c295aa4b917d3dba
2018-09-12 16:32:01 -07:00
Nan Zhang
c747535cc2 Merge "Split doclava run from metalava target." 2018-09-12 18:15:11 +00:00
Neil Fuller
3c979c3348 Add a new sdk_version "core_platform_current"
Add a new sdk_version "core_platform_current"
value to java_library.

This adds the ability to compile system code against the
core platform API stubs. These stubs will contain the public SDK
API _and_ a selection of extra methods just intended
for use by system code (e.g. framework .jar) and
which must be preserved if "core" is modularized to
retain source and binary compatibility. Methods
outside of the core platform API must not be relied upon.

Future changes will adding methods to the core platform API and
switch targets over to use the stubs.

As soon as feasible, (hopefully) the default for when
unspecified will be changed to be the same as specifying
core_platform_current and build rules will have to explicitly
specify when they want to compile against the core library
implementation directly.

Bug: 113148576
Test: mmm libcore/mmodules/core_platform_api_client_demo
Change-Id: I72a03f28a4c38b4232e513a088c2d4e962c98868
2018-09-12 07:29:26 +00:00
Nan Zhang
1598a9e099 Split doclava run from metalava target.
Originally when metalava sees arg: "--generate-documentation", it will
create a seperate process to invoke javadoc/dokka.

Now this is handled by our build system. Basically metalava target will
only generate a .srcjar file. Any other droiddoc target which generates
docs can depend on this metalava target.

By doing this, if multiple doc targets depending on the same metalava
sources. The metalava won't need to be re-run by multiple times which
could cause quite some timing overhead.

Test: m clean && m -j core-docs and
compare the results using md5sum between the old and new content.
also m clean && m -j core-current-stubs-gen-docs and
compare the results using md5sum  between the old and new content.
Bug: b/78245848

Change-Id: If7deef0da738645efe7d3a8376ff2bb3dec92c01
2018-09-11 15:41:50 -07:00
Colin Cross
b1dff80c0e Merge "Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules" 2018-09-11 21:51:25 +00:00
Treehugger Robot
d3ab493fa0 Merge "Enable toc support for Darwin and Windows" 2018-09-11 21:43:04 +00:00
Treehugger Robot
bc21394679 Merge "Enable Java 9 language support through java_version: "1.9" alone." 2018-09-11 21:40:55 +00:00