Merge "Soong: Fix the package name in metrics.proto file"
diff --git a/android/neverallow.go b/android/neverallow.go
index f751389..f35d1fe 100644
--- a/android/neverallow.go
+++ b/android/neverallow.go
@@ -52,7 +52,6 @@
rules = append(rules, createTrebleRules()...)
rules = append(rules, createLibcoreRules()...)
rules = append(rules, createJavaDeviceForHostRules()...)
- rules = append(rules, createJavaLibraryHostRules()...)
return rules
}
@@ -101,15 +100,11 @@
"development",
}
- // Core library constraints. The no_standard_libs can only be used in core
- // library projects. Access to core library targets is restricted using
- // visibility rules.
+ // Core library constraints. The sdk_version: "none" can only be used in core library projects.
+ // Access to core library targets is restricted using visibility rules.
rules := []*rule{
neverallow().
notIn(coreLibraryProjects...).
- with("no_standard_libs", "true"),
- neverallow().
- notIn(coreLibraryProjects...).
with("sdk_version", "none"),
}
@@ -131,15 +126,6 @@
}
}
-func createJavaLibraryHostRules() []*rule {
- return []*rule{
- neverallow().
- moduleType("java_library_host").
- with("no_standard_libs", "true").
- because("no_standard_libs makes no sense with java_library_host"),
- }
-}
-
func neverallowMutator(ctx BottomUpMutatorContext) {
m, ok := ctx.Module().(Module)
if !ok {
diff --git a/android/neverallow_test.go b/android/neverallow_test.go
index 62c5142..ee3c94f 100644
--- a/android/neverallow_test.go
+++ b/android/neverallow_test.go
@@ -148,37 +148,6 @@
},
// Libcore rule tests
{
- name: "no_standard_libs: true inside core libraries",
- fs: map[string][]byte{
- "libcore/Blueprints": []byte(`
- java_library {
- name: "inside_core_libraries",
- no_standard_libs: true,
- }`),
- },
- },
- {
- name: "no_standard_libs: true outside core libraries",
- fs: map[string][]byte{
- "Blueprints": []byte(`
- java_library {
- name: "outside_core_libraries",
- no_standard_libs: true,
- }`),
- },
- expectedError: "module \"outside_core_libraries\": violates neverallow",
- },
- {
- name: "no_standard_libs: false",
- fs: map[string][]byte{
- "Blueprints": []byte(`
- java_library {
- name: "outside_core_libraries",
- no_standard_libs: false,
- }`),
- },
- },
- {
name: "sdk_version: \"none\" inside core libraries",
fs: map[string][]byte{
"libcore/Blueprints": []byte(`
@@ -209,18 +178,6 @@
}`),
},
},
- // java_library_host rule tests
- {
- name: "java_library_host with no_standard_libs: true",
- fs: map[string][]byte{
- "libcore/Blueprints": []byte(`
- java_library_host {
- name: "inside_core_libraries",
- no_standard_libs: true,
- }`),
- },
- expectedError: "module \"inside_core_libraries\": violates neverallow",
- },
}
func TestNeverallow(t *testing.T) {
@@ -295,9 +252,8 @@
}
type mockJavaLibraryProperties struct {
- Libs []string
- No_standard_libs *bool
- Sdk_version *string
+ Libs []string
+ Sdk_version *string
}
type mockJavaLibraryModule struct {
diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go
index 62aa3dc..af81e43 100644
--- a/androidmk/cmd/androidmk/android.go
+++ b/androidmk/cmd/androidmk/android.go
@@ -185,7 +185,6 @@
"LOCAL_NO_CRT": "nocrt",
"LOCAL_ALLOW_UNDEFINED_SYMBOLS": "allow_undefined_symbols",
"LOCAL_RTTI_FLAG": "rtti",
- "LOCAL_NO_STANDARD_LIBRARIES": "no_standard_libs",
"LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations",
"LOCAL_TIDY": "tidy",
"LOCAL_USE_CLANG_LLD": "use_clang_lld",
diff --git a/cc/config/global.go b/cc/config/global.go
index 24075d9..a27246e 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -122,8 +122,8 @@
// prebuilts/clang default settings.
ClangDefaultBase = "prebuilts/clang/host"
- ClangDefaultVersion = "clang-r353983c"
- ClangDefaultShortVersion = "9.0.3"
+ ClangDefaultVersion = "clang-r353983d"
+ ClangDefaultShortVersion = "9.0.4"
// Directories with warnings from Android.bp files.
WarningAllowedProjects = []string{
diff --git a/cc/gen.go b/cc/gen.go
index 82669ac..1d30dab 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -39,11 +39,11 @@
sysprop = pctx.AndroidStaticRule("sysprop",
blueprint.RuleParams{
- Command: "$syspropCmd --header-dir=$headerOutDir --system-header-dir=$systemOutDir " +
+ Command: "$syspropCmd --header-dir=$headerOutDir --public-header-dir=$publicOutDir " +
"--source-dir=$srcOutDir --include-name=$includeName $in",
CommandDeps: []string{"$syspropCmd"},
},
- "headerOutDir", "systemOutDir", "srcOutDir", "includeName")
+ "headerOutDir", "publicOutDir", "srcOutDir", "includeName")
windmc = pctx.AndroidStaticRule("windmc",
blueprint.RuleParams{
@@ -150,7 +150,7 @@
func genSysprop(ctx android.ModuleContext, syspropFile android.Path) (android.Path, android.Path) {
headerFile := android.PathForModuleGen(ctx, "sysprop", "include", syspropFile.Rel()+".h")
- systemHeaderFile := android.PathForModuleGen(ctx, "sysprop/system", "include", syspropFile.Rel()+".h")
+ publicHeaderFile := android.PathForModuleGen(ctx, "sysprop/public", "include", syspropFile.Rel()+".h")
cppFile := android.PathForModuleGen(ctx, "sysprop", syspropFile.Rel()+".cpp")
ctx.Build(pctx, android.BuildParams{
@@ -161,7 +161,7 @@
Input: syspropFile,
Args: map[string]string{
"headerOutDir": filepath.Dir(headerFile.String()),
- "systemOutDir": filepath.Dir(systemHeaderFile.String()),
+ "publicOutDir": filepath.Dir(publicHeaderFile.String()),
"srcOutDir": filepath.Dir(cppFile.String()),
"includeName": syspropFile.Rel() + ".h",
},
diff --git a/cc/library.go b/cc/library.go
index fab5837..f98cd36 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -882,10 +882,10 @@
isVendor := ctx.useVndk()
isOwnerPlatform := Bool(library.Properties.Sysprop.Platform)
- useSystem := isProduct || (isOwnerPlatform == isVendor)
+ usePublic := isProduct || (isOwnerPlatform == isVendor)
- if useSystem {
- dir = android.PathForModuleGen(ctx, "sysprop/system", "include").String()
+ if usePublic {
+ dir = android.PathForModuleGen(ctx, "sysprop/public", "include").String()
}
}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index fdda7be..0af0659 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -40,7 +40,8 @@
hwasanCflags = []string{"-fno-omit-frame-pointer", "-Wno-frame-larger-than=",
"-mllvm", "-hwasan-create-frame-descriptions=0",
"-mllvm", "-hwasan-allow-ifunc",
- "-fsanitize-hwaddress-abi=platform"}
+ "-fsanitize-hwaddress-abi=platform",
+ "-fno-experimental-new-pass-manager"}
cfiCflags = []string{"-flto", "-fsanitize-cfi-cross-dso",
"-fsanitize-blacklist=external/compiler-rt/lib/cfi/cfi_blacklist.txt"}
diff --git a/cc/test.go b/cc/test.go
index dae2a37..c735fd9 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -64,6 +64,10 @@
// Test options.
Test_options TestOptions
+
+ // Add RootTargetPreparer to auto generated test config. This guarantees the test to run
+ // with root permission.
+ Require_root *bool
}
func init() {
@@ -273,18 +277,19 @@
func (test *testBinary) install(ctx ModuleContext, file android.Path) {
test.data = android.PathsForModuleSrc(ctx, test.Properties.Data)
- optionsMap := map[string]string{}
- if Bool(test.testDecorator.Properties.Isolated) {
- optionsMap["not-shardable"] = "true"
+ var configs []tradefed.Config
+ if Bool(test.Properties.Require_root) {
+ configs = append(configs, tradefed.Preparer{"com.android.tradefed.targetprep.RootTargetPreparer"})
}
-
+ if Bool(test.testDecorator.Properties.Isolated) {
+ configs = append(configs, tradefed.Option{"not-shardable", "true"})
+ }
if test.Properties.Test_options.Run_test_as != nil {
- optionsMap["run-test-as"] = String(test.Properties.Test_options.Run_test_as)
+ configs = append(configs, tradefed.Option{"run-test-as", String(test.Properties.Test_options.Run_test_as)})
}
test.testConfig = tradefed.AutoGenNativeTestConfig(ctx, test.Properties.Test_config,
- test.Properties.Test_config_template,
- test.Properties.Test_suites, optionsMap)
+ test.Properties.Test_config_template, test.Properties.Test_suites, configs)
test.binaryDecorator.baseInstaller.dir = "nativetest"
test.binaryDecorator.baseInstaller.dir64 = "nativetest64"
@@ -371,6 +376,10 @@
// the name of the test configuration template (for example "AndroidTestTemplate.xml") that
// should be installed with the module.
Test_config_template *string `android:"path,arch_variant"`
+
+ // Add RootTargetPreparer to auto generated test config. This guarantees the test to run
+ // with root permission.
+ Require_root *bool
}
type benchmarkDecorator struct {
@@ -403,8 +412,12 @@
func (benchmark *benchmarkDecorator) install(ctx ModuleContext, file android.Path) {
benchmark.data = android.PathsForModuleSrc(ctx, benchmark.Properties.Data)
+ var configs []tradefed.Config
+ if Bool(benchmark.Properties.Require_root) {
+ configs = append(configs, tradefed.Preparer{"com.android.tradefed.targetprep.RootTargetPreparer"})
+ }
benchmark.testConfig = tradefed.AutoGenNativeBenchmarkTestConfig(ctx, benchmark.Properties.Test_config,
- benchmark.Properties.Test_config_template, benchmark.Properties.Test_suites)
+ benchmark.Properties.Test_config_template, benchmark.Properties.Test_suites, configs)
benchmark.binaryDecorator.baseInstaller.dir = filepath.Join("benchmarktest", ctx.ModuleName())
benchmark.binaryDecorator.baseInstaller.dir64 = filepath.Join("benchmarktest64", ctx.ModuleName())
diff --git a/java/aar.go b/java/aar.go
index adea87f..47f6e5f 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -517,10 +517,6 @@
return false
}
-func (a *AARImport) noStandardLibs() bool {
- return false
-}
-
var _ AndroidLibraryDependency = (*AARImport)(nil)
func (a *AARImport) ExportPackage() android.Path {
diff --git a/java/app_test.go b/java/app_test.go
index bb39c16..27802cd 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -546,7 +546,7 @@
}
}
-func TestJNIABI(t *testing.T) {
+func TestJNIABI_no_framework_libs_true(t *testing.T) {
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
cc_library {
name: "libjni",
@@ -619,7 +619,80 @@
}
}
-func TestJNIPackaging(t *testing.T) {
+func TestJNIABI(t *testing.T) {
+ ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
+ cc_library {
+ name: "libjni",
+ system_shared_libs: [],
+ stl: "none",
+ }
+
+ android_test {
+ name: "test",
+ sdk_version: "core_platform",
+ jni_libs: ["libjni"],
+ }
+
+ android_test {
+ name: "test_first",
+ sdk_version: "core_platform",
+ compile_multilib: "first",
+ jni_libs: ["libjni"],
+ }
+
+ android_test {
+ name: "test_both",
+ sdk_version: "core_platform",
+ compile_multilib: "both",
+ jni_libs: ["libjni"],
+ }
+
+ android_test {
+ name: "test_32",
+ sdk_version: "core_platform",
+ compile_multilib: "32",
+ jni_libs: ["libjni"],
+ }
+
+ android_test {
+ name: "test_64",
+ sdk_version: "core_platform",
+ compile_multilib: "64",
+ jni_libs: ["libjni"],
+ }
+ `)
+
+ testCases := []struct {
+ name string
+ abis []string
+ }{
+ {"test", []string{"arm64-v8a"}},
+ {"test_first", []string{"arm64-v8a"}},
+ {"test_both", []string{"arm64-v8a", "armeabi-v7a"}},
+ {"test_32", []string{"armeabi-v7a"}},
+ {"test_64", []string{"arm64-v8a"}},
+ }
+
+ for _, test := range testCases {
+ t.Run(test.name, func(t *testing.T) {
+ app := ctx.ModuleForTests(test.name, "android_common")
+ jniLibZip := app.Output("jnilibs.zip")
+ var abis []string
+ args := strings.Fields(jniLibZip.Args["jarArgs"])
+ for i := 0; i < len(args); i++ {
+ if args[i] == "-P" {
+ abis = append(abis, filepath.Base(args[i+1]))
+ i++
+ }
+ }
+ if !reflect.DeepEqual(abis, test.abis) {
+ t.Errorf("want abis %v, got %v", test.abis, abis)
+ }
+ })
+ }
+}
+
+func TestJNIPackaging_no_framework_libs_true(t *testing.T) {
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
cc_library {
name: "libjni",
@@ -700,7 +773,89 @@
}
})
}
+}
+func TestJNIPackaging(t *testing.T) {
+ ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
+ cc_library {
+ name: "libjni",
+ system_shared_libs: [],
+ stl: "none",
+ }
+
+ android_app {
+ name: "app",
+ jni_libs: ["libjni"],
+ }
+
+ android_app {
+ name: "app_noembed",
+ jni_libs: ["libjni"],
+ use_embedded_native_libs: false,
+ }
+
+ android_app {
+ name: "app_embed",
+ jni_libs: ["libjni"],
+ use_embedded_native_libs: true,
+ }
+
+ android_test {
+ name: "test",
+ sdk_version: "core_platform",
+ jni_libs: ["libjni"],
+ }
+
+ android_test {
+ name: "test_noembed",
+ sdk_version: "core_platform",
+ jni_libs: ["libjni"],
+ use_embedded_native_libs: false,
+ }
+
+ android_test_helper_app {
+ name: "test_helper",
+ sdk_version: "core_platform",
+ jni_libs: ["libjni"],
+ }
+
+ android_test_helper_app {
+ name: "test_helper_noembed",
+ sdk_version: "core_platform",
+ jni_libs: ["libjni"],
+ use_embedded_native_libs: false,
+ }
+ `)
+
+ testCases := []struct {
+ name string
+ packaged bool
+ compressed bool
+ }{
+ {"app", false, false},
+ {"app_noembed", false, false},
+ {"app_embed", true, false},
+ {"test", true, false},
+ {"test_noembed", true, true},
+ {"test_helper", true, false},
+ {"test_helper_noembed", true, true},
+ }
+
+ for _, test := range testCases {
+ t.Run(test.name, func(t *testing.T) {
+ app := ctx.ModuleForTests(test.name, "android_common")
+ jniLibZip := app.MaybeOutput("jnilibs.zip")
+ if g, w := (jniLibZip.Rule != nil), test.packaged; g != w {
+ t.Errorf("expected jni packaged %v, got %v", w, g)
+ }
+
+ if jniLibZip.Rule != nil {
+ if g, w := !strings.Contains(jniLibZip.Args["jarArgs"], "-L 0"), test.compressed; g != w {
+ t.Errorf("expected jni compressed %v, got %v", w, g)
+ }
+ }
+ })
+ }
}
func TestCertificates(t *testing.T) {
diff --git a/java/droiddoc.go b/java/droiddoc.go
index e1476a2..a8cf1c0 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -171,10 +171,6 @@
// list of java libraries that will be in the classpath.
Libs []string `android:"arch_variant"`
- // don't build against the default libraries (bootclasspath, ext, and framework for device
- // targets)
- No_standard_libs *bool
-
// don't build against the framework libraries (ext, and framework for device targets)
No_framework_libs *bool
@@ -542,10 +538,6 @@
return Bool(j.properties.No_framework_libs)
}
-func (j *Javadoc) noStandardLibs() bool {
- return Bool(j.properties.No_standard_libs)
-}
-
func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
if ctx.Device() {
sdkDep := decodeSdkDep(ctx, sdkContext(j))
diff --git a/java/java.go b/java/java.go
index c42ca28..4b38451 100644
--- a/java/java.go
+++ b/java/java.go
@@ -82,10 +82,6 @@
// list of files that should be excluded from java_resources and java_resource_dirs
Exclude_java_resources []string `android:"path,arch_variant"`
- // don't build against the default libraries (bootclasspath, ext, and framework for device
- // targets)
- No_standard_libs *bool
-
// don't build against the framework libraries (ext, and framework for device targets)
No_framework_libs *bool
@@ -490,10 +486,6 @@
return Bool(j.properties.No_framework_libs)
}
-func (j *Module) noStandardLibs() bool {
- return Bool(j.properties.No_standard_libs)
-}
-
func (j *Module) deps(ctx android.BottomUpMutatorContext) {
if ctx.Device() {
sdkDep := decodeSdkDep(ctx, sdkContext(j))
@@ -513,8 +505,8 @@
}
}
} else if j.deviceProperties.System_modules == nil {
- ctx.PropertyErrorf("no_standard_libs",
- "system_modules is required to be set when no_standard_libs is true, did you mean no_framework_libs?")
+ ctx.PropertyErrorf("sdk_version",
+ `system_modules is required to be set when sdk_version is "none", did you mean no_framework_libs?`)
} else if *j.deviceProperties.System_modules != "none" {
ctx.AddVariationDependencies(nil, systemModulesTag, *j.deviceProperties.System_modules)
}
@@ -682,7 +674,7 @@
return javaSdk, true
case ver == "current":
return javaSdk, false
- case ver == "" || ver == "none":
+ case ver == "" || ver == "none" || ver == "core_platform":
return javaPlatform, false
default:
if _, err := strconv.Atoi(ver); err != nil {
@@ -860,7 +852,8 @@
var ret string
v := sdkContext.sdkVersion()
// For PDK builds, use the latest SDK version instead of "current"
- if ctx.Config().IsPdkBuild() && (v == "" || v == "none" || v == "current") {
+ if ctx.Config().IsPdkBuild() &&
+ (v == "" || v == "none" || v == "core_platform" || v == "current") {
sdkVersions := ctx.Config().Get(sdkVersionsKey).([]int)
latestSdkVersion := 0
if len(sdkVersions) > 0 {
@@ -879,7 +872,11 @@
ret = "1.7"
} else if ctx.Device() && sdk <= 29 || !ctx.Config().TargetOpenJDK9() {
ret = "1.8"
- } else if ctx.Device() && sdkContext.sdkVersion() != "" && sdkContext.sdkVersion() != "none" && sdk == android.FutureApiLevel {
+ } else if ctx.Device() &&
+ sdkContext.sdkVersion() != "" &&
+ sdkContext.sdkVersion() != "none" &&
+ sdkContext.sdkVersion() != "core_platform" &&
+ sdk == android.FutureApiLevel {
// TODO(ccross): once we generate stubs we should be able to use 1.9 for sdk_version: "current"
ret = "1.8"
} else {
diff --git a/java/java_test.go b/java/java_test.go
index cecc8da..22dec07 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1013,7 +1013,7 @@
java_library {
name: "bar",
srcs: ["b.java"],
- no_standard_libs: true,
+ sdk_version: "none",
system_modules: "none",
patch_module: "java.base",
}
diff --git a/java/sdk.go b/java/sdk.go
index 9dfb38b..6ffe399 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -45,16 +45,13 @@
// targetSdkVersion returns the target_sdk_version property of the current module, or sdkVersion() if it is not set.
targetSdkVersion() string
- // Temporarily provide access to the no_standard_libs property (where present).
- noStandardLibs() bool
-
// Temporarily provide access to the no_frameworks_libs property (where present).
noFrameworkLibs() bool
}
func sdkVersionOrDefault(ctx android.BaseModuleContext, v string) string {
switch v {
- case "", "none", "current", "system_current", "test_current", "core_current":
+ case "", "none", "current", "test_current", "system_current", "core_current", "core_platform":
return ctx.Config().DefaultAppTargetSdk()
default:
return v
@@ -65,7 +62,7 @@
// it returns android.FutureApiLevel (10000).
func sdkVersionToNumber(ctx android.BaseModuleContext, v string) (int, error) {
switch v {
- case "", "none", "current", "test_current", "system_current", "core_current":
+ case "", "none", "current", "test_current", "system_current", "core_current", "core_platform":
return ctx.Config().DefaultAppTargetSdkInt(), nil
default:
n := android.GetNumericSdkVersion(v)
@@ -145,8 +142,7 @@
jars: android.Paths{jarPath.Path(), lambdaStubsPath},
aidl: android.OptionalPathForPath(aidlPath.Path()),
- // Pass values straight through for now to match previous behavior.
- noStandardLibs: sdkContext.noStandardLibs(),
+ // Pass value straight through for now to match previous behavior.
noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
}
@@ -159,8 +155,7 @@
frameworkResModule: r,
aidl: android.OptionalPathForPath(aidl),
- // Pass values straight through for now to match previous behavior.
- noStandardLibs: sdkContext.noStandardLibs(),
+ // Pass value straight through for now to match previous behavior.
noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
@@ -187,7 +182,8 @@
}
}
- if ctx.Config().UnbundledBuildUsePrebuiltSdks() && v != "" && v != "none" {
+ if ctx.Config().UnbundledBuildUsePrebuiltSdks() &&
+ v != "" && v != "none" && v != "core_platform" {
return toPrebuilt(v)
}
@@ -197,14 +193,19 @@
useDefaultLibs: true,
frameworkResModule: "framework-res",
- // Pass values straight through for now to match previous behavior.
- noStandardLibs: sdkContext.noStandardLibs(),
+ // Pass value straight through for now to match previous behavior.
noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
case "none":
return sdkDep{
noStandardLibs: true,
}
+ case "core_platform":
+ return sdkDep{
+ useDefaultLibs: true,
+ frameworkResModule: "framework-res",
+ noFrameworksLibs: true,
+ }
case "current":
return toModule("android_stubs_current", "framework-res", sdkFrameworkAidlPath(ctx))
case "system_current":
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 01531c5..b4a3f29 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -385,7 +385,6 @@
Device_specific *bool
Product_specific *bool
Compile_dex *bool
- No_standard_libs *bool
System_modules *string
Java_version *string
Product_variables struct {
diff --git a/java/sdk_test.go b/java/sdk_test.go
index 1efe83b..915333e 100644
--- a/java/sdk_test.go
+++ b/java/sdk_test.go
@@ -55,6 +55,14 @@
aidl: "",
},
{
+ name: `sdk_version:"core_platform"`,
+ properties: `sdk_version:"core_platform"`,
+ bootclasspath: config.DefaultBootclasspathLibraries,
+ system: config.DefaultSystemModules,
+ classpath: []string{},
+ aidl: "",
+ },
+ {
name: "blank sdk version",
properties: `sdk_version: "",`,
bootclasspath: config.DefaultBootclasspathLibraries,
@@ -113,14 +121,6 @@
},
{
- name: "nostdlib - no_standard_libs: true",
- properties: `no_standard_libs: true, system_modules: "none"`,
- system: "none",
- bootclasspath: []string{`""`},
- classpath: []string{},
- },
- {
-
name: "nostdlib",
properties: `sdk_version: "none", system_modules: "none"`,
system: "none",
@@ -129,14 +129,6 @@
},
{
- name: "nostdlib system_modules - no_standard_libs: true",
- properties: `no_standard_libs: true, system_modules: "core-platform-api-stubs-system-modules"`,
- system: "core-platform-api-stubs-system-modules",
- bootclasspath: []string{`""`},
- classpath: []string{},
- },
- {
-
name: "nostdlib system_modules",
properties: `sdk_version: "none", system_modules: "core-platform-api-stubs-system-modules"`,
system: "core-platform-api-stubs-system-modules",
@@ -161,12 +153,6 @@
bootclasspath: []string{"jdk8/jre/lib/jce.jar", "jdk8/jre/lib/rt.jar"},
},
{
- name: "host supported nostdlib - no_standard_libs: true",
- host: android.Host,
- properties: `host_supported: true, no_standard_libs: true, system_modules: "none"`,
- classpath: []string{},
- },
- {
name: "host supported nostdlib",
host: android.Host,
properties: `host_supported: true, sdk_version: "none", system_modules: "none"`,
diff --git a/java/system_modules.go b/java/system_modules.go
index 2ec3dfb..5a86f3c 100644
--- a/java/system_modules.go
+++ b/java/system_modules.go
@@ -107,12 +107,6 @@
type SystemModulesProperties struct {
// List of java library modules that should be included in the system modules
Libs []string
-
- // List of prebuilt jars that should be included in the system modules
- Jars []string
-
- // Sdk version that should be included in the system modules
- Sdk_version *string
}
func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleContext) {
@@ -123,8 +117,6 @@
jars = append(jars, dep.HeaderJars()...)
})
- jars = append(jars, android.PathsForModuleSrc(ctx, system.properties.Jars)...)
-
system.outputFile = TransformJarsToSystemModules(ctx, "java.base", jars)
}
diff --git a/java/testing.go b/java/testing.go
index 7cd1871..5d116a7 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -64,7 +64,7 @@
java_library {
name: "framework",
srcs: ["a.java"],
- no_standard_libs: true,
+ sdk_version: "none",
system_modules: "core-platform-api-stubs-system-modules",
aidl: {
export_include_dirs: ["framework/aidl"],
@@ -73,13 +73,13 @@
android_app {
name: "framework-res",
- no_framework_libs: true,
+ sdk_version: "core_platform",
}
java_library {
name: "android.hidl.base-V1.0-java",
srcs: ["a.java"],
- no_standard_libs: true,
+ sdk_version: "none",
system_modules: "core-platform-api-stubs-system-modules",
installable: true,
}
@@ -87,7 +87,7 @@
java_library {
name: "android.hidl.manager-V1.0-java",
srcs: ["a.java"],
- no_standard_libs: true,
+ sdk_version: "none",
system_modules: "core-platform-api-stubs-system-modules",
installable: true,
}
@@ -95,7 +95,7 @@
java_library {
name: "org.apache.http.legacy",
srcs: ["a.java"],
- no_standard_libs: true,
+ sdk_version: "none",
system_modules: "core-platform-api-stubs-system-modules",
installable: true,
}
diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go
index b470ba5..0566036 100644
--- a/sysprop/sysprop_test.go
+++ b/sysprop/sysprop_test.go
@@ -313,13 +313,13 @@
vendorVariant := "android_arm64_armv8-a_vendor_static"
platformInternalPath := "libsysprop-platform/android_arm64_armv8-a_core_static/gen/sysprop/include"
- platformSystemCorePath := "libsysprop-platform/android_arm64_armv8-a_core_static/gen/sysprop/system/include"
- platformSystemVendorPath := "libsysprop-platform/android_arm64_armv8-a_vendor_static/gen/sysprop/system/include"
+ platformPublicCorePath := "libsysprop-platform/android_arm64_armv8-a_core_static/gen/sysprop/public/include"
+ platformPublicVendorPath := "libsysprop-platform/android_arm64_armv8-a_vendor_static/gen/sysprop/public/include"
- platformOnProductPath := "libsysprop-platform-on-product/android_arm64_armv8-a_core_static/gen/sysprop/system/include"
+ platformOnProductPath := "libsysprop-platform-on-product/android_arm64_armv8-a_core_static/gen/sysprop/public/include"
vendorInternalPath := "libsysprop-vendor/android_arm64_armv8-a_vendor_static/gen/sysprop/include"
- vendorSystemPath := "libsysprop-vendor/android_arm64_armv8-a_core_static/gen/sysprop/system/include"
+ vendorPublicPath := "libsysprop-vendor/android_arm64_armv8-a_core_static/gen/sysprop/public/include"
platformClient := ctx.ModuleForTests("cc-client-platform", coreVariant)
platformFlags := platformClient.Rule("cc").Args["cFlags"]
@@ -342,20 +342,20 @@
productClient := ctx.ModuleForTests("cc-client-product", coreVariant)
productFlags := productClient.Rule("cc").Args["cFlags"]
- // Product should use platform's and vendor's system headers
+ // Product should use platform's and vendor's public headers
if !strings.Contains(productFlags, platformOnProductPath) ||
- !strings.Contains(productFlags, vendorSystemPath) {
+ !strings.Contains(productFlags, vendorPublicPath) {
t.Errorf("flags for product must contain %#v and %#v, but was %#v.",
- platformSystemCorePath, vendorSystemPath, productFlags)
+ platformPublicCorePath, vendorPublicPath, productFlags)
}
vendorClient := ctx.ModuleForTests("cc-client-vendor", vendorVariant)
vendorFlags := vendorClient.Rule("cc").Args["cFlags"]
- // Vendor should use platform's system header and vendor's internal header
- if !strings.Contains(vendorFlags, platformSystemVendorPath) ||
+ // Vendor should use platform's public header and vendor's internal header
+ if !strings.Contains(vendorFlags, platformPublicVendorPath) ||
!strings.Contains(vendorFlags, vendorInternalPath) {
t.Errorf("flags for vendor must contain %#v and %#v, but was %#v.",
- platformSystemVendorPath, vendorInternalPath, vendorFlags)
+ platformPublicVendorPath, vendorInternalPath, vendorFlags)
}
}
diff --git a/tradefed/autogen.go b/tradefed/autogen.go
index da5dabe..952b022 100644
--- a/tradefed/autogen.go
+++ b/tradefed/autogen.go
@@ -16,7 +16,6 @@
import (
"fmt"
- "sort"
"strings"
"github.com/google/blueprint"
@@ -39,9 +38,9 @@
}
var autogenTestConfig = pctx.StaticRule("autogenTestConfig", blueprint.RuleParams{
- Command: "sed 's&{MODULE}&${name}&g;s&{EXTRA_OPTIONS}&'${extraOptions}'&g' $template > $out",
+ Command: "sed 's&{MODULE}&${name}&g;s&{EXTRA_CONFIGS}&'${extraConfigs}'&g' $template > $out",
CommandDeps: []string{"$template"},
-}, "name", "template", "extraOptions")
+}, "name", "template", "extraConfigs")
func testConfigPath(ctx android.ModuleContext, prop *string, testSuites []string) (path android.Path, autogenPath android.WritablePath) {
if p := getTestConfig(ctx, prop); p != nil {
@@ -57,17 +56,38 @@
}
}
-func autogenTemplate(ctx android.ModuleContext, output android.WritablePath, template string, optionsMap map[string]string) {
- // If no test option found, delete {EXTRA_OPTIONS} line.
- var options []string
- for optionName, value := range optionsMap {
- if value != "" {
- options = append(options, fmt.Sprintf(`<option name="%s" value="%s" />`, optionName, value))
- }
+type Config interface {
+ Config() string
+}
+
+type Option struct {
+ Name string
+ Value string
+}
+
+var _ Config = Option{}
+
+func (o Option) Config() string {
+ return fmt.Sprintf(`<option name="%s" value="%s" />`, o.Name, o.Value)
+}
+
+type Preparer struct {
+ Class string
+}
+
+var _ Config = Preparer{}
+
+func (p Preparer) Config() string {
+ return fmt.Sprintf(`<target_preparer class="%s" />`, p.Class)
+}
+
+func autogenTemplate(ctx android.ModuleContext, output android.WritablePath, template string, configs []Config) {
+ var configStrings []string
+ for _, config := range configs {
+ configStrings = append(configStrings, config.Config())
}
- sort.Strings(options)
- extraOptions := strings.Join(options, "\n ")
- extraOptions = proptools.NinjaAndShellEscape(extraOptions)
+ extraConfigs := strings.Join(configStrings, "\n ")
+ extraConfigs = proptools.NinjaAndShellEscape(extraConfigs)
ctx.Build(pctx, android.BuildParams{
Rule: autogenTestConfig,
@@ -76,26 +96,23 @@
Args: map[string]string{
"name": ctx.ModuleName(),
"template": template,
- "extraOptions": extraOptions,
+ "extraConfigs": extraConfigs,
},
})
}
func AutoGenNativeTestConfig(ctx android.ModuleContext, testConfigProp *string,
- testConfigTemplateProp *string, testSuites []string,
- optionsMap map[string]string) android.Path {
+ testConfigTemplateProp *string, testSuites []string, config []Config) android.Path {
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites)
if autogenPath != nil {
templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp)
if templatePath.Valid() {
- autogenTemplate(ctx, autogenPath, templatePath.String(), optionsMap)
+ autogenTemplate(ctx, autogenPath, templatePath.String(), config)
} else {
if ctx.Device() {
- autogenTemplate(ctx, autogenPath, "${NativeTestConfigTemplate}",
- optionsMap)
+ autogenTemplate(ctx, autogenPath, "${NativeTestConfigTemplate}", config)
} else {
- autogenTemplate(ctx, autogenPath, "${NativeHostTestConfigTemplate}",
- optionsMap)
+ autogenTemplate(ctx, autogenPath, "${NativeHostTestConfigTemplate}", config)
}
}
return autogenPath
@@ -104,14 +121,14 @@
}
func AutoGenNativeBenchmarkTestConfig(ctx android.ModuleContext, testConfigProp *string,
- testConfigTemplateProp *string, testSuites []string) android.Path {
+ testConfigTemplateProp *string, testSuites []string, configs []Config) android.Path {
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites)
if autogenPath != nil {
templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp)
if templatePath.Valid() {
- autogenTemplate(ctx, autogenPath, templatePath.String(), nil)
+ autogenTemplate(ctx, autogenPath, templatePath.String(), configs)
} else {
- autogenTemplate(ctx, autogenPath, "${NativeBenchmarkTestConfigTemplate}", nil)
+ autogenTemplate(ctx, autogenPath, "${NativeBenchmarkTestConfigTemplate}", configs)
}
return autogenPath
}
diff --git a/ui/build/paths/config.go b/ui/build/paths/config.go
index a50a880..c9946e2 100644
--- a/ui/build/paths/config.go
+++ b/ui/build/paths/config.go
@@ -103,7 +103,6 @@
"rsync": Allowed,
"sh": Allowed,
"tar": Allowed,
- "timeout": Allowed,
"tr": Allowed,
"unzip": Allowed,
"zip": Allowed,
@@ -166,6 +165,7 @@
"stat": LinuxOnlyPrebuilt,
"tail": LinuxOnlyPrebuilt,
"tee": LinuxOnlyPrebuilt,
+ "timeout": LinuxOnlyPrebuilt,
"touch": LinuxOnlyPrebuilt,
"true": LinuxOnlyPrebuilt,
"uname": LinuxOnlyPrebuilt,