aboutsummaryrefslogtreecommitdiffstats
path: root/java/java.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/java/java.go b/java/java.go
index e2e15d46..9888b387 100644
--- a/java/java.go
+++ b/java/java.go
@@ -407,6 +407,16 @@ func (j *Module) compile(ctx android.ModuleContext) {
"--dump-width=1000")
}
+ var minSdkVersion string
+ switch j.deviceProperties.Sdk_version {
+ case "", "current", "test_current", "system_current":
+ minSdkVersion = strconv.Itoa(ctx.AConfig().DefaultAppTargetSdkInt())
+ default:
+ minSdkVersion = j.deviceProperties.Sdk_version
+ }
+
+ dxFlags = append(dxFlags, "--min-sdk-version="+minSdkVersion)
+
flags.dxFlags = strings.Join(dxFlags, " ")
// Compile classes.jar into classes.dex
@@ -457,7 +467,7 @@ type Library struct {
func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
j.compile(ctx)
- j.installFile = ctx.InstallFileName(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".jar", j.outputFile)
+ j.installFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".jar", j.outputFile)
}
func (j *Library) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -510,8 +520,8 @@ func (j *Binary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// Depend on the installed jar (j.installFile) so that the wrapper doesn't get executed by
// another build rule before the jar has been installed.
j.wrapperFile = android.PathForModuleSrc(ctx, j.binaryProperties.Wrapper)
- j.binaryFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "bin"),
- j.wrapperFile, j.installFile)
+ j.binaryFile = ctx.InstallExecutable(android.PathForModuleInstall(ctx, "bin"),
+ ctx.ModuleName(), j.wrapperFile, j.installFile)
}
func (j *Binary) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -590,7 +600,7 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
j.combinedClasspathFile = TransformClassesToJar(ctx, j.classJarSpecs, android.OptionalPath{}, nil)
- ctx.InstallFileName(android.PathForModuleInstall(ctx, "framework"),
+ ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"),
ctx.ModuleName()+".jar", j.combinedClasspathFile)
}