Loading apex/apex_test.go +30 −0 Original line number Diff line number Diff line Loading @@ -1695,6 +1695,36 @@ func TestApexMinSdkVersion_SupportsCodeNames(t *testing.T) { expectNoLink("libx", "shared_apex10000", "libz", "shared") } func TestApexMinSdkVersion_SupportsCodeNames_JavaLibs(t *testing.T) { testApex(t, ` apex { name: "myapex", key: "myapex.key", java_libs: ["libx"], min_sdk_version: "S", } apex_key { name: "myapex.key", public_key: "testkey.avbpubkey", private_key: "testkey.pem", } java_library { name: "libx", srcs: ["a.java"], apex_available: [ "myapex" ], sdk_version: "current", min_sdk_version: "S", // should be okay } `, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { variables.Platform_version_active_codenames = []string{"S"} variables.Platform_sdk_codename = proptools.StringPtr("S") }), ) } func TestApexMinSdkVersion_DefaultsToLatest(t *testing.T) { ctx := testApex(t, ` apex { Loading java/base.go +2 −6 Original line number Diff line number Diff line Loading @@ -1513,12 +1513,8 @@ func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, if sdkSpec.Kind == android.SdkCore { return nil } ver, err := sdkSpec.EffectiveVersion(ctx) if err != nil { return err } if ver.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", ver) if sdkSpec.ApiLevel.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", sdkSpec.ApiLevel) } return nil } Loading java/java.go +2 −6 Original line number Diff line number Diff line Loading @@ -1416,12 +1416,8 @@ func (j *Import) ShouldSupportSdkVersion(ctx android.BaseModuleContext, if sdkSpec.Kind == android.SdkCore { return nil } ver, err := sdkSpec.EffectiveVersion(ctx) if err != nil { return err } if ver.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", ver) if sdkSpec.ApiLevel.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", sdkSpec.ApiLevel) } return nil } Loading Loading
apex/apex_test.go +30 −0 Original line number Diff line number Diff line Loading @@ -1695,6 +1695,36 @@ func TestApexMinSdkVersion_SupportsCodeNames(t *testing.T) { expectNoLink("libx", "shared_apex10000", "libz", "shared") } func TestApexMinSdkVersion_SupportsCodeNames_JavaLibs(t *testing.T) { testApex(t, ` apex { name: "myapex", key: "myapex.key", java_libs: ["libx"], min_sdk_version: "S", } apex_key { name: "myapex.key", public_key: "testkey.avbpubkey", private_key: "testkey.pem", } java_library { name: "libx", srcs: ["a.java"], apex_available: [ "myapex" ], sdk_version: "current", min_sdk_version: "S", // should be okay } `, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { variables.Platform_version_active_codenames = []string{"S"} variables.Platform_sdk_codename = proptools.StringPtr("S") }), ) } func TestApexMinSdkVersion_DefaultsToLatest(t *testing.T) { ctx := testApex(t, ` apex { Loading
java/base.go +2 −6 Original line number Diff line number Diff line Loading @@ -1513,12 +1513,8 @@ func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, if sdkSpec.Kind == android.SdkCore { return nil } ver, err := sdkSpec.EffectiveVersion(ctx) if err != nil { return err } if ver.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", ver) if sdkSpec.ApiLevel.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", sdkSpec.ApiLevel) } return nil } Loading
java/java.go +2 −6 Original line number Diff line number Diff line Loading @@ -1416,12 +1416,8 @@ func (j *Import) ShouldSupportSdkVersion(ctx android.BaseModuleContext, if sdkSpec.Kind == android.SdkCore { return nil } ver, err := sdkSpec.EffectiveVersion(ctx) if err != nil { return err } if ver.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", ver) if sdkSpec.ApiLevel.GreaterThan(sdkVersion) { return fmt.Errorf("newer SDK(%v)", sdkSpec.ApiLevel) } return nil } Loading