Commit graph

56 commits

Author SHA1 Message Date
Yihan Dong
46ee66c098 Merge "Assign each xts test package a copy license metadata" 2022-09-09 00:56:42 +00:00
Bob Badour
b18d9852c8 Clear out old license package name, if any.
Bug: 244574519

Test: m droid dist
Change-Id: I4daa18dc9bdbea30cff3098eca5fc0eb7e5739af
2022-09-07 11:58:53 -07:00
Yihan Dong
9b75c9ee1a Assign each xts test package a copy license metadata
Use a copy license metadata instead of module_license_metadata to make each xts test package names shown in the final xts notice file.

Test: m gts reportmissinglicenses
Bug: 245474938
Change-Id: Ic5e28763bc4e8448d3e04a80e89db147387164a6
2022-09-07 08:12:37 +00:00
Bob Badour
04fbe29669 Append built and installed when copying metadata.
Soong doesn't always have the built and installed available.

Bug: 239638693

Test: m droid dist

Change-Id: Id18201da488e3b16d60957c9a298a52345595c5b
2022-07-29 17:16:25 -07:00
Bob Badour
d227fac95b Revert "Revert "Revert "Revert "Create lists of projects to share per dist target""""
This reverts commit 398bd87950.

Reason for revert: Rolling forward again without 'all' target.

Bug: 151177513
Bug: 210912771
Bug: 235333302
Bug: 232138105

Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_coral_hwasan TARGET_BUILD_VARIANT=userdebug droid dist with-license platform_tests continuous_instrumentation_tests continuous_native_tests

Test: tapas google-tradefed-all && m dist

Change-Id: I1e5f5639ebf1fa61060124a5183f6f0a2ece04b5
2022-06-14 11:33:54 -07:00
Bob Badour
398bd87950 Revert "Revert "Revert "Create lists of projects to share per dist target"""
This reverts commit 82040d9882.

Reason for revert: Advised to switch to using TARGET_BUILD_APPS

Change-Id: If56a1fceb5da66b90b7b0ec2275ec429661515b4
2022-06-14 00:03:23 +00:00
Bob Badour
82040d9882 Revert "Revert "Create lists of projects to share per dist target""
This reverts commit 59e4951021.

Reason for revert: Attempt to roll forward again.

Test: m droid dist reportmissinglicenses

Change-Id: Ibf5a9869d03726e279fb23bf68ca66547b972138
2022-06-08 18:49:20 -07:00
Bob Badour
ba3372439f Create license metadata for copied targets.
Bug: 213388645

Test: m cts dist reportmissinglicenses
Change-Id: I43043e5e7b80d9f3210d6498c215846aec761add
2022-06-02 15:43:08 -07:00
Bob Badour
6259a09b7a Remove unused combine-notice-files macro.
Bug: 151177513
Bug: 213388645
Bug: 210912771

Test: m cts reportmissinglicenses
Test: m droid reportmissinglicenses
Change-Id: I4cddf9a381a1258bdc2b1b42be72c447df10d234
2022-04-07 22:04:03 -07:00
Bob Badour
42f00c7b61 Test suite notices using dependencies.
Switch from combine-notice-files to html-notice-rule and
text-notice-rule.

Bug: 151177513
Bug: 213388645
Bug: 210912771

Test: m cts reportmissinglicenses
Change-Id: I59d78553f15f0fd6be87228c933693b63e2ebf04
2022-03-23 11:18:39 -07:00
Bob Badour
77570059cd Phony target to report all library names.
Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m nothing reportallnoticelibrarynames

Change-Id: I0f791e2d92b8135d6af3a6c93f0db348fc69f5a1
2022-03-02 22:32:37 -08:00
Colin Cross
71d9919322 Revert^2 "Reuse license metadata files from Soong"
81b167693f

Change-Id: Iff45cffb1f2b9d01cec70d96e34f46d35bb37842
2021-12-10 23:05:02 +00:00
Colin Cross
81b167693f Revert "Reuse license metadata files from Soong"
Revert "Escape Host*Variable contents"

Revert submission 1899703

Reason for revert: b/210158272
Reverted Changes:
I142c19284:Reuse license metadata files from Soong
Ife89b8f23:Add dependency license annotations
I8e7410837:Build license metadata files in Soong

Change-Id: Id9d66c01453aebe8a52eaa6628e9933a990d4c2f
2021-12-10 23:03:08 +00:00
Colin Cross
4f8dd6fe45 Reuse license metadata files from Soong
Copy the license metadata files from Soong if they've already
been built.

