Remove the no_framework_libs property
am: 5c2f963a1d
Change-Id: I34358a01f4efd560c9cbaee00a2ad08b3e8aff67
This commit is contained in:
@@ -516,10 +516,6 @@ func (a *AARImport) targetSdkVersion() string {
|
|||||||
return a.sdkVersion()
|
return a.sdkVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AARImport) noFrameworkLibs() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ AndroidLibraryDependency = (*AARImport)(nil)
|
var _ AndroidLibraryDependency = (*AARImport)(nil)
|
||||||
|
|
||||||
func (a *AARImport) ExportPackage() android.Path {
|
func (a *AARImport) ExportPackage() android.Path {
|
||||||
|
156
java/app_test.go
156
java/app_test.go
@@ -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) {
|
func TestJNIABI(t *testing.T) {
|
||||||
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
|
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
|
||||||
cc_library {
|
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) {
|
func TestJNIPackaging(t *testing.T) {
|
||||||
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
|
ctx := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
|
||||||
cc_library {
|
cc_library {
|
||||||
|
@@ -126,7 +126,7 @@ func TestHostForDevice(t *testing.T) {
|
|||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "device_module",
|
name: "device_module",
|
||||||
no_framework_libs: true,
|
sdk_version: "core_platform",
|
||||||
srcs: ["b.java"],
|
srcs: ["b.java"],
|
||||||
java_resources: ["java-res/b/b"],
|
java_resources: ["java-res/b/b"],
|
||||||
static_libs: ["host_for_device_module"],
|
static_libs: ["host_for_device_module"],
|
||||||
|
@@ -171,9 +171,6 @@ type JavadocProperties struct {
|
|||||||
// list of java libraries that will be in the classpath.
|
// list of java libraries that will be in the classpath.
|
||||||
Libs []string `android:"arch_variant"`
|
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.
|
// the java library (in classpath) for documentation that provides java srcs and srcjars.
|
||||||
Srcs_lib *string
|
Srcs_lib *string
|
||||||
|
|
||||||
@@ -534,10 +531,6 @@ func (j *Javadoc) targetSdkVersion() string {
|
|||||||
return j.sdkVersion()
|
return j.sdkVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *Javadoc) noFrameworkLibs() bool {
|
|
||||||
return Bool(j.properties.No_framework_libs)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
|
func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
sdkDep := decodeSdkDep(ctx, sdkContext(j))
|
sdkDep := decodeSdkDep(ctx, sdkContext(j))
|
||||||
|
@@ -82,9 +82,6 @@ type CompilerProperties struct {
|
|||||||
// list of files that should be excluded from java_resources and java_resource_dirs
|
// list of files that should be excluded from java_resources and java_resource_dirs
|
||||||
Exclude_java_resources []string `android:"path,arch_variant"`
|
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
|
// list of module-specific flags that will be used for javac compiles
|
||||||
Javacflags []string `android:"arch_variant"`
|
Javacflags []string `android:"arch_variant"`
|
||||||
|
|
||||||
@@ -482,10 +479,6 @@ func (j *Module) targetSdkVersion() string {
|
|||||||
return j.sdkVersion()
|
return j.sdkVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *Module) noFrameworkLibs() bool {
|
|
||||||
return Bool(j.properties.No_framework_libs)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (j *Module) deps(ctx android.BottomUpMutatorContext) {
|
func (j *Module) deps(ctx android.BottomUpMutatorContext) {
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
sdkDep := decodeSdkDep(ctx, sdkContext(j))
|
sdkDep := decodeSdkDep(ctx, sdkContext(j))
|
||||||
@@ -506,7 +499,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
|
|||||||
}
|
}
|
||||||
} else if j.deviceProperties.System_modules == nil {
|
} else if j.deviceProperties.System_modules == nil {
|
||||||
ctx.PropertyErrorf("sdk_version",
|
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" {
|
} else if *j.deviceProperties.System_modules != "none" {
|
||||||
ctx.AddVariationDependencies(nil, systemModulesTag, *j.deviceProperties.System_modules)
|
ctx.AddVariationDependencies(nil, systemModulesTag, *j.deviceProperties.System_modules)
|
||||||
}
|
}
|
||||||
|
13
java/sdk.go
13
java/sdk.go
@@ -44,9 +44,6 @@ type sdkContext interface {
|
|||||||
minSdkVersion() string
|
minSdkVersion() string
|
||||||
// targetSdkVersion returns the target_sdk_version property of the current module, or sdkVersion() if it is not set.
|
// targetSdkVersion returns the target_sdk_version property of the current module, or sdkVersion() if it is not set.
|
||||||
targetSdkVersion() string
|
targetSdkVersion() string
|
||||||
|
|
||||||
// Temporarily provide access to the no_frameworks_libs property (where present).
|
|
||||||
noFrameworkLibs() bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func sdkVersionOrDefault(ctx android.BaseModuleContext, v string) string {
|
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 {
|
func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
|
||||||
v := sdkContext.sdkVersion()
|
v := sdkContext.sdkVersion()
|
||||||
|
|
||||||
// For PDK builds, use the latest SDK version instead of "current"
|
// For PDK builds, use the latest SDK version instead of "current"
|
||||||
if ctx.Config().IsPdkBuild() && (v == "" || v == "current") {
|
if ctx.Config().IsPdkBuild() && (v == "" || v == "current") {
|
||||||
sdkVersions := ctx.Config().Get(sdkVersionsKey).([]int)
|
sdkVersions := ctx.Config().Get(sdkVersionsKey).([]int)
|
||||||
@@ -141,9 +139,6 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
|
|||||||
useFiles: true,
|
useFiles: true,
|
||||||
jars: android.Paths{jarPath.Path(), lambdaStubsPath},
|
jars: android.Paths{jarPath.Path(), lambdaStubsPath},
|
||||||
aidl: android.OptionalPathForPath(aidlPath.Path()),
|
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",
|
systemModules: m + "_system_modules",
|
||||||
frameworkResModule: r,
|
frameworkResModule: r,
|
||||||
aidl: android.OptionalPathForPath(aidl),
|
aidl: android.OptionalPathForPath(aidl),
|
||||||
|
|
||||||
// Pass value straight through for now to match previous behavior.
|
|
||||||
noFrameworksLibs: sdkContext.noFrameworkLibs(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if m == "core.current.stubs" {
|
if m == "core.current.stubs" {
|
||||||
@@ -192,9 +184,6 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
|
|||||||
return sdkDep{
|
return sdkDep{
|
||||||
useDefaultLibs: true,
|
useDefaultLibs: true,
|
||||||
frameworkResModule: "framework-res",
|
frameworkResModule: "framework-res",
|
||||||
|
|
||||||
// Pass value straight through for now to match previous behavior.
|
|
||||||
noFrameworksLibs: sdkContext.noFrameworkLibs(),
|
|
||||||
}
|
}
|
||||||
case "none":
|
case "none":
|
||||||
return sdkDep{
|
return sdkDep{
|
||||||
|
@@ -46,14 +46,6 @@ func TestClasspath(t *testing.T) {
|
|||||||
classpath: config.DefaultLibraries,
|
classpath: config.DefaultLibraries,
|
||||||
aidl: "-Iframework/aidl",
|
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"`,
|
name: `sdk_version:"core_platform"`,
|
||||||
properties: `sdk_version:"core_platform"`,
|
properties: `sdk_version:"core_platform"`,
|
||||||
|
Reference in New Issue
Block a user