Commit graph

35 commits

Author SHA1 Message Date
Nan Zhang
0007d810e2 Change bool, and string properties to *bool, and *string for cc
there's no use case for prepending/appending to bool, and string
properties within module struct. Declearing "*bool" and "*string" almost
cover everything user need.

I did see one case that user specify relative_install_path as
path prefix in cc_defaults, and concatenate with the one in real module
to get the final relative install path in Android.bp <bionic/tests/libs>.

Test: m -j checkbuild
Bug: b/68853585
Change-Id: If3a7a2689c3fc307aae136af6bc9c57f27a1e1a0
2017-11-07 15:57:16 -08:00
Colin Cross
7d716baedf Revert "Revert "Make some common properties overridden when used in defaults modules""
This reverts commit 5c3c768187.

This reapplies I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890 along with
additional changes in other projects to match the new types.

Bug: 68337468
Test: m checkbuild
Change-Id: I2d2d876b291869f834a6468d3e2ad99148f94a15
2017-11-01 14:24:48 -07:00
Nicolas Geoffray
5c3c768187 Revert "Make some common properties overridden when used in defaults modules"
Bug: 68337468

Breaks HOST_PREFER_32BIT=true

This reverts commit 617016a6f2.

Change-Id: Ifb20f41cdf93dbfd73a3aac5b055e595e334350b
2017-11-01 09:32:53 +00:00
Colin Cross
617016a6f2 Make some common properties overridden when used in defaults modules
Switch commonProperties to *string and *bool so that defining them
in a module correctly overrides instead of appends to values set
in defaults modules.

Bug: 68337468
Test: m checkbuild
Change-Id: I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890
2017-11-01 05:28:36 +00:00
Colin Cross
92430106c3 Add hostdex support
If hostdex: true is specified for a java library, create an extra
Make module that copies the dex jar to a module with a -hostdex
suffix in the host output directory.

Bug: 67600882
Test: m -j checkbuild
Change-Id: I859dfaabeefdca714b566de94e00f74e03c85939
2017-10-10 08:02:20 -07:00
Dan Willemsen
866b563d4c Add target.linux_glibc and target.bionic
target.linux_glibc will apply to host builds with glibc, which is
identical to the current target.linux. In a future change, target.linux
will change to affect all targets using the Linux kernel (android,
linux_bionic, and linux_glibc).

target.bionic will apply to all OS variants using Bionic.

Bug: 31559095
Test: Add target.linux_glibc, target.bionic sections to an Android.bp, build
Test: m host
Change-Id: I677a67c22fba148fec264132311e355283f9d88d
2017-09-26 22:41:37 -07:00
Colin Cross
5349941875 Use soong_java_prebuilt.mk to export soong jars to java
Instead of trying to squeeze soong jars through prebuilt_internal.mk,
make a separate soong_java_prebuilt.mk.

Test: m -j checkbuild
Change-Id: Idadef3c21a6f618d573110f04c80d7db3db92031
2017-09-07 20:23:43 +00:00
Colin Cross
aa76858e48 Fix path to notice file
Make expects notice files paths to be from the root of the tree.

Test: m -j checkbuild
Change-Id: Ic280a8a97797b9a088aeb4e4a52b79816d2d4197
2017-09-05 15:55:04 -07:00
Colin Cross
5aac362949 Add notice property to all modules
Add a notice property to all modules which, if set, propagates to
LOCAL_NOTICE_FILE in make.

Test: m -j checkbuild, examine out/soong/Android*.mk
Change-Id: I565a5624dfd7b376b976b1a43dac5cea96869026
2017-09-01 13:21:53 -07:00
Colin Cross
0f86d186b1 Allow AndroidMkData.Custom handlers to extend normal values
Pass accumulated AndroidMkData to AndroidMkData.Custom handlers
and expose WriteAndroidMkData so that Custom handlers can write
out the normal make variables and then add their own.

Test: No change to out/soong/Android-aosp_sailfish.mk
Change-Id: Id9717132bbd6c5cf3af8596f3eaa9bbb05d98e40
2017-08-11 15:24:11 -07:00
Colin Cross
a18e9cfa29 Remove error from AndroidMkDataProvider.AndroidMk
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I3e3b7251f32ffa84dbdfd0448faf248c306ca808
2017-08-11 15:24:11 -07:00
Colin Cross
91825d2279 Remove error from AndroidMkData.Custom
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I021c7971ede3e11bbe08cf1601f4690ed4d1a036
2017-08-11 15:24:11 -07:00
Colin Cross
27a4b05441 Remove error from AndroidMkData.Extra
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I8a117a86aa39aeb07d9d8d0686ef869c52784f19
2017-08-11 15:24:11 -07:00
Dan Willemsen
05f17764c3 Use a unified ninja builddir
Instead of calling SetNinjaBuildDir, pass it to bootstrap.bash, so that
the bootstrap package can set it consistently during bootstrapping and
normal execution.