Bug: 207445310
Test: m checkbuild
Change-Id: I142c192843e94b018079809bd596ff81136b2de3
2021-12-03 22:47:11 +00:00
Colin Cross
52a0c97e5a Revert "Revert "Move meta_lic files into per-module intermediates directories""
This reverts commit e41ad14f58.

Change-Id: I77211030b657b894002a1a1bded773b3c4b0334a
2021-12-03 22:46:20 +00:00
Colin Cross
e41ad14f58 Revert "Move meta_lic files into per-module intermediates directories"
This reverts commit 44858d35ce.

Reason for revert: b/208892388

Change-Id: I058e988a8949ed9aa1fac086a69b37a053681982
2021-12-03 00:44:23 +00:00
Colin Cross
44858d35ce Move meta_lic files into per-module intermediates directories
Store the meta_lic files in the per-module intermediates directories
to avoid conflating multiple variants for the same module, for example
host and device.

Bug: 207445310
Test: m checkbuild
Change-Id: I2b0ca22c1f7b069f79d2026707be3294c488f6de
2021-12-01 14:38:13 -08:00
Bob Badour
879cfa867d Add macros for non-module license metadata and deps
Gets rid of .meta_module files and instead defers emitting rules until
after all the non-module targets have been processed. Allows direct
dependency on .meta_lic files, which in turn depend on license text
files.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m reportmissinglicenses

Change-Id: I2c467feac6e13a9366ff66f924889f1dbd48c3f1
2021-11-03 00:52:25 +00:00
Bob Badour
3412a07822 Avoid duplicate installed notice file rules.
For cases with a my_register_name, move into $(call license-metadata-rule).

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m nothing

Change-Id: Ib6c610960347db84503831b1e1519622696d4500
Merged-in: Ib6c610960347db84503831b1e1519622696d4500
2021-02-21 09:03:15 -08:00
Bob Badour
7a95820907 Revert^2 "Rough-in license metadata support to make."
Changed shell script to /bin/sh syntax for portability to mac_os etc.

54066744f0

Change-Id: Ibd472fc1bedfdc228a704108f0280b13ab1c9333
2021-01-06 20:52:43 -08:00
Bob Badour
21bd34fe09 Revert^2 "Add variables for notice deps, license kinds etc."
dcfb9c5ef5

Change-Id: I6a60f55ab0e7013061a695cb1b7c5ffde29577dd
2021-01-06 20:46:49 -08:00
Jerome Gaillard
dcfb9c5ef5 Revert "Add variables for notice deps, license kinds etc."
Revert "Export soong license data to make."

Revert "Add ability to declare licenses in soong."

Revert submission 1377717-metalics

Reason for revert: This has broken renderscript_mac target for aosp-master, see b/176909442

Reverted Changes:
I26ac54ca9:Define the standard license_kind rules.
I656486070:Export soong license data to make.
If9d661dfc:Export soong license data to make.
I97943de53:Add ability to declare licenses in soong.
Icaff40171:Rough-in license metadata support to make.
Ib8e538bd0:Add variables for notice deps, license kinds etc.

Change-Id: I1f672e6e8ec48f0141bb4b6cc4eb2efed1eeef6b
2021-01-06 19:00:05 +00:00
Jerome Gaillard
54066744f0 Revert "Rough-in license metadata support to make."
Revert "Export soong license data to make."

Revert "Add ability to declare licenses in soong."

Revert submission 1377717-metalics

Reason for revert: This has broken renderscript_mac target for aosp-master, see b/176909442

Reverted Changes:
I26ac54ca9:Define the standard license_kind rules.
I656486070:Export soong license data to make.
If9d661dfc:Export soong license data to make.
I97943de53:Add ability to declare licenses in soong.
Icaff40171:Rough-in license metadata support to make.
Ib8e538bd0:Add variables for notice deps, license kinds etc.

Change-Id: Iaf2243cba16f6191b022371a14f81ef8194a47d1
2021-01-06 19:00:05 +00:00
Bob Badour
20fc1b3719 Rough-in license metadata support to make.
Change-Id: Icaff40171b94538219a8caa697b182dbdcc8229a
2021-01-05 08:42:48 -08:00
Bob Badour
6421674a39 Add variables for notice deps, license kinds etc.
Change-Id: Ib8e538bd09044a5791083b362d807cd9293833d5
2021-01-05 08:42:48 -08:00
Jesse Hall
a16690c38c Skip unneeded notice files for DATA modules.
Non-installable generated intermediate data modules can have
notice files attached when they're defined in the same LOCAL_PATH
as the installable module that depends on them. This makes uninstallable
DATA modules silently ignore the fact that the build doesn't know where
to install the notice file.

