Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 160634ca authored by Jihoon Kang's avatar Jihoon Kang
Browse files

Modify error emit condition for checking api files in java_api_library

java_api_library currently emits error based when the
java_api_contribution module has an empty api file or when the module
does not have any api files. This may be problematic in partial
manifests where allow missing dependency is set, thus add this condition
for error emission.

Test: go test ./java
Bug: 284212875
Change-Id: I10b4baa5723e7a53d931823b3029ea20ac731911
parent 4aed3703
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1813,7 +1813,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
		case javaApiContributionTag:
			provider := ctx.OtherModuleProvider(dep, JavaApiImportProvider).(JavaApiImportInfo)
			providerApiFile := provider.ApiFile
			if providerApiFile == nil {
			if providerApiFile == nil && !ctx.Config().AllowMissingDependencies() {
				ctx.ModuleErrorf("Error: %s has an empty api file.", dep.Name())
			}
			srcFiles = append(srcFiles, android.PathForSource(ctx, providerApiFile.String()))
@@ -1835,7 +1835,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
		srcFiles = append(srcFiles, android.PathForModuleSrc(ctx, api))
	}

	if srcFiles == nil {
	if srcFiles == nil && !ctx.Config().AllowMissingDependencies() {
		ctx.ModuleErrorf("Error: %s has an empty api file.", ctx.ModuleName())
	}