Merge "add aidl.export_include_dirs to java_import module type" am: 5e9cf02ab5
Change-Id: I96d2bc0f28b1dcc01d29c096fa8ea773c9d2f63c
This commit is contained in:
11
java/java.go
11
java/java.go
@@ -2338,6 +2338,12 @@ type ImportProperties struct {
|
|||||||
|
|
||||||
// set the name of the output
|
// set the name of the output
|
||||||
Stem *string
|
Stem *string
|
||||||
|
|
||||||
|
Aidl struct {
|
||||||
|
// directories that should be added as include directories for any aidl sources of modules
|
||||||
|
// that depend on this module, as well as to aidl for this module.
|
||||||
|
Export_include_dirs []string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Import struct {
|
type Import struct {
|
||||||
@@ -2351,6 +2357,7 @@ type Import struct {
|
|||||||
|
|
||||||
combinedClasspathFile android.Path
|
combinedClasspathFile android.Path
|
||||||
exportedSdkLibs []string
|
exportedSdkLibs []string
|
||||||
|
exportAidlIncludeDirs android.Paths
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *Import) sdkVersion() sdkSpec {
|
func (j *Import) sdkVersion() sdkSpec {
|
||||||
@@ -2424,6 +2431,8 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"),
|
ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"),
|
||||||
jarName, outputFile)
|
jarName, outputFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
j.exportAidlIncludeDirs = android.PathsForModuleSrc(ctx, j.properties.Aidl.Export_include_dirs)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ Dependency = (*Import)(nil)
|
var _ Dependency = (*Import)(nil)
|
||||||
@@ -2458,7 +2467,7 @@ func (j *Import) DexJar() android.Path {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (j *Import) AidlIncludeDirs() android.Paths {
|
func (j *Import) AidlIncludeDirs() android.Paths {
|
||||||
return nil
|
return j.exportAidlIncludeDirs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *Import) ExportedSdkLibs() []string {
|
func (j *Import) ExportedSdkLibs() []string {
|
||||||
|
@@ -1491,3 +1491,27 @@ func checkBootClasspathForSystemModule(t *testing.T, ctx *android.TestContext, m
|
|||||||
t.Errorf("bootclasspath of %q must start with --system and end with %q, but was %#v.", moduleName, expectedSuffix, bootClasspath)
|
t.Errorf("bootclasspath of %q must start with --system and end with %q, but was %#v.", moduleName, expectedSuffix, bootClasspath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAidlExportIncludeDirsFromImports(t *testing.T) {
|
||||||
|
ctx, _ := testJava(t, `
|
||||||
|
java_library {
|
||||||
|
name: "foo",
|
||||||
|
srcs: ["aidl/foo/IFoo.aidl"],
|
||||||
|
libs: ["bar"],
|
||||||
|
}
|
||||||
|
|
||||||
|
java_import {
|
||||||
|
name: "bar",
|
||||||
|
jars: ["a.jar"],
|
||||||
|
aidl: {
|
||||||
|
export_include_dirs: ["aidl/bar"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
|
aidlCommand := ctx.ModuleForTests("foo", "android_common").Rule("aidl").RuleParams.Command
|
||||||
|
expectedAidlFlag := "-Iaidl/bar"
|
||||||
|
if !strings.Contains(aidlCommand, expectedAidlFlag) {
|
||||||
|
t.Errorf("aidl command %q does not contain %q", aidlCommand, expectedAidlFlag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -50,6 +50,8 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
|
|||||||
"api/test-current.txt": nil,
|
"api/test-current.txt": nil,
|
||||||
"api/test-removed.txt": nil,
|
"api/test-removed.txt": nil,
|
||||||
"framework/aidl/a.aidl": nil,
|
"framework/aidl/a.aidl": nil,
|
||||||
|
"aidl/foo/IFoo.aidl": nil,
|
||||||
|
"aidl/bar/IBar.aidl": nil,
|
||||||
"assets_a/a": nil,
|
"assets_a/a": nil,
|
||||||
"assets_b/b": nil,
|
"assets_b/b": nil,
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user