Bug: 160248517
Test: build
Change-Id: I09a8a253dda52c2d78a1ebc0c33cd96e3505e2e3
Merged-In: I09a8a253dda52c2d78a1ebc0c33cd96e3505e2e3
2020-10-07 14:01:12 -07:00
Colin Cross
e0c5e44360 Revert "Revert "Use sdk variant of Soong modules when LOCAL_SDK_..."
Revert^2 "Add sdk mutator for native modules"

f8e80229fedb47302e9cfd32990859a6308020cf

Change-Id: Ib686b52339ae5031434a2fb6a0e7f5b0c0dc5641
2020-04-07 16:50:32 +00:00
Colin Cross
79e5a55122 Revert "Use sdk variant of Soong modules when LOCAL_SDK_VERSION ..."
Revert "Add sdk mutator for native modules"

Revert submission 1242911-sdk_version_variant

Reason for revert: b/153394225
Reverted Changes:
Ife99745fb:Use libnativewindow for platform variant of libagq...
I1bae84c43:Use libnativewindow for platform variant of androi...
I6e6021ed3:Use stl to depend on libc++
Ife99745fb:Use libnativewindow for platform variant of libRSS...
I2c9f439b9:Fix static dependency on libprotobuf-cpp-lite-ndk
Iff2aff9cf:Set sdk_version for cc_genrules used by modules wi...
I7d72934aa:Add sdk mutator for native modules
Ief378a007:Use sdk variant of Soong modules when LOCAL_SDK_VE...

Bug: 149591340
Change-Id: I6cd4de221ece29e48d58a8b1297dc2512b2dad13
Fixes: 153394225
2020-04-07 04:21:21 +00:00
Colin Cross
b934116994 Use sdk variant of Soong modules when LOCAL_SDK_VERSION is set
Soong now makes a variant of native modules that set sdk_version.
Use the new variant for native modules or apps with JNI that are
defined in Make and set LOCAL_SDK_VERSION.

Test: m checkbuild
Bug: 149591340
Change-Id: Ief378a007e43b0aea31fd5845410bbffec0ffae6
2020-03-24 10:48:24 -07:00
Bob Badour
9da828c1b4 Include LICENSE files, when available, in notices.
As a first step to removing the go/android3p instructions to copy or
to link NOTICE to LICENSE, include LICENSE files in the notices, which
will allow deleting all of the copied/linked NOTICE files.

The change causes a couple minor additions to the system image notice
files.

Test: manually built and compared before and after notices

Change-Id: Id23cae4a8f2d103e1379f4341340fc56c5943dc2
2020-02-27 19:19:23 +00:00
Jiyong Park
e12c862013 Avoid path conflicts for the notice files
Path conflicts could happen when following conditions are met.
1) a java library named "foo" is not installable.
2) a java library named "bar" is installable, and its stem is set to
"foo".

Then the notice file for 1) becomes foo.jar.txt following its
LOCAL_MODULE, while the notice file for 2) becomes foo.jar.txt following
its stem. Since the file for 1) is a synthetic one, the actual name
isn't important. Avoid the conflict by appending a suffix
(_non_installable, but could be anything) to the file name for 1).

There still is a chance for the conflict; if the stem for "bar" is set
to "foo_non_installable". But practically, the chances are very low.

Bug: 139391334
Bug: 143700028
Test: m
Change-Id: Id50b30774bbf65cc180baf963a95ea56fe6eb74f
2019-11-04 10:30:34 +09:00
Ivan Lozano
d62e7123d8 Make support for rust modules from Soong.
Support for rust modules built in Soong.

Bug: 136189233
Test: Test module builds.
Test: crosvm builds.
Change-Id: Idf2e4a4f760cbcee1d35fe6567ef8e12d4855094
2019-08-27 11:23:35 -07:00
Jooyung Han
9340a673cd make: Add support to skip current VNDK install
You can get a system.img without current VNDK libs.
This may help when you want a smaller system.img given that the image
will be used with a specific version (not current) of vendor image.

Bug: 132140714
Test: m TARGET_SKIP_CURRENT_VNDK=true && see if current VNDK is not
installed

Change-Id: Ie0815e6dd6ce2f861b6c42e637da4bb146320673
2019-05-25 02:06:08 +09:00
Jaewoong Jung
dca3186b84 Skip unneeded notice files for ETC modules.
Non-installable, non-library modules can still have notice files
attached if they are bundled in an apex module, in which case the
current make setting would generate an error. This change makes it just
ignore them silently if the module is ETC. Other classes will still
trigger an error.