Bug: 63720725
Test: m -j nothing
Test: mkdir o; ../bootstrap.bash; ./soong
Change-Id: Ica88d2d5f1461b5be49bfe6316c6ec4ef4d89d49
2017-07-24 15:58:20 -07:00
Dan Willemsen
efac4a87ee Switch owner to *string to disable concat
If owner is specified in a defaults module, we shouldn't concat that
with the owner specified in a module using that defaults module. A
string pointer will produce the correct behavior (overriding the default)

Bug: 37330627
Test: out/soong/Android-*.mk looks correct after this change
Change-Id: I64574e2ba81c11b042248d7a44702ec4534ee932
2017-07-18 19:42:09 -07:00
Nan Zhang
db0b9a3cf3 Supported python build in host side.
The base module handles all the common functionalites, such as version
compatibilty check, version variations split, source file format check,
source/data file duplicate check.

The library/binary module focuses on how to generate binary build actions,
such as setting up stub script, zipping, filling in __init__.py in
runfiles dir tree.

Bug: b/31676493
Test: go test under python package

Change-Id: I06608369f350f7195873d459e1c8d1bdb811e77e
2017-05-05 13:27:56 -07:00
Dan Willemsen
aa118f95a6 Implement vendor as a synonym of proprietary
The vendor image will have more than just proprietary modules in it
under Treble, so let's stop marking open source code as proprietary just
to move it to vendor.

Bug: 36452052
Bug: 37134596
Test: compare build.ninja before/after, no changes.
Test: Set vendor: true, ensure it works.
Change-Id: I44b0ec7007d0e311bdcbd44b238b1ef2d05cc6ff
2017-04-07 14:59:18 -07:00
Nan Zhang
280802c102 Fixed the issue that phony module was broken.
Phony module was broken since it reached the code line to try to
invoke some specific arch functions which caused the runtime panic
error.

Bug: 36739664
Test: mm -j32 -k
phony {
     name: "shell_and_utilities",
     required: [
         "grep",
         "gzip",
         "mkshrc",
         "reboot",
         "sh",
         "toolbox",
         "toybox",
     ],
}
in system/core/shell_and_utilities/Android.bp

Change-Id: Idf7da17d431aae5f0c56b08f5e5eef14ae4eef50
2017-03-29 17:43:47 -07:00
Colin Cross
55708f3fb3 Support owner property
Support owner properties in Android.bp files and propagate the value
to make using LOCAL_MODULE_OWNER.

Bug: 36413696
Test: builds
Change-Id: Iac1cf7f2a14c9e3e6d85d6e09d5adb08a7078d00
2017-03-20 13:33:45 -07:00
Dan Willemsen
01a405a481 Add LinuxBionic toolchain and switch
This adds a toolchain definition for LinuxBionic that only supports
Clang/64-bit. It pulls pieces from the x86_linux_host and x86_64_device
configs, and uses the android clang triple, with some manual overrides.

To enable building this, set your soong.config file to:

 {"Host_bionic": true}

Bug: 31559095
Test: out/soong/{Android,make-vars}-aosp_arm64.mk the same with or
      without host bionic turned on
Test: No change to out/soong/build.ninja before/after this change
Change-Id: Id97dda8bd9aa670c32aed31fbe6aaa8175e70b59
2017-03-15 14:18:42 -07:00
Nan Zhang
6d34b308ff Added phony module type for soong.
The "required" field within "phony" module in .bp file has to be
non-empty. And "phony" module doesn't contain any "src" files.
Bug: b/32981153
Test: make -j out/soong/build.ninja

Change-Id: Iaa2009467c44702572b97ca9cbd02c1d368c8d83
2017-02-06 22:23:19 -08:00
Dan Willemsen
7ed1ae3fa4 Import/Export LOCAL_PROPRIETARY_MODULE
Test: androidmk hardware/broadcom/libbt/Android.mk
Test: m -j vulkan.default, inspect out/soong/Android-aosp_flounder.mk
Change-Id: I8a9553f772a1d434eb0069c1575e1b0d6db36bc9
2016-12-05 17:20:57 -08:00
Colin Cross
cc4f3e3f94 Don't generate Android.mk data if the module is disabled
Move the calls to the AndroidMkProvider to after checking if the
module is disabled.  Disabled modules may not have all the state
necessary to generate the data.

Test: m -j libLLVM
Change-Id: Iab27a26e604f3810bcc2d9f61b1839aa7bc428b4
2016-11-29 15:29:34 -08:00
Colin Cross
ce75d2c6a2 Initial prebuilt support
Support prebuilt shared libraries as an initial proof-of-concept of
prebuilts.  Future changes will support binaries and static libraries,
and the ability to select which to use based on something besides
blueprint properties.

