From 65ee90a362234edc6b9dbe3d43eaa1f923aadc47 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Thu, 2 Sep 2021 15:33:10 -0700 Subject: [PATCH] Change default to require licenses property. Please do not roll back. If you have recently created a new Soong module type, please make sure it supports the `licenses` property. If your build on an older branch fails due to this change, please configure your build to set `ANDROID_REQUIRE_LICENSES=false` in the environment. If running from the command line, the following will work: export ANDROID_REQUIRE_LICENSES=false; m -j ... Previously defaulted to not require property unless overridden in env. Bug: 151177513 Test: m all Change-Id: Ib295658f978511d07197c295f04a6f25f7d83686 --- android/androidmk.go | 2 +- android/licenses.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/androidmk.go b/android/androidmk.go index 9853d2cbe..967c550d6 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -845,7 +845,7 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Mod case "*selinux.selinuxContextsModule": // license properties written case "*sysprop.syspropLibrary": // license properties written default: - if ctx.Config().IsEnvTrue("ANDROID_REQUIRE_LICENSES") { + if !ctx.Config().IsEnvFalse("ANDROID_REQUIRE_LICENSES") { return fmt.Errorf("custom make rules not allowed for %q (%q) module %q", ctx.ModuleType(mod), reflect.TypeOf(mod), ctx.ModuleName(mod)) } } diff --git a/android/licenses.go b/android/licenses.go index d54f8f4d0..7ee78c716 100644 --- a/android/licenses.go +++ b/android/licenses.go @@ -253,7 +253,7 @@ func getLicenses(ctx BaseModuleContext, module Module) []string { primaryProperty := module.base().primaryLicensesProperty if primaryProperty == nil { - if ctx.Config().IsEnvTrue("ANDROID_REQUIRE_LICENSES") { + if !ctx.Config().IsEnvFalse("ANDROID_REQUIRE_LICENSES") { ctx.ModuleErrorf("module type %q must have an applicable licenses property", ctx.OtherModuleType(module)) } return nil