Test: manual build + TreeHugger
Change-Id: Ic7931f990369f744c8de62956a1a0a9c0451d6ab
2019-04-22 21:39:10 +00:00
Jaewoong Jung
e8cb1954bb Add -CROSS suffix to cross host OS notice targets.
This fixes a bug where cross host OS notice dependecies were incorrectly
added and caused missing file errors.

Bug: 36073965
Test: Manual build + inspection
Change-Id: I3983ad6158acf939842f836fe3f44cecf9187087
2018-11-08 16:53:02 -08:00
Dan Willemsen
649311868c Fix vndk packaging to stop depending on phony targets
These had been depending on the phony target for the library
(liblz4.vendor), not the actual built file and notice file.

Since we hadn't been saving the NOTICE file, and were only assuming the
installed notice file path. save that away for use during packaging.

Test: m vndk; diff out/target/product/generic/android-vndk-aosp_arm.zip
Test: m vndk; diff out/target/product/generic_arm64/android-vndk-aosp_arm64.zip
Change-Id: If9a4bed27030b7bd464cd3987739df94d32a0037
2018-06-19 09:26:58 -07:00
John Muir
58d96b150e notice_files: Disable NOTICE files for FAKE modules.
Currently the build system will automatically attribute a NOTICE
file with the target of $(BUILD_PHONY_PACKAGE). This shouldn't
be the case.

Disable notice file inclusion for fake targets so that the
/fake_packages/blah_blah-timestamp paths don't show up in
NOTICE.xml.gz.

Bug: 77910458
Test: NOTICE files are not attributed to fake targets.
Change-Id: Ia942cac41b750efbd5a23d896d85ac0820ee8b4e
2018-04-11 13:07:13 -07:00
Colin Cross
a6bc3a8a4c Delete jack support
Remove all support for running jack.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
2017-10-02 18:06:56 +00:00
Dan Willemsen
2be559488d Exclude ndk stubs from notice file list
There are many references to ndk stub libraries in the third party
notices:

out/soong/ndk/platforms/android-10/arch-arm/usr/lib/libc.so
out/soong/ndk/platforms/android-10/arch-arm/usr/lib/liblog.so
...

These are just stub libraries, and aren't distributed on the device. The
real versions of these libraries will be distributed on the device, and
already have the license information.

So let Soong set LOCAL_NO_NOTICE_FILE to prevent these from appearing.

Bug: 36867708
Test: Diff aosp_arm's system/etc/NOTICE.html.gz file before/after
Change-Id: Ifa3693bde7d3b6b9dc7a83122f9cfa24997fac50
2017-04-04 14:59:55 -07:00
Dan Willemsen
8dae49c5e1 Add Header Library support to Make
We currently use static libraries without any source files to represent
header libraries, but Soong actually has cc_library_headers. So to
export those in a separate namespace from static libraries, implement
them in Make as well.

This also adds a nice pretty-warning / pretty-error macro that can be
used to print out standard warning messages pointing to the real source
file having the problem.

Test: Use a header library exported by Soong in a Make module
Change-Id: I3486539e247524cb82a20620745fc7be03014e14
2017-02-15 16:04:49 -08:00
Dan Willemsen
e0bba6fa12 Fix PDK dupbuild issues
The PDK uses pattern rules in order to install files from the PDK. When
those files already have build rules, the explicit rules override the
pattern rules, and everything works. But because Make (and Kati) doesn't
attempt to clean the file paths, if one of the rules has a redundant /,
we'll export two ninja rules, and ninja will error out with a dupbuild
error.

The PDK pattern rules are clean, but the explicit notice file creation
was not, it was always adding a double // in between NOTICE_FILES/src
and the module path.

Some modules were also setting a LOCAL_MODULE_PATH with a trailing /,
which is redundant, and also hits the above problem. Instead of fixing
all of the modules, just strip a trailing / from my_module_path.

Bug: 33451638
Test: Build with a PDK
Change-Id: Iff3e98fd191ea90626b9b89f179537e8a75f5ef2
2016-12-09 21:15:41 -08:00
Dan Willemsen
3bf15e71d3 Record module type statistics
Creates a build_system_stats.txt build artifact that contains statistics
on how many BUILD_* modules are defined in a build. Also writes out
information about the Soong module types sent from the Soong build.

Merged-In: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
Change-Id: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
2016-07-29 19:58:35 +00:00
Narayan Kamath
76c7d68ed9 Allow modules to override the default NOTICE file.
It's useful in projects where different top level modules have
different licenses associated with them.

(cherry picked from commit 3026f4daf1)