Test: TestPrebuilts run during m -j
Change-Id: I6e84da667e9005ae11844bad01d25cbe4ced1ce3
2016-10-13 14:52:47 -07:00
Colin Cross
798bfce9d0 Move registration into android package
Mutator registration is tightly coupled with the android package, move
all registration from the soong package to the android package.

Test: build.ninja identical
Change-Id: Ie183d0b52cc7431c9e05b231934d189208ef1efe
2016-10-12 14:30:44 -07:00
Colin Cross
69617d3b7d Extend multilib
Allow multilib to be set to "prefer32", which will compile as 32-bit if
available, otherwise as 64-bit.

Add target.device.compile_multilib and target.host.compile_multilib.  If
set, they override the top-level compile_multlib property.

Change-Id: If658a035b5f441547bc74526feb1d34f773776ff
2016-09-06 13:26:37 -07:00
Chris Wolfe
998306e525 Support required property
This adds LOCAL_REQUIRED_MODULES to the generated Android.mk for any
dependencies in the "required" list of a module.

Change-Id: Ibcfe89dce7d247eb441af94e37388a59e71a75a9
2016-08-15 17:10:47 -04:00
Dan Willemsen
2277bcbc2a Add init_rc property, equivalent to LOCAL_INIT_RC
Change-Id: I914bfff8cbdf71b6cfb2271199a964b2cdcb72d0
2016-07-29 15:24:08 -07:00
Dan Willemsen
70e17fa6a5 Dump Soong module type statistics to Make
Make will combine this information with statistics gathered from the
Make build, then dump it out to a build artifact.

Change-Id: I2bd84d4f8a8d145c37e3a4c4fcc8fece99e2a1de
2016-07-25 16:00:20 -07:00
Dan Albert
6a0476930a Remove the implicit "_" in subnames.
The NDK stub libraries need to use subname, but should use "." instead
of "_".

Test: Still builds.
Change-Id: Ib4b0303531e03968c55671ea167ab987adebd783
2016-07-18 23:31:18 -07:00
Colin Cross
a1ad8d1889 Simplify arch target handling
Soong's multi-architecture building has grown complex, with the
combination of HostOrDevice+HostType+Arch necessary to determine how to
build a variant of a module, and three separate mutators to split each
into its variations.

Combine HostOrDevice+HostType into Os, which will be Linux, Darwin,
Windows, or Android.  Store Os+Arch as a single Target.

Change-Id: I92f2e2dac53617d595a35cc285d2bd348baa0fbd
2016-06-02 19:09:32 -07:00
Colin Cross
b9db480385 Revert "Simplify arch target handling"
This reverts commit 6713fb26cbcadf525cd75e47d7d0cbc23d282b3e.

Change-Id: Ic473cea2563b0b37dc08b0bc5d3a0ac8c4b6afe6
2016-06-03 01:50:47 +00:00
Colin Cross
54c7112c43 Simplify arch target handling
Soong's multi-architecture building has grown complex, with the
combination of HostOrDevice+HostType+Arch necessary to determine how to
build a variant of a module, and three separate mutators to split each
into its variations.

Combine HostOrDevice+HostType into Os, which will be Linux, Darwin,
Windows, or Android.  Store Os+Arch as a single Target.

Change-Id: Iae677eff61a851b65a7192a47f2dc17c1abb4160
2016-06-02 17:37:02 -07:00
Dan Willemsen
0fda89f4a8 Add support for logtags
This lets modules declare logtags files, which will then be exported to
make using LOCAL_LOGTAGS_FILES. Make still generates event-log-tags and
the java code.

Bug: 28989759
Change-Id: Ie6be79d3ef8a17a74d42eba681a25a08b4c0e7ae
2016-06-01 15:31:28 -07:00
Colin Cross
635c3b0157 Rename common to android
Rename the "common" package to "android", because common is too
generic.  Also removes all android.Android naming stutter.

Ran:
gomvpkg -from 'android/soong/common' -to 'android/soong/android'
gorename -from '"android/soong/android".AndroidModuleContext' -to 'ModuleContext'
gorename -from '"android/soong/android".AndroidBaseContext' -to 'BaseContext'
gorename -from '"android/soong/android".AndroidModuleBase' -to 'ModuleBase'
gorename -from '"android/soong/android".AndroidBottomUpMutatorContext' -to 'BottomUpMutatorContext'
gorename -from '"android/soong/android".AndroidTopDownMutatorContext' -to 'TopDownMutatorContext'
gorename -from '"android/soong/android".AndroidModule' -to 'Module'

Change-Id: I3b23590b8ce7c8a1ea1139411d84a53163288da7
2016-05-18 15:37:25 -07:00
Renamed from common/androidmk.go (Browse further)