aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Wu <yuwu@google.com>2020-12-02 23:57:41 +0000
committerYu Wu <yuwu@google.com>2020-12-03 05:22:55 +0000
commita3f4ee51d5cef973a8b6f4bfbdf3589f1ba545c4 (patch)
treed5409e16cf5327f4540052ec3ba69b00a17d54d0
parente004fc4d228a45325224485f4662ebd2a88ed6b8 (diff)
downloadsoong-a3f4ee51d5cef973a8b6f4bfbdf3589f1ba545c4.tar.gz
Revert "Cherrypick from: https://android-review.googlesource.com..."
Revert "Rebase to master@ 6976336" Revert "Cherrypicked from https://android-review.git.corp.google..." Revert "Cherrypicked from https://android-review.googlesource.co..." Revert "Rebase to master@ 6976336" Revert "Rebase to master@ 6976336" Revert "Cherrypicked from https://android-review.googlesource.co..." Revert "Rebase to master@ 6976336" Revert submission 13068802-rebase_tf_173451928 Reason for revert: It leads to test flakiness and the coverage tests are not executed at all: https://b.corp.google.com/issues/173451928#comment47 Reverted Changes: I249714c9e:Cherrypick from aosp/1478357. I572e5c2ad:Cherrypick from https://android-review.googlesourc... I56119259a:Cherrypicked from https://android-review.git.corp.... Id204d5385:Update build api library. I9693182b7:Cherrypicked from https://android-review.googlesou... I270764875:Cherrypicked from https://android-review.googlesou... Iccd4e0e52:Cherrypick from: https://googleplex-android-review... I69ef44a39:Cherrypick from: https://android-review.googlesour... Ia9303dd1f:Cherrypick from: https://android-review.googlesour... I569229605:Rebase to master@ 6976336 I58902ca81:Rebase to master@ 6976336 and copy the change in a... I32e150372:Rebase to master@ 6976336 I3460d928c:Rebase to master@ 6976336 I63e2bedb6:Rebase to master@ 6976336 I82c2f9159:Rebase to master@ 6976336 Exempt-From-Owner-Approval: revert. Change-Id: I17726ead942f72cd377d811f846151ba077f20fc Merged-In: Ia9303dd1fd137e227b22db1a433bcf7140f083a5
-rw-r--r--tradefed/Android.bp17
-rw-r--r--tradefed/tradefed_binary.go164
2 files changed, 0 insertions, 181 deletions
diff --git a/tradefed/Android.bp b/tradefed/Android.bp
index f4e8334f0..6e5e5330e 100644
--- a/tradefed/Android.bp
+++ b/tradefed/Android.bp
@@ -12,20 +12,3 @@ bootstrap_go_package {
],
pluginFor: ["soong_build"],
}
-
-bootstrap_go_package {
- name: "soong-suite-harness",
- pkgPath: "android/soong/suite_harness",
- deps: [
- "blueprint",
- "blueprint-pathtools",
- "blueprint-proptools",
- "soong",
- "soong-android",
- "soong-java",
- ],
- srcs: [
- "tradefed_binary.go",
- ],
- pluginFor: ["soong_build"],
-}
diff --git a/tradefed/tradefed_binary.go b/tradefed/tradefed_binary.go
deleted file mode 100644
index 7960fdc88..000000000
--- a/tradefed/tradefed_binary.go
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright 2018 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 suite_harness
-
-import (
- "strings"
-
- "github.com/google/blueprint"
-
- "android/soong/android"
- "android/soong/java"
-)
-
-var pctx = android.NewPackageContext("android/soong/suite_harness")
-
-func init() {
- android.RegisterModuleType("tradefed_binary_host", tradefedBinaryFactory)
-
- pctx.Import("android/soong/android")
-}
-
-type TradefedBinaryProperties struct {
- Short_name string
- Full_name string
- Version string
- Prepend_platform_version_name bool
-}
-
-// tradefedBinaryFactory creates an empty module for the tradefed_binary module type,
-// which is a java_binary with some additional processing in tradefedBinaryLoadHook.
-func tradefedBinaryFactory() android.Module {
- props := &TradefedBinaryProperties{}
- module := java.BinaryHostFactory()
- module.AddProperties(props)
- android.AddLoadHook(module, tradefedBinaryLoadHook(props))
-
- return module
-}
-
-const genSuffix = "-gen"
-
-// tradefedBinaryLoadHook adds extra resources and libraries to tradefed_binary modules.
-func tradefedBinaryLoadHook(tfb *TradefedBinaryProperties) func(ctx android.LoadHookContext) {
- return func(ctx android.LoadHookContext) {
- genName := ctx.ModuleName() + genSuffix
- version := tfb.Version
- if tfb.Prepend_platform_version_name {
- version = ctx.Config().PlatformVersionName() + tfb.Version
- }
-
- // Create a submodule that generates the test-suite-info.properties file
- // and copies DynamicConfig.xml if it is present.
- ctx.CreateModule(tradefedBinaryGenFactory,
- &TradefedBinaryGenProperties{
- Name: &genName,
- Short_name: tfb.Short_name,
- Full_name: tfb.Full_name,
- Version: version,
- })
-
- props := struct {
- Java_resources []string
- Libs []string
- }{}
-
- // Add dependencies required by all tradefed_binary modules.
- props.Libs = []string{
- "tradefed",
- "tradefed-test-framework",
- "loganalysis",
- "hosttestlib",
- "compatibility-host-util",
- }
-
- // Add the files generated by the submodule created above to the resources.
- props.Java_resources = []string{":" + genName}
-
- ctx.AppendProperties(&props)
-
- }
-}
-
-type TradefedBinaryGenProperties struct {
- Name *string
- Short_name string
- Full_name string
- Version string
-}
-
-type tradefedBinaryGen struct {
- android.ModuleBase
-
- properties TradefedBinaryGenProperties
-
- gen android.Paths
-}
-
-func tradefedBinaryGenFactory() android.Module {
- tfg := &tradefedBinaryGen{}
- tfg.AddProperties(&tfg.properties)
- android.InitAndroidModule(tfg)
- return tfg
-}
-
-func (tfg *tradefedBinaryGen) DepsMutator(android.BottomUpMutatorContext) {}
-
-var tradefedBinaryGenRule = pctx.StaticRule("tradefedBinaryGenRule", blueprint.RuleParams{
- Command: `rm -f $out && touch $out && ` +
- `echo "# This file is auto generated by Android.mk. Do not modify." >> $out && ` +
- `echo "build_number = $$(cat ${buildNumberFile})" >> $out && ` +
- `echo "target_arch = ${arch}" >> $out && ` +
- `echo "name = ${name}" >> $out && ` +
- `echo "fullname = ${fullname}" >> $out && ` +
- `echo "version = ${version}" >> $out`,
-}, "buildNumberFile", "arch", "name", "fullname", "version")
-
-func (tfg *tradefedBinaryGen) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- buildNumberFile := ctx.Config().BuildNumberFile(ctx)
- outputFile := android.PathForModuleOut(ctx, "test-suite-info.properties")
- ctx.Build(pctx, android.BuildParams{
- Rule: tradefedBinaryGenRule,
- Output: outputFile,
- OrderOnly: android.Paths{buildNumberFile},
- Args: map[string]string{
- "buildNumberFile": buildNumberFile.String(),
- "arch": ctx.Config().DevicePrimaryArchType().String(),
- "name": tfg.properties.Short_name,
- "fullname": tfg.properties.Full_name,
- "version": tfg.properties.Version,
- },
- })
-
- tfg.gen = append(tfg.gen, outputFile)
-
- dynamicConfig := android.ExistentPathForSource(ctx, ctx.ModuleDir(), "DynamicConfig.xml")
- if dynamicConfig.Valid() {
- outputFile := android.PathForModuleOut(ctx, strings.TrimSuffix(ctx.ModuleName(), genSuffix)+".dynamic")
- ctx.Build(pctx, android.BuildParams{
- Rule: android.Cp,
- Input: dynamicConfig.Path(),
- Output: outputFile,
- })
-
- tfg.gen = append(tfg.gen, outputFile)
- }
-}
-
-func (tfg *tradefedBinaryGen) Srcs() android.Paths {
- return append(android.Paths(nil), tfg.gen...)
-}
-
-var _ android.SourceFileProducer = (*tradefedBinaryGen)(nil)