Commit Graph

8340 Commits

Author SHA1 Message Date
Colin Cross 5eca7cb229 Clean up archMutator
Use a variable for module.base() and separate the full list of
targets for the class from the filtered list of targets for the
module.

Test: m checkbuild
Change-Id: I32edd26bcbaff0baf433d0581f253b8a5c8b81f3
2018-10-03 14:31:10 -07:00
Colin Cross 48de9a4ef5 Make more java modules defaultable
Make java_import, android_library and android_library_import modules
defaultable, and add some missing property structs to java_defaults.
Also use InitJavaModule everywhere.

Test: m checkbuild
Change-Id: I981875bbec5d1f87bae73f36a385e0b77c56c368
2018-10-03 14:31:10 -07:00
Pirama Arumuga Nainar b83de950e7 Remove --allow-multiple-definion linker flag for 64-bit Windows
Bug: http://b/109759970

r335286 fixed this for 64-bit Windows.  This remains broken for 32-bit
Windows.

Test: m native-host-cross
Change-Id: I4d11b83d51db055406c6723aad89efd1b86b9b7b
2018-10-03 11:40:23 -07:00
Treehugger Robot 0d7fd7f70a Merge "sdk_version <= 28 implies Java 1.8" 2018-10-03 14:41:02 +00:00
Jiyong Park 4584a8ac8e sdk_version <= 28 implies Java 1.8
When sdk_version is equal to or less than 28, java_version is implied to
1.8 unless it is explicitly specified. It was 26 originally, and is now
updated to 28 which is the most recent API version.

Bug: 117069453
Test: EXPERIMENTAL_USE_OPENJDK9=true make apex_aidl_interface
Change-Id: I18ebe3ec51ada54103f6d203b9bfae8ec6ea5d90
2018-10-03 18:05:04 +09:00
Treehugger Robot 72cf0a8479 Merge "Add DevicePrefer32BitApps to Soong" 2018-10-03 03:05:08 +00:00
Treehugger Robot be08f6b507 Merge "Use SoongJavacWrapper for javadoc" 2018-10-03 01:57:54 +00:00
Nan Zhang 40b41b4038 Use SoongJavacWrapper for javadoc
Test: m -j docs; javac_wrapper_test
Bug: b/116874473
Change-Id: I51d440c815d3db1a0a5dc26ad4e376189dc0aefe
2018-10-02 16:45:37 -07:00
Treehugger Robot 5b4a8eb854 Merge "Don't set targetSdkVersion to '1' for libraries" 2018-10-02 22:04:28 +00:00
Treehugger Robot c8b28a367d Merge "Don't include empty-string arguments in compile_commands.json" 2018-10-02 21:59:23 +00:00
Treehugger Robot a112b514e7 Merge "Fix double space in include argument" 2018-10-02 21:12:40 +00:00
Colin Cross 88da24e578 Add DevicePrefer32BitApps to Soong
Bug: 80095087
Test: m checkbuild
Change-Id: Ia2b2435492198ad646cbf7c59c6af59d381b20a5
2018-10-02 20:12:50 +00:00
Colin Cross 4b176069c3 Don't set targetSdkVersion to '1' for libraries
Setting targetSdkVersion to '1' causes ManifestMerger to add
implicit permissions when merging to a higher targetSdkVersion.
It should really be unset, but ManifestMerger treats unset
targetSdkVersion as 'Q' if minSdkVersion is 'Q' (but not if
minSdkVersion is '28').  Set it to something low so that it
will be overriden by the main manifest, but high enough that
it doesn't cause implicit permissions grants.

Bug: 115415671
Bug: 117122200
Test: m checkbuild
Change-Id: I1d2d031a21314f6b55d8ea1cc7c4c8e3ecae7f06
2018-10-02 12:39:38 -07:00
Alex Light 0c7cc1caa1 Don't include empty-string arguments in compile_commands.json
compdb.go was incorrectly splitting compiler arguments. This could
cause empty strings to be included in compile_commands.json,
potentially confusing tools.

