Migrate api lint report dist rules to Soong

This change achieves the followings:

1. Fix the missing api lint report dist rules.
Prior to https://r.android.com/3467664, the api lint report files were
copied to the dist directory via the following dependency path:
```
droidcore -> checkapi -> <droidstubs name>-api-lint -> api lint report
file
```
However, the aforementioned change removed the dependency path between
droidcore and checkapi, and consequently the apilint/ subdirectory is
not generated in the dist directory in ToT. This change fixes the
broken behavior by adding "droidcore" as an additional dist goal for the
api lint report file.

2. Migrate the api lint report dist rule from Androidmk to
   MakeVars(...).
Change https://r.android.com/3476313 has added the support to dist files
added via `MakeVars(...)` in Soong only build. This change utilizes this
functionality to support disting the api lint report files in Soong only
build.

This change also breaks down the switch cases in
getSoongOnlyDataFromMods to multiple conditionals, because a module can
set more than one of the providers listed in the switch statement.

Test: m droid dist --soong-only && ls -l out/dist/apilint
Bug: 394365683
Change-Id: I32640312e92e13831486d66b658a04d96104170f
diff --git a/android/androidmk.go b/android/androidmk.go
index cf1589d..f2e1c10 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -892,13 +892,7 @@
 				}
 			}
 		} else {
-			mctx := &makeVarsContext{
-				SingletonContext: ctx.(SingletonContext),
-				config:           ctx.Config(),
-				pctx:             pctx,
-			}
-			switch x := mod.(type) {
-			case AndroidMkDataProvider:
+			if x, ok := mod.(AndroidMkDataProvider); ok {
 				data := x.AndroidMk()
 
 				if data.Include == "" {
@@ -915,7 +909,8 @@
 				if contribution := data.Entries.getDistContributions(mod); contribution != nil {
 					allDistContributions = append(allDistContributions, *contribution)
 				}
-			case AndroidMkEntriesProvider:
+			}
+			if x, ok := mod.(AndroidMkEntriesProvider); ok {
 				entriesList := x.AndroidMkEntries()
 				for _, entries := range entriesList {
 					entries.fillInEntries(ctx, mod)
@@ -929,7 +924,13 @@
 						allDistContributions = append(allDistContributions, *contribution)
 					}
 				}
-			case ModuleMakeVarsProvider:
+			}
+			if x, ok := mod.(ModuleMakeVarsProvider); ok {
+				mctx := &makeVarsContext{
+					SingletonContext: ctx.(SingletonContext),
+					config:           ctx.Config(),
+					pctx:             pctx,
+				}
 				if !x.Enabled(ctx) {
 					continue
 				}
@@ -937,15 +938,17 @@
 				if contribution := getMakeVarsDistContributions(mctx); contribution != nil {
 					allDistContributions = append(allDistContributions, *contribution)
 				}
-
-			case SingletonMakeVarsProvider:
+			}
+			if x, ok := mod.(SingletonMakeVarsProvider); ok {
+				mctx := &makeVarsContext{
+					SingletonContext: ctx.(SingletonContext),
+					config:           ctx.Config(),
+					pctx:             pctx,
+				}
 				x.MakeVars(mctx)
 				if contribution := getMakeVarsDistContributions(mctx); contribution != nil {
 					allDistContributions = append(allDistContributions, *contribution)
 				}
-
-			default:
-				// Not exported to make so no make variables to set.
 			}
 		}
 	}