summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/aapt2.go2
-rw-r--r--java/java.go22
-rw-r--r--java/tradefed.go37
3 files changed, 3 insertions, 58 deletions
diff --git a/java/aapt2.go b/java/aapt2.go
index bcc8e9765..f21408f97 100644
--- a/java/aapt2.go
+++ b/java/aapt2.go
@@ -61,7 +61,7 @@ var aapt2CompileRule = pctx.AndroidStaticRule("aapt2Compile",
"outDir", "cFlags")
func aapt2Compile(ctx android.ModuleContext, dir android.Path, paths android.Paths) android.WritablePaths {
- shards := shardPaths(paths, AAPT2_SHARD_SIZE)
+ shards := android.ShardPaths(paths, AAPT2_SHARD_SIZE)
ret := make(android.WritablePaths, 0, len(paths))
diff --git a/java/java.go b/java/java.go
index 480518e76..9ac38c92c 100644
--- a/java/java.go
+++ b/java/java.go
@@ -530,18 +530,6 @@ func hasSrcExt(srcs []string, ext string) bool {
return false
}
-func shardPaths(paths android.Paths, shardSize int) []android.Paths {
- ret := make([]android.Paths, 0, (len(paths)+shardSize-1)/shardSize)
- for len(paths) > shardSize {
- ret = append(ret, paths[0:shardSize])
- paths = paths[shardSize:]
- }
- if len(paths) > 0 {
- ret = append(ret, paths)
- }
- return ret
-}
-
func (j *Module) hasSrcExt(ext string) bool {
return hasSrcExt(j.properties.Srcs, ext)
}
@@ -1088,7 +1076,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
shardSize := int(*(j.properties.Javac_shard_size))
var shardSrcs []android.Paths
if len(uniqueSrcFiles) > 0 {
- shardSrcs = shardPaths(uniqueSrcFiles, shardSize)
+ shardSrcs = android.ShardPaths(uniqueSrcFiles, shardSize)
for idx, shardSrc := range shardSrcs {
classes := android.PathForModuleOut(ctx, "javac", jarName+strconv.Itoa(idx))
TransformJavaToClasses(ctx, classes, idx, shardSrc, nil, flags, extraJarDeps)
@@ -1465,8 +1453,6 @@ func (j *Module) CompilerDeps() []string {
type Library struct {
Module
-
- InstallMixin func(ctx android.ModuleContext, installPath android.Path) (extraInstallDeps android.Paths)
}
func shouldUncompressDex(ctx android.ModuleContext, dexpreopter *dexpreopter) bool {
@@ -1496,12 +1482,8 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
j.compile(ctx)
if (Bool(j.properties.Installable) || ctx.Host()) && !android.DirectlyInAnyApex(ctx, ctx.ModuleName()) {
- var extraInstallDeps android.Paths
- if j.InstallMixin != nil {
- extraInstallDeps = j.InstallMixin(ctx, j.outputFile)
- }
j.installFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"),
- ctx.ModuleName()+".jar", j.outputFile, extraInstallDeps...)
+ ctx.ModuleName()+".jar", j.outputFile)
}
}
diff --git a/java/tradefed.go b/java/tradefed.go
deleted file mode 100644
index ebbdec13d..000000000
--- a/java/tradefed.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2019 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package java
-
-import (
- "android/soong/android"
-)
-
-func init() {
- android.RegisterModuleType("tradefed_java_library_host", tradefedJavaLibraryFactory)
-}
-
-// tradefed_java_library_factory wraps java_library and installs an additional
-// copy of the output jar to $HOST_OUT/tradefed.
-func tradefedJavaLibraryFactory() android.Module {
- module := LibraryHostFactory().(*Library)
- module.InstallMixin = tradefedJavaLibraryInstall
- return module
-}
-
-func tradefedJavaLibraryInstall(ctx android.ModuleContext, path android.Path) android.Paths {
- installedPath := ctx.InstallFile(android.PathForModuleInstall(ctx, "tradefed"),
- ctx.ModuleName()+".jar", path)
- return android.Paths{installedPath}
-}