Bug: 117124308
Test: m checkbuild
Test: m SOONG_GEN_COMPDB=1 \
        SOONG_GEN_COMPDB_DEBUG=1 \
        SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
      Examine $ANDROID_BUILD_TOP/compile_commands.json
Change-Id: I375baf255c50a1329cd644ac584d200aba9daa69
2018-10-02 11:28:25 -07:00
Colin Cross 06080f4137 Fix double space in include argument
The double space is confusing compdb.go.  compdb.go should be fixed,
but the double space is unnecessary so remove it.

Also make -isystem consistently followed by a space.

Bug: 117124308
Test: m checkbuild
Change-Id: I5ce7530d2ef66be8d8285e252d60a39299984a06
2018-10-02 11:16:56 -07:00
Christopher Ferris 946492f005 Merge "Add an isolated option for cc_test targets." 2018-10-01 23:07:31 +00:00
Colin Cross 16d387c970 Merge changes from topic "glob_escapes"
* changes:
  Use file glob for zipping classes*.dex files
  soong_zip: add --ignore_missing_files flag
  Add a --symlinks argument to soong_zip
  soong_zip: support globs in -f and -D arguments
2018-10-01 20:37:05 +00:00
Treehugger Robot ecdcb52270 Merge "Soong: Add relativeFilePathFlag category in CMakeList generator" 2018-10-01 16:41:33 +00:00
Stephen Hines ee15f2a7c7 Merge "Switch to clang-r339409." 2018-10-01 15:57:35 +00:00
Jack He 4a10b65fdc Soong: Add relativeFilePathFlag category in CMakeList generator
* Add relativeFilePathFlag compiler flag category whose format must be
  a=b/c/d, where "a" is the flag name and "b/c/d" is the flag value that
  is a relative path
* During CMake conversion, "b/c/d" will be prefixed with ANDROID_ROOT
  before being written to CMakeLists.txt

Bug: 112599284
Test: cd system/bt; mm -j40
      croot; make -j40

Change-Id: I4bb039678482201db60f0af97ab280d5028e0463
2018-10-01 07:59:54 -07:00
Dan Willemsen 2997123f73 Refactor Kati logic
Make the cleanspec & Android.mk runs of kati use much of the same code
and arguments.

Also renames 'Kati' to 'KatiBuild' in many cases, in the the expectation
that we'll have a 'KatiPackage' step in the future.

Use --no_ninja_prelude and move local_pool & _kati_always_build_ into
the combined ninja file. This will reduce the need to re-read makefiles
when Goma is enabled, and it allows us to include more than one
Kati-generated ninja file in the build graph.

Bug: 116968624
Test: build_test on downstream branches
Change-Id: Ibdac689b81f62dc293647fad917d84946f2c3cfa
2018-09-28 23:09:24 -07:00
Colin Cross 791399f1fd Use file glob for zipping classes*.dex files
Using a directory to zip the output of d8 and r8 was causing the
empty classes.dex.jar file in the output directory to get
zipped in.  Use a file glob instead so that it only picks up the
classes*.dex files even if classes.dex.jar already exists.

Test: m checkbuild
Change-Id: I1f3c1cbc23439fc52756aad027ab8cac10213d1d
2018-09-28 16:14:58 -07:00
Colin Cross 4be8f9e2a3 soong_zip: add --ignore_missing_files flag
soong_zip builds a list of files to zip early and then starts
zipping them all.  If a directory being zipped is concurrently
modified, a file that existed when soong_zip started may not
still exist.  Add a flag that continues when an expected file
does not exist.  Print a warning, since this should be rare
in normal usages but is a sign of a problem if it happens
regularly.

Test: zip_test.go
Test: m checkbuild
Test: m platform
Change-Id: I78426fe66fded8528ddd436c0f71a7442183cfeb
2018-09-28 16:14:52 -07:00
Colin Cross 09f11056f8 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.

Relands I4deb98daa9d4ba9f94e3d7670c117fe00381d2ba with tests.

