Loading java/aar.go +4 −3 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ func aaptLibs(ctx android.ModuleContext, sdkContext sdkContext) (transitiveStati exportPackage = aarDep.ExportPackage() } if dep, ok := module.(Dependency); ok { sdkLibraries.AddLibraryPaths(dep.ExportedSdkLibs()) } switch ctx.OtherModuleDependencyTag(module) { case instrumentationForTag: // Nothing, instrumentationForTag is treated as libTag for javac but not for aapt2. Loading @@ -399,9 +403,6 @@ func aaptLibs(ctx android.ModuleContext, sdkContext sdkContext) (transitiveStati sharedLibs = append(sharedLibs, exportPackage) } case staticLibTag: if dep, ok := module.(Dependency); ok { sdkLibraries.AddLibraryPaths(dep.ExportedSdkLibs()) } if exportPackage != nil { transitiveStaticLibs = append(transitiveStaticLibs, aarDep.ExportedStaticPackages()...) transitiveStaticLibs = append(transitiveStaticLibs, exportPackage) Loading java/app.go +5 −8 Original line number Diff line number Diff line Loading @@ -284,8 +284,6 @@ type AndroidApp struct { aapt android.OverridableModuleBase usesLibrary usesLibrary certificate Certificate appProperties appProperties Loading Loading @@ -1018,8 +1016,7 @@ func AndroidAppFactory() android.Module { module.AddProperties( &module.aaptProperties, &module.appProperties, &module.overridableAppProperties, &module.usesLibrary.usesLibraryProperties) &module.overridableAppProperties) android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) android.InitDefaultableModule(module) Loading Loading @@ -1140,7 +1137,6 @@ func AndroidTestFactory() android.Module { &module.appProperties, &module.appTestProperties, &module.overridableAppProperties, &module.usesLibrary.usesLibraryProperties, &module.testProperties) android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) Loading Loading @@ -1189,8 +1185,7 @@ func AndroidTestHelperAppFactory() android.Module { &module.aaptProperties, &module.appProperties, &module.appTestHelperAppProperties, &module.overridableAppProperties, &module.usesLibrary.usesLibraryProperties) &module.overridableAppProperties) android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) android.InitDefaultableModule(module) Loading Loading @@ -1704,7 +1699,6 @@ func AndroidTestImportFactory() android.Module { module := &AndroidTestImport{} module.AddProperties(&module.properties) module.AddProperties(&module.dexpreoptProperties) module.AddProperties(&module.usesLibrary.usesLibraryProperties) module.AddProperties(&module.testProperties) module.AddProperties(&module.testImportProperties) module.populateAllVariantStructs() Loading Loading @@ -1888,6 +1882,9 @@ type UsesLibraryProperties struct { // If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults // to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future. Enforce_uses_libs *bool // If the library itself is a uses-library (this is needed for non-SDK libraries). Is_uses_lib *bool } // usesLibrary provides properties and helper functions for AndroidApp and AndroidAppImport to verify that the Loading java/java.go +7 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,7 @@ type Module struct { hiddenAPI dexer dexpreopter usesLibrary linter // list of the xref extraction files Loading @@ -452,6 +453,7 @@ func (j *Module) addHostProperties() { j.AddProperties( &j.properties, &j.protoProperties, &j.usesLibraryProperties, ) } Loading Loading @@ -1976,6 +1978,11 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { // added to the Android manifest. j.exportedSdkLibs.MaybeAddLibraryPath(ctx, j.OptionalImplicitSdkLibrary(), j.DexJarBuildPath(), j.DexJarInstallPath()) // If this is a non-SDK uses-library, export itself. if proptools.Bool(j.usesLibraryProperties.Is_uses_lib) { j.exportedSdkLibs.AddLibraryPath(ctx, ctx.ModuleName(), j.DexJarBuildPath(), j.DexJarInstallPath()) } j.distFiles = j.GenerateTaggedDistFiles(ctx) } Loading Loading
java/aar.go +4 −3 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ func aaptLibs(ctx android.ModuleContext, sdkContext sdkContext) (transitiveStati exportPackage = aarDep.ExportPackage() } if dep, ok := module.(Dependency); ok { sdkLibraries.AddLibraryPaths(dep.ExportedSdkLibs()) } switch ctx.OtherModuleDependencyTag(module) { case instrumentationForTag: // Nothing, instrumentationForTag is treated as libTag for javac but not for aapt2. Loading @@ -399,9 +403,6 @@ func aaptLibs(ctx android.ModuleContext, sdkContext sdkContext) (transitiveStati sharedLibs = append(sharedLibs, exportPackage) } case staticLibTag: if dep, ok := module.(Dependency); ok { sdkLibraries.AddLibraryPaths(dep.ExportedSdkLibs()) } if exportPackage != nil { transitiveStaticLibs = append(transitiveStaticLibs, aarDep.ExportedStaticPackages()...) transitiveStaticLibs = append(transitiveStaticLibs, exportPackage) Loading
java/app.go +5 −8 Original line number Diff line number Diff line Loading @@ -284,8 +284,6 @@ type AndroidApp struct { aapt android.OverridableModuleBase usesLibrary usesLibrary certificate Certificate appProperties appProperties Loading Loading @@ -1018,8 +1016,7 @@ func AndroidAppFactory() android.Module { module.AddProperties( &module.aaptProperties, &module.appProperties, &module.overridableAppProperties, &module.usesLibrary.usesLibraryProperties) &module.overridableAppProperties) android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) android.InitDefaultableModule(module) Loading Loading @@ -1140,7 +1137,6 @@ func AndroidTestFactory() android.Module { &module.appProperties, &module.appTestProperties, &module.overridableAppProperties, &module.usesLibrary.usesLibraryProperties, &module.testProperties) android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) Loading Loading @@ -1189,8 +1185,7 @@ func AndroidTestHelperAppFactory() android.Module { &module.aaptProperties, &module.appProperties, &module.appTestHelperAppProperties, &module.overridableAppProperties, &module.usesLibrary.usesLibraryProperties) &module.overridableAppProperties) android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) android.InitDefaultableModule(module) Loading Loading @@ -1704,7 +1699,6 @@ func AndroidTestImportFactory() android.Module { module := &AndroidTestImport{} module.AddProperties(&module.properties) module.AddProperties(&module.dexpreoptProperties) module.AddProperties(&module.usesLibrary.usesLibraryProperties) module.AddProperties(&module.testProperties) module.AddProperties(&module.testImportProperties) module.populateAllVariantStructs() Loading Loading @@ -1888,6 +1882,9 @@ type UsesLibraryProperties struct { // If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults // to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future. Enforce_uses_libs *bool // If the library itself is a uses-library (this is needed for non-SDK libraries). Is_uses_lib *bool } // usesLibrary provides properties and helper functions for AndroidApp and AndroidAppImport to verify that the Loading
java/java.go +7 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,7 @@ type Module struct { hiddenAPI dexer dexpreopter usesLibrary linter // list of the xref extraction files Loading @@ -452,6 +453,7 @@ func (j *Module) addHostProperties() { j.AddProperties( &j.properties, &j.protoProperties, &j.usesLibraryProperties, ) } Loading Loading @@ -1976,6 +1978,11 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { // added to the Android manifest. j.exportedSdkLibs.MaybeAddLibraryPath(ctx, j.OptionalImplicitSdkLibrary(), j.DexJarBuildPath(), j.DexJarInstallPath()) // If this is a non-SDK uses-library, export itself. if proptools.Bool(j.usesLibraryProperties.Is_uses_lib) { j.exportedSdkLibs.AddLibraryPath(ctx, ctx.ModuleName(), j.DexJarBuildPath(), j.DexJarInstallPath()) } j.distFiles = j.GenerateTaggedDistFiles(ctx) } Loading