Change-Id: I71b20d6f979c0f50562f4f44b2af1f3ec2909444
2015-12-24 10:10:55 +00:00
Dan Willemsen
057aaea54a Add HOST_CROSS_OS
Instead of using recursive make to change the HOST_OS when building the
windows SDK under linux, add the concept of cross-building to another
host os.

Bug: 23566667
Change-Id: I6dc525b601b6251d458d197c30bf4660d7485502
2015-09-09 18:12:29 +00:00
Yohann Roussel
f09e59eb52 [DO NOT MERGE] Compile using Jack.
This allows to compile dex targeted java sources using Jack and Jill.
Default is still to compile with the legacy toolchain. Default can be
switched to the new toolchain by setting environement variable:
export ANDROID_COMPILE_WITH_JACK=true
Toolchain can also be forced for one module by defining
LOCAL_JACK_ENABLED:=full # disabled, full, incremental
in the mk portion defining the module.

Jack execution environement can be controlled with:

Global variable ANDROID_JACK_VM allow to change the jvm executing Jack.
Global variable ANDROID_JACK_VM_ARGS allows to change default args given
to the jvm.
Global variable ANDROID_JACK_EXTRA_ARGS allows to define some default args
to give to Jack

LOCAL_JACK_VM_ARGS allows to override default args given to the jvm for
the module.
LOCAL_JACK_EXTRA_ARGS allows to override default args passed to Jack.

This includes cherry-picks of the following changes:
b4c49cba57
22c3fa6d73
138768c1bb
5dd3e1d312
83d5d04047
8bc90fd2d6
140274707e
0fbc9ff2a2
833b427d72
f9a27f45b4
2809666941
37822c443d
c6b44d43c3
d2a76c14bf
06744f60fc
95573d5036
b821391614
2794e7b582
801f2c44d0
c76d99dca1
f528e132d6
76a5e0bd1a
e25b3984ff Partially, only Jack related parts werekept
ec46a3b71f
abee3a9f41
77cbe10fd9
daf07db4cd
b6bfb5893a

Ie all Jack related changes untill
b6bfb5893a
except
a96cc59ab5 "Use Jack by default"

Change-Id: If9d47ef1c4fd1e6765ad2a47d816c1ad3cfab0e3
2015-05-19 18:31:05 +02:00
Ying Wang
6ef6519170 Set up rules to build static libraries for TARGET_2ND_ARCH
The rules for the 2nd arch are set up in the second inclusion
of static_library_internal.mk.
libfoo of the 2nd arch will be built into
$(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)/libfoo_intermediates/libfoo.a.

Bug: 11654773
Change-Id: I1d92733968fc442e9225b4df5bd1b551a81d89f7
2014-01-24 13:35:09 -08:00
Ying Wang
62c81f821f Collect NOTICE files for apps_only build.
In apps_only build (after running tapas or exporting TARGET_BUILD_APPS),
run "make notice_files" to collect and combine the NOTICE files of
modules that are needed by the apps.

Bug: 10445634
Change-Id: I6555bba1104e43b48c723c82143c46d444a75e80
2013-08-24 13:55:59 -07:00
Torne (Richard Coles)
278bbf1263 Don't concatenate the NOTICE file for a single module.
When the NOTICE file for a module changed, the new NOTICE was being
concatenated onto the end of the old one in non-clean builds, taking up
more and more space and presumably duplicating most of the content. Only
one set of rules for a given file can exist in make, so there cannot be
a case where more than one $(notice_file) was intentionally being
concatenated together as this would be an error.

Change-Id: I0f5fae498225eaee5cc75d854223b5ba790fcebe
2013-04-30 16:26:58 +01:00
Ying Wang
13d6950ef8 NOTICE file only module
To pick up a NOTICE file in LOCAL_PATH and attach it to
/system/lib/libfoo.so, use the following syntax:

include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := NOTICE_FILES
LOCAL_INSTALLED_MODULE := $(PRODUCT_OUT)/system/lib/libfoo.so
include $(BUILD_NOTICE_FILE)

Bug: 7460213
Change-Id: Ie692be72deab37be04d1b578578c131a0885a090
2012-11-01 17:29:10 -07:00
Torne (Richard Coles)
63afdc12d5 Use GYP instead of NONE as the module class for gyp.
The Chromium makefile generator used to use module class NONE for the
meta-targets in the gyp files; this was changed to GYP in order to make
it more obvious where they come from in the build. Update the build
system's handling of NOTICE files to reflect this change.

Change-Id: Iff7d4487f3024ec83db0c2a896ec0caf8fb18b24
2012-10-25 15:49:39 +01:00