Bug: 112843624
Test: glob_test.go
Test: zip_test.go
Test: m checkbuild
Change-Id: I0eff9c1f2dba79e873fda381ff585df55d5aaaad
2018-09-28 14:01:33 -07:00
Colin Cross 1d98ee23a3 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.

Relands I7f20bb169dc01f952d2a7681ec6ee9c05737ed37 with a fix for
trailing "\n" in list files, which causes a call to pathtools.Glob("")
that returns "./", which could then get incorrectly translated to
"../../../" in the zip file. Also adds tests.

Test: m checkbuild
Test: zip_test.go
Change-Id: I54b8eef9231875e6042a32c9f8bcc5c2f779922a
2018-09-28 14:01:29 -07:00
Colin Cross 05518bc13b soong_zip: Add tests
Add test that cover basic command line usage of soong_zip.  -D
is not covered yet as the implementation will be replaced with
one that is also more easily testable in the next patch.

Bug: 116751500
Test: zip_test.go
Change-Id: I5a1bcee74ebc9cb3cf332c36f89bc12c0e807ad2
2018-09-28 13:56:06 -07:00
Colin Cross b051ab5cb5 soong_zip: move profiling from zip library to soong_zip
Profiling is only used by the standalone soong_zip command,
move it out of the shared zip library.

Bug: 116751500
Test: m checkbuild
Change-Id: I443c34fb39cf8955e163a7720d6f7ed585e4172a
2018-09-28 13:56:06 -07:00
Colin Cross fe945b4401 soong_zip: move args parsing into zip.FileArgsBuilder
Add a builder that can construct []FileArg for zip.Run to use.
This will help writing tests that cover the command line parsing.

Test: later cl
Bug: 116751500
Change-Id: I15b5144f5094ab154f13de9c8a84b82db2da4e67
2018-09-28 13:56:06 -07:00
Treehugger Robot e9b16159d5 Merge "Add phony targets for go binary modules" 2018-09-28 19:45:22 +00:00
Colin Cross 2465c3d998 Add phony targets for go binary modules
Add custom handling to androidmk.go for the bootstrap.GoBinaryTool
interface in order to create .PHONY targets for each tool written
in go.

Bug: 64539926
Test: m checkbuild
Test: m androidmk
Test: m multiproduct_kati
Change-Id: Ic65faa27a6ee4dfbd54ed6d208091db7c1d657a2
2018-09-28 10:25:45 -07:00
Colin Cross 6dab9bd57a Add dependencies on d8 and r8 library arguments
d8 and r8 were missing dependencies on jars passed as library
arguments.  This normally worked because the input jar is likely
to also depend on the same jars.  When the classpath was added
to d8 it started to fail on libraries that have no code but
include other static libraries.

Bug: 116840360
Test: rm out/soong/.intermediates/external/nist-sip/nist-sip/android_common/turbine-combined/nist-sip.jar && m out/soong/.intermediates/frameworks/base/ext/android_common/dex/ext.jar
Change-Id: Ie642f4a343b949778d8ee6dcc4511f3fd7633be1
2018-09-28 15:15:08 +00:00
Christopher Ferris 9df92d6438 Add an isolated option for cc_test targets.
Test: Built a test using the isolated flag.
Change-Id: I0fe51437a66e03dbfb4ffcfd3a04af094388c6bc
2018-09-27 22:23:13 -07:00
Logan Chien f25112a70f Merge "Allow cc_prebuilt version suffix to include `svn`" 2018-09-28 01:24:24 +00:00
Treehugger Robot dbc2962c42 Merge "TradeFed: Add "test_config_template" flag in Android.bp" 2018-09-28 00:29:04 +00:00
Treehugger Robot dfe02f5dc8 Merge "Pass classpath to d8" 2018-09-27 23:27:45 +00:00
Colin Cross fc2aac5c71 Merge "Allow cc_object modules to use STL" 2018-09-27 23:23:19 +00:00
Nan Zhang 8202ad2f9a Merge "Fix invalid memory error for python binary build" 2018-09-27 20:31:40 +00:00
Colin Cross 907769f0fb Allow cc_object modules to use STL
cc_object modules may need access to the STL headers.

