diff options
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/java/java.go b/java/java.go index 5f4a09093..ecafa1e22 100644 --- a/java/java.go +++ b/java/java.go @@ -52,6 +52,20 @@ func init() { android.RegisterSingletonType("logtags", LogtagsSingleton) } +func (j *Module) checkPlatformAPI(ctx android.ModuleContext) { + if sc, ok := ctx.Module().(sdkContext); ok { + usePlatformAPI := proptools.Bool(j.deviceProperties.Platform_apis) + if usePlatformAPI != (sc.sdkVersion() == "") { + if usePlatformAPI { + ctx.PropertyErrorf("platform_apis", "platform_apis must be false when sdk_version is not empty.") + } else { + ctx.PropertyErrorf("platform_apis", "platform_apis must be true when sdk_version is empty.") + } + } + + } +} + // TODO: // Autogenerated files: // Renderscript @@ -178,8 +192,8 @@ type CompilerDeviceProperties struct { // list of module-specific flags that will be used for dex compiles Dxflags []string `android:"arch_variant"` - // if not blank, set to the version of the sdk to compile against. Defaults to compiling against the current - // sdk if platform_apis is not set. + // if not blank, set to the version of the sdk to compile against. + // Defaults to compiling against the current platform. Sdk_version *string // if not blank, set the minimum version of the sdk that the compiled artifacts will run against. @@ -190,7 +204,8 @@ type CompilerDeviceProperties struct { // Defaults to sdk_version if not set. Target_sdk_version *string - // if true, compile against the platform APIs instead of an SDK. + // It must be true only if sdk_version is empty. + // This field works in only android_app, otherwise nothing happens. Platform_apis *bool Aidl struct { |