Remove the no_framework_libs property am: 5c2f963a1d

am: 334a008188

Change-Id: I6b2d63eca5c78599115c6d9a431f22e99fe7709c
This commit is contained in:
Paul Duffin 2019-06-24 16:38:34 -07:00 committed by android-build-merger
commit b5be0c72ee
7 changed files with 3 additions and 196 deletions

View File

@ -516,10 +516,6 @@ func (a *AARImport) targetSdkVersion() string {
return a.sdkVersion()
}
func (a *AARImport) noFrameworkLibs() bool {
return false
}
var _ AndroidLibraryDependency = (*AARImport)(nil)
func (a *AARImport) ExportPackage() android.Path {

View File

@ -546,79 +546,6 @@ func TestAppSdkVersion(t *testing.T) {
}
}
func TestJNIABI_no_framework_libs_true(t *testing.T) {
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
cc_library {
name: "libjni",
system_shared_libs: [],
stl: "none",
}
android_test {
name: "test",
no_framework_libs: true,
jni_libs: ["libjni"],
}
android_test {
name: "test_first",
no_framework_libs: true,
compile_multilib: "first",
jni_libs: ["libjni"],
}
android_test {
name: "test_both",
no_framework_libs: true,
compile_multilib: "both",
jni_libs: ["libjni"],
}
android_test {
name: "test_32",
no_framework_libs: true,
compile_multilib: "32",
jni_libs: ["libjni"],
}
android_test {
name: "test_64",
no_framework_libs: true,
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 TestJNIABI(t *testing.T) {
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
cc_library {
@ -692,89 +619,6 @@ func TestJNIABI(t *testing.T) {
}
}
func TestJNIPackaging_no_framework_libs_true(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",
no_framework_libs: true,
jni_libs: ["libjni"],
}
android_test {
name: "test_noembed",
no_framework_libs: true,
jni_libs: ["libjni"],
use_embedded_native_libs: false,
}
android_test_helper_app {
name: "test_helper",
no_framework_libs: true,
jni_libs: ["libjni"],
}
android_test_helper_app {
name: "test_helper_noembed",
no_framework_libs: true,
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 TestJNIPackaging(t *testing.T) {
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
cc_library {

View File

@ -126,7 +126,7 @@ func TestHostForDevice(t *testing.T) {
java_library {
name: "device_module",
no_framework_libs: true,
sdk_version: "core_platform",
srcs: ["b.java"],
java_resources: ["java-res/b/b"],
static_libs: ["host_for_device_module"],

View File

@ -171,9 +171,6 @@ type JavadocProperties struct {
// list of java libraries that will be in the classpath.
Libs []string `android:"arch_variant"`
// don't build against the framework libraries (ext, and framework for device targets)
No_framework_libs *bool
// the java library (in classpath) for documentation that provides java srcs and srcjars.
Srcs_lib *string
@ -534,10 +531,6 @@ func (j *Javadoc) targetSdkVersion() string {
return j.sdkVersion()
}
func (j *Javadoc) noFrameworkLibs() bool {
return Bool(j.properties.No_framework_libs)
}
func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
if ctx.Device() {
sdkDep := decodeSdkDep(ctx, sdkContext(j))

View File

@ -82,9 +82,6 @@ type CompilerProperties struct {
// 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 framework libraries (ext, and framework for device targets)
No_framework_libs *bool
// list of module-specific flags that will be used for javac compiles
Javacflags []string `android:"arch_variant"`
@ -482,10 +479,6 @@ func (j *Module) targetSdkVersion() string {
return j.sdkVersion()
}
func (j *Module) noFrameworkLibs() bool {
return Bool(j.properties.No_framework_libs)
}
func (j *Module) deps(ctx android.BottomUpMutatorContext) {
if ctx.Device() {
sdkDep := decodeSdkDep(ctx, sdkContext(j))
@ -506,7 +499,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
}
} else if j.deviceProperties.System_modules == nil {
ctx.PropertyErrorf("sdk_version",
`system_modules is required to be set when sdk_version is "none", did you mean no_framework_libs?`)
`system_modules is required to be set when sdk_version is "none", did you mean "core_platform"`)
} else if *j.deviceProperties.System_modules != "none" {
ctx.AddVariationDependencies(nil, systemModulesTag, *j.deviceProperties.System_modules)
}

View File

@ -44,9 +44,6 @@ type sdkContext interface {
minSdkVersion() string
// 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_frameworks_libs property (where present).
noFrameworkLibs() bool
}
func sdkVersionOrDefault(ctx android.BaseModuleContext, v string) string {
@ -84,6 +81,7 @@ func sdkVersionToNumberAsString(ctx android.BaseModuleContext, v string) (string
func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
v := sdkContext.sdkVersion()
// For PDK builds, use the latest SDK version instead of "current"
if ctx.Config().IsPdkBuild() && (v == "" || v == "current") {
sdkVersions := ctx.Config().Get(sdkVersionsKey).([]int)
@ -141,9 +139,6 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
useFiles: true,
jars: android.Paths{jarPath.Path(), lambdaStubsPath},
aidl: android.OptionalPathForPath(aidlPath.Path()),
// Pass value straight through for now to match previous behavior.
noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
}
@ -154,9 +149,6 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
systemModules: m + "_system_modules",
frameworkResModule: r,
aidl: android.OptionalPathForPath(aidl),
// Pass value straight through for now to match previous behavior.
noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
if m == "core.current.stubs" {
@ -192,9 +184,6 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
return sdkDep{
useDefaultLibs: true,
frameworkResModule: "framework-res",
// Pass value straight through for now to match previous behavior.
noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
case "none":
return sdkDep{

View File

@ -46,14 +46,6 @@ func TestClasspath(t *testing.T) {
classpath: config.DefaultLibraries,
aidl: "-Iframework/aidl",
},
{
name: "no_framework_libs:true",
properties: `no_framework_libs:true`,
bootclasspath: config.DefaultBootclasspathLibraries,
system: config.DefaultSystemModules,
classpath: []string{},
aidl: "",
},
{
name: `sdk_version:"core_platform"`,
properties: `sdk_version:"core_platform"`,