Test: m checkbuild
Change-Id: I88ad556a349d9530d24949f05eebf8b6fab4c62a
2018-09-27 18:06:23 +00:00
Colin Cross ffb657ebc0 Pass classpath to d8
d8 requires the full classpath if --min-api requires default method
or try-with-resources desugaring.  Always pass the full classpath,
since it will already have been built to generate the input jar.

Bug: 116243313
Test: m checkbuild
Change-Id: Ib0c18873880697b7cf942e0548dd2c53ee5ad23c
2018-09-27 11:05:09 -07:00
Neil Fuller daf5ec0c28 Merge "Allow conscrypt to depend on core.intra.stubs" 2018-09-27 10:59:53 +00:00
Jack He 3333889da5 TradeFed: Add "test_config_template" flag in Android.bp
* Allow module owner to specify a test_config_template in Android.bp
* The rule goes:
  1. When "test_config" is set, Soong uses specified test config
  2. If 1 is not true, check if "AndroidTest.xml" exist in the
     directory, if so, use "AndroidTest.xml
  3. If 1 and 2 are not true, check if "test_config_template" is set.
     If so, use module specific template to generate test config
  4. Otherwise, use Soong default template for test config for autogen

Bug: 113359343
Test: make
Change-Id: I9fb4b2b266be9e0c7cf23da4a51e1c8ae67cd857
2018-09-26 18:02:55 -07:00
Nan Zhang cba97e69ab Fix invalid memory error for python binary build
The root cause is we didn't check if the optionalpath is valid or not,
the registerbuildation function directly invoke the path var and
cause the invalid memory error. We just return if the launcher doesn't
exist.

The ctx.VisitDirectDepsWithTag() also handles allowmissingdependency so
we are ok if launcher doesn't exist.

Test: N/A
Bug: b/116698229, b/67510844
Change-Id: I40941079a64d7797ab879fc5edaa29e835b493a0
2018-09-26 16:57:24 -07:00
Treehugger Robot 82db9f9f69 Merge "Fixed the link to go/Android.bp" 2018-09-26 23:44:47 +00:00
Colin Cross ce6b038a55 Merge changes from topic "glob_escapes"
* changes:
  Revert "soong_zip: support globs in -f and -D arguments"
  Revert "Add a --symlinks argument to soong_zip"
2018-09-26 21:38:19 +00:00
Colin Cross 7f33b81ef6 Revert "soong_zip: support globs in -f and -D arguments"
This reverts commit 08e28abc4e.

Reason for revert: inserts extra ../../ entries in the zip file.

Bug: 116737386
Change-Id: I048f94889a66fe618058e37a5827d0cf6b1a6b68
2018-09-26 21:38:07 +00:00
Treehugger Robot c736cda13f Merge "Add OWNERS to finder's cache" 2018-09-26 21:37:54 +00:00
Colin Cross c7feeff1e9 Revert "Add a --symlinks argument to soong_zip"
This reverts commit d59dab94c4.

Bug: 112843624
Change-Id: I3d0f1b61e899b162e65c18662f9d27dd794a9a30
2018-09-26 21:36:44 +00:00
Stephen Hines c91ab9eb6d Switch to clang-r339409.
This also changes over llvm-strip to use the -o flag, rather than
relying on nonstandard (and no longer functional) positional arguments.

Bug: http://b/111998531
Test: Multiple new builds. For googlers - http://go/clang-r339409-testing
Change-Id: I8c82d06304af24a001e6552e36e2f540d8e364ce
2018-09-26 21:15:08 +00:00
Treehugger Robot e12f5e23c2 Merge "GccCppStdVersion should not be needed anymore" 2018-09-26 20:19:01 +00:00
Colin Cross 60b0360c3b Merge "Add a --symlinks argument to soong_zip" 2018-09-26 20:17:49 +00:00