Migrate soong to use new sdk prebuilts.
Make is moved over in aosp/661963. Bug: 77525052 Test: make Change-Id: I04ea58964df3d4149ef09ab7ca9238336d338a06
This commit is contained in:
29
java/java.go
29
java/java.go
@@ -387,24 +387,29 @@ func decodeSdkDep(ctx android.BaseContext, v string) sdkDep {
|
||||
}
|
||||
}
|
||||
|
||||
toFile := func(v string) sdkDep {
|
||||
isCore := strings.HasPrefix(v, "core_")
|
||||
if isCore {
|
||||
v = strings.TrimPrefix(v, "core_")
|
||||
toPrebuilt := func(sdk string) sdkDep {
|
||||
var api, v string
|
||||
if strings.Contains(sdk, "_") {
|
||||
t := strings.Split(sdk, "_")
|
||||
api = t[0]
|
||||
v = t[1]
|
||||
} else {
|
||||
api = "public"
|
||||
v = sdk
|
||||
}
|
||||
dir := filepath.Join("prebuilts/sdk", v)
|
||||
dir := filepath.Join("prebuilts", "sdk", v, api)
|
||||
jar := filepath.Join(dir, "android.jar")
|
||||
if isCore {
|
||||
jar = filepath.Join(dir, "core.jar")
|
||||
}
|
||||
aidl := filepath.Join(dir, "framework.aidl")
|
||||
// There's no aidl for other SDKs yet.
|
||||
// TODO(77525052): Add aidl files for other SDKs too.
|
||||
public_dir := filepath.Join("prebuilts", "sdk", v, "public")
|
||||
aidl := filepath.Join(public_dir, "framework.aidl")
|
||||
jarPath := android.ExistentPathForSource(ctx, jar)
|
||||
aidlPath := android.ExistentPathForSource(ctx, aidl)
|
||||
|
||||
if (!jarPath.Valid() || !aidlPath.Valid()) && ctx.Config().AllowMissingDependencies() {
|
||||
return sdkDep{
|
||||
invalidVersion: true,
|
||||
module: "sdk_v" + v,
|
||||
module: fmt.Sprintf("sdk_%s_%s_android", api, v),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,7 +444,7 @@ func decodeSdkDep(ctx android.BaseContext, v string) sdkDep {
|
||||
}
|
||||
|
||||
if ctx.Config().UnbundledBuild() && v != "" {
|
||||
return toFile(v)
|
||||
return toPrebuilt(v)
|
||||
}
|
||||
|
||||
switch v {
|
||||
@@ -457,7 +462,7 @@ func decodeSdkDep(ctx android.BaseContext, v string) sdkDep {
|
||||
case "core_current":
|
||||
return toModule("core.current.stubs", "")
|
||||
default:
|
||||
return toFile(v)
|
||||
return toPrebuilt(v)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user