diff options
author | 2024-10-21 16:26:12 -0700 | |
---|---|---|
committer | 2024-10-24 10:20:17 -0700 | |
commit | 830f56a78e91ba02314edd6937fcf73f937635ba (patch) | |
tree | cade4f3a63cf4674f044feb3df312e5fbdf5d94c | |
parent | 44b35ecc43347292a95dec396244f083f77c9bdc (diff) |
Remove testing package
The testing package defined test_spec and code_metadata module types,
but they were never used and the owner left google.
Bug: 372091092
Test: Presubmits
Change-Id: I2d34ce173ec46483719a1d333180937b3da1fa04
38 files changed, 0 insertions, 1751 deletions
diff --git a/cc/Android.bp b/cc/Android.bp index a5ad9ce9c..5a1197895 100644 --- a/cc/Android.bp +++ b/cc/Android.bp @@ -16,7 +16,6 @@ bootstrap_go_package { "soong-etc", "soong-fuzz", "soong-genrule", - "soong-testing", "soong-tradefed", ], srcs: [ @@ -24,8 +24,6 @@ import ( "strconv" "strings" - "android/soong/testing" - "github.com/google/blueprint" "github.com/google/blueprint/proptools" @@ -2038,9 +2036,6 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { c.maybeUnhideFromMake() } - if c.testModule { - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) - } android.SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: deps.GeneratedSources.Strings()}) diff --git a/java/Android.bp b/java/Android.bp index 1101d7a33..03fde3b80 100644 --- a/java/Android.bp +++ b/java/Android.bp @@ -15,7 +15,6 @@ bootstrap_go_package { "soong-dexpreopt", "soong-genrule", "soong-java-config", - "soong-testing", "soong-provenance", "soong-python", "soong-remoteexec", @@ -86,7 +85,6 @@ bootstrap_go_package { "app_import_test.go", "app_set_test.go", "app_test.go", - "code_metadata_test.go", "container_test.go", "bootclasspath_fragment_test.go", "device_host_converter_test.go", @@ -117,7 +115,6 @@ bootstrap_go_package { "sdk_version_test.go", "system_modules_test.go", "systemserver_classpath_fragment_test.go", - "test_spec_test.go", ], pluginFor: ["soong_build"], visibility: ["//visibility:public"], diff --git a/java/app.go b/java/app.go index addbc28b0..2d75ccdf9 100644 --- a/java/app.go +++ b/java/app.go @@ -22,8 +22,6 @@ import ( "path/filepath" "strings" - "android/soong/testing" - "github.com/google/blueprint" "github.com/google/blueprint/proptools" @@ -1443,7 +1441,6 @@ func (a *AndroidTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.data = append(a.data, android.PathsForModuleSrc(ctx, a.testProperties.Device_common_data)...) a.data = append(a.data, android.PathsForModuleSrc(ctx, a.testProperties.Device_first_data)...) a.data = append(a.data, android.PathsForModuleSrc(ctx, a.testProperties.Device_first_prefer32_data)...) - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) android.SetProvider(ctx, tradefed.BaseTestProviderKey, tradefed.BaseTestProviderData{ InstalledFiles: a.data, OutputFile: a.OutputFile(), diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index 4fcd40bd3..1a3368057 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -23,7 +23,6 @@ import ( "android/soong/android" "android/soong/dexpreopt" - "android/soong/testing" "github.com/google/blueprint/proptools" @@ -524,7 +523,6 @@ func (b *BootclasspathFragmentModule) GenerateAndroidBuildActions(ctx android.Mo if ctx.Module() != ctx.FinalModule() { b.HideFromMake() } - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) } // getProfileProviderApex returns the name of the apex that provides a boot image profile, or an diff --git a/java/code_metadata_test.go b/java/code_metadata_test.go deleted file mode 100644 index 9dc9a2262..000000000 --- a/java/code_metadata_test.go +++ /dev/null @@ -1,115 +0,0 @@ -package java - -import ( - "strings" - "testing" - - "android/soong/android" - soongTesting "android/soong/testing" - "android/soong/testing/code_metadata_internal_proto" - - "google.golang.org/protobuf/proto" -) - -func TestCodeMetadata(t *testing.T) { - bp := `code_metadata { - name: "module-name", - teamId: "12345", - code: [ - "foo", - ] - } - - java_sdk_library { - name: "foo", - srcs: ["a.java"], - }` - result := runCodeMetadataTest(t, android.FixtureExpectsNoErrors, bp) - - module := result.ModuleForTests("module-name", "") - - // Check that the provider has the right contents - data, _ := android.OtherModuleProvider(result, module.Module(), soongTesting.CodeMetadataProviderKey) - if !strings.HasSuffix( - data.IntermediatePath.String(), "/intermediateCodeMetadata.pb", - ) { - t.Errorf( - "Missing intermediates path in provider: %s", - data.IntermediatePath.String(), - ) - } - - metadata := android.ContentFromFileRuleForTests(t, result.TestContext, - module.Output(data.IntermediatePath.String())) - - metadataList := make([]*code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership, 0, 2) - teamId := "12345" - bpFilePath := "Android.bp" - targetName := "foo" - srcFile := []string{"a.java"} - expectedMetadataProto := code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership{ - TrendyTeamId: &teamId, - TargetName: &targetName, - Path: &bpFilePath, - SourceFiles: srcFile, - } - metadataList = append(metadataList, &expectedMetadataProto) - - CodeMetadataMetadata := code_metadata_internal_proto.CodeMetadataInternal{TargetOwnershipList: metadataList} - protoData, _ := proto.Marshal(&CodeMetadataMetadata) - expectedMetadata := string(protoData) - - if metadata != expectedMetadata { - t.Errorf( - "Retrieved metadata: %s is not equal to expectedMetadata: %s", metadata, - expectedMetadata, - ) - } - - // Tests for all_test_spec singleton. - singleton := result.SingletonForTests("all_code_metadata") - rule := singleton.Rule("all_code_metadata_rule") - prebuiltOs := result.Config.PrebuiltOS() - expectedCmd := "out/soong/host/" + prebuiltOs + "/bin/metadata -rule code_metadata -inputFile out/soong/all_code_metadata_paths.rsp -outputFile out/soong/ownership/all_code_metadata.pb" - expectedOutputFile := "out/soong/ownership/all_code_metadata.pb" - expectedInputFile := "out/soong/.intermediates/module-name/intermediateCodeMetadata.pb" - if !strings.Contains( - strings.TrimSpace(rule.Output.String()), - expectedOutputFile, - ) { - t.Errorf( - "Retrieved singletonOutputFile: %s is not equal to expectedSingletonOutputFile: %s", - rule.Output.String(), expectedOutputFile, - ) - } - - if !strings.Contains( - strings.TrimSpace(rule.Inputs[0].String()), - expectedInputFile, - ) { - t.Errorf( - "Retrieved singletonInputFile: %s is not equal to expectedSingletonInputFile: %s", - rule.Inputs[0].String(), expectedInputFile, - ) - } - - if !strings.Contains( - strings.TrimSpace(rule.RuleParams.Command), - expectedCmd, - ) { - t.Errorf( - "Retrieved cmd: %s doesn't contain expectedCmd: %s", - rule.RuleParams.Command, expectedCmd, - ) - } -} -func runCodeMetadataTest( - t *testing.T, errorHandler android.FixtureErrorHandler, bp string, -) *android.TestResult { - return android.GroupFixturePreparers( - soongTesting.PrepareForTestWithTestingBuildComponents, prepareForJavaTest, - PrepareForTestWithJavaSdkLibraryFiles, FixtureWithLastReleaseApis("foo"), - ). - ExtendWithErrorHandler(errorHandler). - RunTestWithBp(t, bp) -} diff --git a/java/java.go b/java/java.go index 679714858..51e294ef3 100644 --- a/java/java.go +++ b/java/java.go @@ -26,7 +26,6 @@ import ( "strings" "android/soong/remoteexec" - "android/soong/testing" "github.com/google/blueprint" "github.com/google/blueprint/proptools" @@ -1557,7 +1556,6 @@ func (j *TestHost) GenerateAndroidBuildActions(ctx android.ModuleContext) { } j.Test.generateAndroidBuildActionsWithConfig(ctx, configs) - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) android.SetProvider(ctx, tradefed.BaseTestProviderKey, tradefed.BaseTestProviderData{ InstalledFiles: j.data, OutputFile: j.outputFile, @@ -1573,7 +1571,6 @@ func (j *TestHost) GenerateAndroidBuildActions(ctx android.ModuleContext) { func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) { checkMinSdkVersionMts(ctx, j.MinSdkVersion(ctx)) j.generateAndroidBuildActionsWithConfig(ctx, nil) - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) } func (j *Test) generateAndroidBuildActionsWithConfig(ctx android.ModuleContext, configs []tradefed.Config) { diff --git a/java/robolectric.go b/java/robolectric.go index e6f80ac37..5f46267f9 100644 --- a/java/robolectric.go +++ b/java/robolectric.go @@ -19,7 +19,6 @@ import ( "android/soong/android" "android/soong/java/config" - "android/soong/testing" "android/soong/tradefed" "github.com/google/blueprint/proptools" @@ -243,7 +242,6 @@ func (r *robolectricTest) GenerateAndroidBuildActions(ctx android.ModuleContext) } r.installFile = ctx.InstallFile(installPath, ctx.ModuleName()+".jar", r.outputFile, installDeps...) - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) } func generateSameDirRoboTestConfigJar(ctx android.ModuleContext, outputFile android.ModuleOutPath) { diff --git a/java/test_spec_test.go b/java/test_spec_test.go deleted file mode 100644 index f0a5fdb4b..000000000 --- a/java/test_spec_test.go +++ /dev/null @@ -1,122 +0,0 @@ -package java - -import ( - "strings" - "testing" - - "android/soong/android" - soongTesting "android/soong/testing" - "android/soong/testing/test_spec_proto" - "google.golang.org/protobuf/proto" -) - -func TestTestSpec(t *testing.T) { - bp := `test_spec { - name: "module-name", - teamId: "12345", - tests: [ - "java-test-module-name-one", - "java-test-module-name-two" - ] - } - - java_test { - name: "java-test-module-name-one", - } - - java_test { - name: "java-test-module-name-two", - }` - result := runTestSpecTest(t, android.FixtureExpectsNoErrors, bp) - - module := result.ModuleForTests("module-name", "") - - // Check that the provider has the right contents - data, _ := android.OtherModuleProvider(result, module.Module(), soongTesting.TestSpecProviderKey) - if !strings.HasSuffix( - data.IntermediatePath.String(), "/intermediateTestSpecMetadata.pb", - ) { - t.Errorf( - "Missing intermediates path in provider: %s", - data.IntermediatePath.String(), - ) - } - - metadata := android.ContentFromFileRuleForTests(t, result.TestContext, - module.Output(data.IntermediatePath.String())) - - metadataList := make([]*test_spec_proto.TestSpec_OwnershipMetadata, 0, 2) - teamId := "12345" - bpFilePath := "Android.bp" - targetNames := []string{ - "java-test-module-name-one", "java-test-module-name-two", - } - - for _, test := range targetNames { - targetName := test - metadata := test_spec_proto.TestSpec_OwnershipMetadata{ - TrendyTeamId: &teamId, - TargetName: &targetName, - Path: &bpFilePath, - } - metadataList = append(metadataList, &metadata) - } - testSpecMetadata := test_spec_proto.TestSpec{OwnershipMetadataList: metadataList} - protoData, _ := proto.Marshal(&testSpecMetadata) - expectedMetadata := string(protoData) - - if metadata != expectedMetadata { - t.Errorf( - "Retrieved metadata: %s doesn't contain expectedMetadata: %s", metadata, - expectedMetadata, - ) - } - - // Tests for all_test_spec singleton. - singleton := result.SingletonForTests("all_test_specs") - rule := singleton.Rule("all_test_specs_rule") - prebuiltOs := result.Config.PrebuiltOS() - expectedCmd := "out/soong/host/" + prebuiltOs + "/bin/metadata -rule test_spec -inputFile out/soong/all_test_spec_paths.rsp -outputFile out/soong/ownership/all_test_specs.pb" - expectedOutputFile := "out/soong/ownership/all_test_specs.pb" - expectedInputFile := "out/soong/.intermediates/module-name/intermediateTestSpecMetadata.pb" - if !strings.Contains( - strings.TrimSpace(rule.Output.String()), - expectedOutputFile, - ) { - t.Errorf( - "Retrieved singletonOutputFile: %s is not equal to expectedSingletonOutputFile: %s", - rule.Output.String(), expectedOutputFile, - ) - } - - if !strings.Contains( - strings.TrimSpace(rule.Inputs[0].String()), - expectedInputFile, - ) { - t.Errorf( - "Retrieved singletonInputFile: %s is not equal to expectedSingletonInputFile: %s", - rule.Inputs[0].String(), expectedInputFile, - ) - } - - if !strings.Contains( - strings.TrimSpace(rule.RuleParams.Command), - expectedCmd, - ) { - t.Errorf( - "Retrieved cmd: %s is not equal to expectedCmd: %s", - rule.RuleParams.Command, expectedCmd, - ) - } -} - -func runTestSpecTest( - t *testing.T, errorHandler android.FixtureErrorHandler, bp string, -) *android.TestResult { - return android.GroupFixturePreparers( - soongTesting.PrepareForTestWithTestingBuildComponents, - PrepareForIntegrationTestWithJava, - ). - ExtendWithErrorHandler(errorHandler). - RunTestWithBp(t, bp) -} diff --git a/python/Android.bp b/python/Android.bp index 14e83c184..3b5445510 100644 --- a/python/Android.bp +++ b/python/Android.bp @@ -10,7 +10,6 @@ bootstrap_go_package { "soong-android", "soong-tradefed", "soong-cc", - "soong-testing", ], srcs: [ "binary.go", diff --git a/python/test.go b/python/test.go index acf5b26da..9f57bea1b 100644 --- a/python/test.go +++ b/python/test.go @@ -17,8 +17,6 @@ package python import ( "fmt" - "android/soong/testing" - "github.com/google/blueprint/proptools" "android/soong/android" @@ -208,8 +206,6 @@ func (p *PythonTestModule) GenerateAndroidBuildActions(ctx android.ModuleContext installDir := installDir(ctx, "nativetest", "nativetest64", ctx.ModuleName()) installedData := ctx.InstallTestData(installDir, p.data) p.installedDest = ctx.InstallFile(installDir, p.installSource.Base(), p.installSource, installedData...) - - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) } func (p *PythonTestModule) AndroidMkEntries() []android.AndroidMkEntries { diff --git a/rust/Android.bp b/rust/Android.bp index 781f325d1..54ba9d49c 100644 --- a/rust/Android.bp +++ b/rust/Android.bp @@ -12,7 +12,6 @@ bootstrap_go_package { "soong-bloaty", "soong-cc", "soong-rust-config", - "soong-testing", ], srcs: [ "afdo.go", diff --git a/rust/rust.go b/rust/rust.go index b22ebf7e7..a1fed3e6b 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -20,7 +20,6 @@ import ( "strings" "android/soong/bloaty" - "android/soong/testing" "github.com/google/blueprint" "github.com/google/blueprint/proptools" @@ -992,9 +991,6 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { ctx.Phony("rust", ctx.RustModule().OutputFile().Path()) } - if mod.testModule { - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) - } mod.setOutputFiles(ctx) diff --git a/sh/Android.bp b/sh/Android.bp index 930fcf54d..1deedc731 100644 --- a/sh/Android.bp +++ b/sh/Android.bp @@ -11,7 +11,6 @@ bootstrap_go_package { "soong-android", "soong-cc", "soong-java", - "soong-testing", "soong-tradefed", ], srcs: [ diff --git a/sh/sh_binary.go b/sh/sh_binary.go index 399144983..9c0db73ba 100644 --- a/sh/sh_binary.go +++ b/sh/sh_binary.go @@ -18,8 +18,6 @@ import ( "path/filepath" "strings" - "android/soong/testing" - "github.com/google/blueprint" "github.com/google/blueprint/proptools" @@ -510,8 +508,6 @@ func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { installedData := ctx.InstallTestData(s.installDir, s.data) s.installedFile = ctx.InstallExecutable(s.installDir, s.outputFilePath.Base(), s.outputFilePath, installedData...) - - android.SetProvider(ctx, testing.TestModuleProviderKey, testing.TestModuleProviderData{}) } func (s *ShTest) InstallInData() bool { diff --git a/testing/Android.bp b/testing/Android.bp deleted file mode 100644 index 43040b0f9..000000000 --- a/testing/Android.bp +++ /dev/null @@ -1,24 +0,0 @@ -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -bootstrap_go_package { - name: "soong-testing", - pkgPath: "android/soong/testing", - deps: [ - "blueprint", - "soong-android", - "soong-testing-code_metadata_internal_proto", - "soong-testing-test_spec_proto", - - ], - srcs: [ - "all_code_metadata.go", - "all_test_specs.go", - "code_metadata.go", - "test_spec.go", - "init.go", - "test.go", - ], - pluginFor: ["soong_build"], -} diff --git a/testing/OWNERS b/testing/OWNERS deleted file mode 100644 index 03bcdf1c4..000000000 --- a/testing/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -dariofreni@google.com -joeo@google.com -ronish@google.com -caditya@google.com diff --git a/testing/all_code_metadata.go b/testing/all_code_metadata.go deleted file mode 100644 index e89b28155..000000000 --- a/testing/all_code_metadata.go +++ /dev/null @@ -1,46 +0,0 @@ -package testing - -import ( - "android/soong/android" -) - -const fileContainingCodeMetadataFilePaths = "all_code_metadata_paths.rsp" -const allCodeMetadataFile = "all_code_metadata.pb" - -func AllCodeMetadataFactory() android.Singleton { - return &allCodeMetadataSingleton{} -} - -type allCodeMetadataSingleton struct { - // Path where the collected metadata is stored after successful validation. - outputPath android.OutputPath -} - -func (this *allCodeMetadataSingleton) GenerateBuildActions(ctx android.SingletonContext) { - var intermediateMetadataPaths android.Paths - - ctx.VisitAllModules( - func(module android.Module) { - if metadata, ok := android.OtherModuleProvider(ctx, module, CodeMetadataProviderKey); ok { - intermediateMetadataPaths = append(intermediateMetadataPaths, metadata.IntermediatePath) - } - }, - ) - - rspFile := android.PathForOutput(ctx, fileContainingCodeMetadataFilePaths) - this.outputPath = android.PathForOutput(ctx, ownershipDirectory, allCodeMetadataFile) - - rule := android.NewRuleBuilder(pctx, ctx) - cmd := rule.Command(). - BuiltTool("metadata"). - FlagWithArg("-rule ", "code_metadata"). - FlagWithRspFileInputList("-inputFile ", rspFile, intermediateMetadataPaths) - cmd.FlagWithOutput("-outputFile ", this.outputPath) - rule.Build("all_code_metadata_rule", "Generate all code metadata") - - ctx.Phony("all_code_metadata", this.outputPath) -} - -func (this *allCodeMetadataSingleton) MakeVars(ctx android.MakeVarsContext) { - ctx.DistForGoal("code_metadata", this.outputPath) -} diff --git a/testing/all_test_specs.go b/testing/all_test_specs.go deleted file mode 100644 index 68f24d15c..000000000 --- a/testing/all_test_specs.go +++ /dev/null @@ -1,44 +0,0 @@ -package testing - -import ( - "android/soong/android" -) - -const ownershipDirectory = "ownership" -const fileContainingFilePaths = "all_test_spec_paths.rsp" -const allTestSpecsFile = "all_test_specs.pb" - -func AllTestSpecsFactory() android.Singleton { - return &allTestSpecsSingleton{} -} - -type allTestSpecsSingleton struct { - // Path where the collected metadata is stored after successful validation. - outputPath android.OutputPath -} - -func (this *allTestSpecsSingleton) GenerateBuildActions(ctx android.SingletonContext) { - var intermediateMetadataPaths android.Paths - - ctx.VisitAllModules(func(module android.Module) { - if metadata, ok := android.OtherModuleProvider(ctx, module, TestSpecProviderKey); ok { - intermediateMetadataPaths = append(intermediateMetadataPaths, metadata.IntermediatePath) - } - }) - - rspFile := android.PathForOutput(ctx, fileContainingFilePaths) - this.outputPath = android.PathForOutput(ctx, ownershipDirectory, allTestSpecsFile) - - rule := android.NewRuleBuilder(pctx, ctx) - cmd := rule.Command(). - BuiltTool("metadata"). - FlagWithArg("-rule ", "test_spec"). - FlagWithRspFileInputList("-inputFile ", rspFile, intermediateMetadataPaths) - cmd.FlagWithOutput("-outputFile ", this.outputPath) - rule.Build("all_test_specs_rule", "Generate all test specifications") - ctx.Phony("all_test_specs", this.outputPath) -} - -func (this *allTestSpecsSingleton) MakeVars(ctx android.MakeVarsContext) { - ctx.DistForGoal("test_specs", this.outputPath) -} diff --git a/testing/code_metadata.go b/testing/code_metadata.go deleted file mode 100644 index 11ba43037..000000000 --- a/testing/code_metadata.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020 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 testing - -import ( - "path/filepath" - - "android/soong/android" - "android/soong/testing/code_metadata_internal_proto" - "github.com/google/blueprint" - - "google.golang.org/protobuf/proto" -) - -func CodeMetadataFactory() android.Module { - module := &CodeMetadataModule{} - - android.InitAndroidModule(module) - android.InitDefaultableModule(module) - module.AddProperties(&module.properties) - - return module -} - -type CodeMetadataModule struct { - android.ModuleBase - android.DefaultableModuleBase - - // Properties for "code_metadata" - properties struct { - // Specifies the name of the code_config. - Name string - // Specifies the team ID. - TeamId string - // Specifies the list of modules that this code_metadata covers. - Code []string - // An optional field to specify if multiple ownerships for source files is allowed. - MultiOwnership bool - } -} - -type codeDepTagType struct { - blueprint.BaseDependencyTag -} - -var codeDepTag = codeDepTagType{} - -func (module *CodeMetadataModule) DepsMutator(ctx android.BottomUpMutatorContext) { - // Validate Properties - if len(module.properties.TeamId) == 0 { - ctx.PropertyErrorf( - "TeamId", - "Team Id not found in the code_metadata module. Hint: Maybe the teamId property hasn't been properly specified.", - ) - } - if !isInt(module.properties.TeamId) { - ctx.PropertyErrorf( - "TeamId", "Invalid value for Team ID. The Team ID must be an integer.", - ) - } - if len(module.properties.Code) == 0 { - ctx.PropertyErrorf( - "Code", - "Targets to be attributed cannot be empty. Hint: Maybe the code property hasn't been properly specified.", - ) - } - ctx.AddDependency(ctx.Module(), codeDepTag, module.properties.Code...) -} - -// Provider published by CodeMetadata -type CodeMetadataProviderData struct { - IntermediatePath android.WritablePath -} - -var CodeMetadataProviderKey = blueprint.NewProvider[CodeMetadataProviderData]() - -func (module *CodeMetadataModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { - metadataList := make( - []*code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership, 0, - len(module.properties.Code), - ) - bpFilePath := filepath.Join(ctx.ModuleDir(), ctx.BlueprintsFile()) - - for _, m := range ctx.GetDirectDepsWithTag(codeDepTag) { - targetName := m.Name() - var moduleSrcs []string - if srcsFileInfo, ok := android.OtherModuleProvider(ctx, m, blueprint.SrcsFileProviderKey); ok { - moduleSrcs = srcsFileInfo.SrcPaths - } - if module.properties.MultiOwnership { - metadata := &code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership{ - TargetName: &targetName, - TrendyTeamId: &module.properties.TeamId, - Path: &bpFilePath, - MultiOwnership: &module.properties.MultiOwnership, - SourceFiles: moduleSrcs, - } - metadataList = append(metadataList, metadata) - } else { - metadata := &code_metadata_internal_proto.CodeMetadataInternal_TargetOwnership{ - TargetName: &targetName, - TrendyTeamId: &module.properties.TeamId, - Path: &bpFilePath, - SourceFiles: moduleSrcs, - } - metadataList = append(metadataList, metadata) - } - - } - codeMetadata := &code_metadata_internal_proto.CodeMetadataInternal{TargetOwnershipList: metadataList} - protoData, err := proto.Marshal(codeMetadata) - if err != nil { - ctx.ModuleErrorf("Error marshaling code metadata: %s", err.Error()) - return - } - intermediatePath := android.PathForModuleOut( - ctx, "intermediateCodeMetadata.pb", - ) - android.WriteFileRuleVerbatim(ctx, intermediatePath, string(protoData)) - - android.SetProvider(ctx, - CodeMetadataProviderKey, - CodeMetadataProviderData{IntermediatePath: intermediatePath}, - ) -} diff --git a/testing/code_metadata_internal_proto/Android.bp b/testing/code_metadata_internal_proto/Android.bp deleted file mode 100644 index 396e44f52..000000000 --- a/testing/code_metadata_internal_proto/Android.bp +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 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 { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -bootstrap_go_package { - name: "soong-testing-code_metadata_internal_proto", - pkgPath: "android/soong/testing/code_metadata_internal_proto", - deps: [ - "golang-protobuf-reflect-protoreflect", - "golang-protobuf-runtime-protoimpl", - ], - srcs: [ - "code_metadata_internal.pb.go", - ], - visibility: [ - "//build/make/tools/metadata", - "//build/soong:__subpackages__", - ], -} diff --git a/testing/code_metadata_internal_proto/OWNERS b/testing/code_metadata_internal_proto/OWNERS deleted file mode 100644 index 03bcdf1c4..000000000 --- a/testing/code_metadata_internal_proto/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -dariofreni@google.com -joeo@google.com -ronish@google.com -caditya@google.com diff --git a/testing/code_metadata_internal_proto/code_metadata_internal.pb.go b/testing/code_metadata_internal_proto/code_metadata_internal.pb.go deleted file mode 100644 index ecb8b867a..000000000 --- a/testing/code_metadata_internal_proto/code_metadata_internal.pb.go +++ /dev/null @@ -1,277 +0,0 @@ -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: code_metadata_internal.proto - -package code_metadata_internal_proto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CodeMetadataInternal struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of all code targets and their metadata. - TargetOwnershipList []*CodeMetadataInternal_TargetOwnership `protobuf:"bytes,1,rep,name=target_ownership_list,json=targetOwnershipList" json:"target_ownership_list,omitempty"` -} - -func (x *CodeMetadataInternal) Reset() { - *x = CodeMetadataInternal{} - if protoimpl.UnsafeEnabled { - mi := &file_code_metadata_internal_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CodeMetadataInternal) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CodeMetadataInternal) ProtoMessage() {} - -func (x *CodeMetadataInternal) ProtoReflect() protoreflect.Message { - mi := &file_code_metadata_internal_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CodeMetadataInternal.ProtoReflect.Descriptor instead. -func (*CodeMetadataInternal) Descriptor() ([]byte, []int) { - return file_code_metadata_internal_proto_rawDescGZIP(), []int{0} -} - -func (x *CodeMetadataInternal) GetTargetOwnershipList() []*CodeMetadataInternal_TargetOwnership { - if x != nil { - return x.TargetOwnershipList - } - return nil -} - -type CodeMetadataInternal_TargetOwnership struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // REQUIRED: Name of the build target - TargetName *string `protobuf:"bytes,1,opt,name=target_name,json=targetName" json:"target_name,omitempty"` - // REQUIRED: Code location of the target. - // To be used to support legacy/backup systems that use OWNERS file and is - // also required for our dashboard to support per code location basis UI - Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - // REQUIRED: Team ID of the team that owns this target. - TrendyTeamId *string `protobuf:"bytes,3,opt,name=trendy_team_id,json=trendyTeamId" json:"trendy_team_id,omitempty"` - // OPTIONAL: The src files of the target. - // To be used to determine ownership of a file for ownership - SourceFiles []string `protobuf:"bytes,4,rep,name=source_files,json=sourceFiles" json:"source_files,omitempty"` - // OPTIONAL: Specify if multiple ownerships of the source files are allowed. - MultiOwnership *bool `protobuf:"varint,5,opt,name=multi_ownership,json=multiOwnership" json:"multi_ownership,omitempty"` -} - -func (x *CodeMetadataInternal_TargetOwnership) Reset() { - *x = CodeMetadataInternal_TargetOwnership{} - if protoimpl.UnsafeEnabled { - mi := &file_code_metadata_internal_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CodeMetadataInternal_TargetOwnership) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CodeMetadataInternal_TargetOwnership) ProtoMessage() {} - -func (x *CodeMetadataInternal_TargetOwnership) ProtoReflect() protoreflect.Message { - mi := &file_code_metadata_internal_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CodeMetadataInternal_TargetOwnership.ProtoReflect.Descriptor instead. -func (*CodeMetadataInternal_TargetOwnership) Descriptor() ([]byte, []int) { - return file_code_metadata_internal_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *CodeMetadataInternal_TargetOwnership) GetTargetName() string { - if x != nil && x.TargetName != nil { - return *x.TargetName - } - return "" -} - -func (x *CodeMetadataInternal_TargetOwnership) GetPath() string { - if x != nil && x.Path != nil { - return *x.Path - } - return "" -} - -func (x *CodeMetadataInternal_TargetOwnership) GetTrendyTeamId() string { - if x != nil && x.TrendyTeamId != nil { - return *x.TrendyTeamId - } - return "" -} - -func (x *CodeMetadataInternal_TargetOwnership) GetSourceFiles() []string { - if x != nil { - return x.SourceFiles - } - return nil -} - -func (x *CodeMetadataInternal_TargetOwnership) GetMultiOwnership() bool { - if x != nil && x.MultiOwnership != nil { - return *x.MultiOwnership - } - return false -} - -var File_code_metadata_internal_proto protoreflect.FileDescriptor - -var file_code_metadata_internal_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, - 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x02, 0x0a, - 0x14, 0x43, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x76, 0x0a, 0x15, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, - 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0xb8, 0x01, - 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, - 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x79, - 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x74, 0x72, 0x65, 0x6e, 0x64, 0x79, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, - 0x27, 0x0a, 0x0f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x4f, - 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x42, 0x34, 0x5a, 0x32, 0x61, 0x6e, 0x64, 0x72, - 0x6f, 0x69, 0x64, 0x2f, 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, -} - -var ( - file_code_metadata_internal_proto_rawDescOnce sync.Once - file_code_metadata_internal_proto_rawDescData = file_code_metadata_internal_proto_rawDesc -) - -func file_code_metadata_internal_proto_rawDescGZIP() []byte { - file_code_metadata_internal_proto_rawDescOnce.Do(func() { - file_code_metadata_internal_proto_rawDescData = protoimpl.X.CompressGZIP(file_code_metadata_internal_proto_rawDescData) - }) - return file_code_metadata_internal_proto_rawDescData -} - -var file_code_metadata_internal_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_code_metadata_internal_proto_goTypes = []interface{}{ - (*CodeMetadataInternal)(nil), // 0: code_metadata_internal_proto.CodeMetadataInternal - (*CodeMetadataInternal_TargetOwnership)(nil), // 1: code_metadata_internal_proto.CodeMetadataInternal.TargetOwnership -} -var file_code_metadata_internal_proto_depIdxs = []int32{ - 1, // 0: code_metadata_internal_proto.CodeMetadataInternal.target_ownership_list:type_name -> code_metadata_internal_proto.CodeMetadataInternal.TargetOwnership - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_code_metadata_internal_proto_init() } -func file_code_metadata_internal_proto_init() { - if File_code_metadata_internal_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_code_metadata_internal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeMetadataInternal); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_code_metadata_internal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeMetadataInternal_TargetOwnership); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_code_metadata_internal_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_code_metadata_internal_proto_goTypes, - DependencyIndexes: file_code_metadata_internal_proto_depIdxs, - MessageInfos: file_code_metadata_internal_proto_msgTypes, - }.Build() - File_code_metadata_internal_proto = out.File - file_code_metadata_internal_proto_rawDesc = nil - file_code_metadata_internal_proto_goTypes = nil - file_code_metadata_internal_proto_depIdxs = nil -} diff --git a/testing/code_metadata_internal_proto/code_metadata_internal.proto b/testing/code_metadata_internal_proto/code_metadata_internal.proto deleted file mode 100644 index 14edc0f9b..000000000 --- a/testing/code_metadata_internal_proto/code_metadata_internal.proto +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -syntax = "proto2"; -package code_metadata_internal_proto; -option go_package = "android/soong/testing/code_metadata_internal_proto"; - -message CodeMetadataInternal { - - message TargetOwnership { - // REQUIRED: Name of the build target - optional string target_name = 1; - - // REQUIRED: Code location of the target. - // To be used to support legacy/backup systems that use OWNERS file and is - // also required for our dashboard to support per code location basis UI - optional string path = 2; - - // REQUIRED: Team ID of the team that owns this target. - optional string trendy_team_id = 3; - - // OPTIONAL: The src files of the target. - // To be used to determine ownership of a file for ownership - repeated string source_files = 4; - - // OPTIONAL: Specify if multiple ownerships of the source files are allowed. - optional bool multi_ownership = 5; - } - - // List of all code targets and their metadata. - repeated TargetOwnership target_ownership_list = 1; -} diff --git a/testing/code_metadata_internal_proto/regen.sh b/testing/code_metadata_internal_proto/regen.sh deleted file mode 100644 index f101a02b2..000000000 --- a/testing/code_metadata_internal_proto/regen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -aprotoc --go_out=paths=source_relative:. code_metadata_internal.proto diff --git a/testing/code_metadata_proto/Android.bp b/testing/code_metadata_proto/Android.bp deleted file mode 100644 index ae41d4aa1..000000000 --- a/testing/code_metadata_proto/Android.bp +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 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 { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -bootstrap_go_package { - name: "soong-testing-code_metadata_proto", - pkgPath: "android/soong/testing/code_metadata_proto", - deps: [ - "golang-protobuf-reflect-protoreflect", - "golang-protobuf-runtime-protoimpl", - ], - srcs: [ - "code_metadata.pb.go", - ], - visibility: ["//build/make/tools/metadata"], -} - -python_library_host { - name: "code-metadata-proto-py", - pkg_path: "code_metadata", - srcs: [ - "code_metadata.proto", - ], - libs: [ - "libprotobuf-python", - ], - proto: { - canonical_path_from_root: false, - }, - visibility: ["//tools/asuite/team_build_scripts"], -} diff --git a/testing/code_metadata_proto/OWNERS b/testing/code_metadata_proto/OWNERS deleted file mode 100644 index 03bcdf1c4..000000000 --- a/testing/code_metadata_proto/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -dariofreni@google.com -joeo@google.com -ronish@google.com -caditya@google.com diff --git a/testing/code_metadata_proto/code_metadata.pb.go b/testing/code_metadata_proto/code_metadata.pb.go deleted file mode 100644 index 711bf7a82..000000000 --- a/testing/code_metadata_proto/code_metadata.pb.go +++ /dev/null @@ -1,263 +0,0 @@ -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: code_metadata.proto - -package code_metadata_proto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CodeMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of all code targets and their metadata. - TargetOwnershipList []*CodeMetadata_TargetOwnership `protobuf:"bytes,1,rep,name=target_ownership_list,json=targetOwnershipList" json:"target_ownership_list,omitempty"` -} - -func (x *CodeMetadata) Reset() { - *x = CodeMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_code_metadata_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CodeMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CodeMetadata) ProtoMessage() {} - -func (x *CodeMetadata) ProtoReflect() protoreflect.Message { - mi := &file_code_metadata_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CodeMetadata.ProtoReflect.Descriptor instead. -func (*CodeMetadata) Descriptor() ([]byte, []int) { - return file_code_metadata_proto_rawDescGZIP(), []int{0} -} - -func (x *CodeMetadata) GetTargetOwnershipList() []*CodeMetadata_TargetOwnership { - if x != nil { - return x.TargetOwnershipList - } - return nil -} - -type CodeMetadata_TargetOwnership struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // REQUIRED: Name of the build target - TargetName *string `protobuf:"bytes,1,opt,name=target_name,json=targetName" json:"target_name,omitempty"` - // REQUIRED: Code location of the target. - // To be used to support legacy/backup systems that use OWNERS file and is - // also required for our dashboard to support per code location basis UI - Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - // REQUIRED: Team ID of the team that owns this target. - TrendyTeamId *string `protobuf:"bytes,3,opt,name=trendy_team_id,json=trendyTeamId" json:"trendy_team_id,omitempty"` - // OPTIONAL: The src files of the target. - // To be used to determine ownership of a file for ownership - SourceFiles []string `protobuf:"bytes,4,rep,name=source_files,json=sourceFiles" json:"source_files,omitempty"` -} - -func (x *CodeMetadata_TargetOwnership) Reset() { - *x = CodeMetadata_TargetOwnership{} - if protoimpl.UnsafeEnabled { - mi := &file_code_metadata_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CodeMetadata_TargetOwnership) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CodeMetadata_TargetOwnership) ProtoMessage() {} - -func (x *CodeMetadata_TargetOwnership) ProtoReflect() protoreflect.Message { - mi := &file_code_metadata_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CodeMetadata_TargetOwnership.ProtoReflect.Descriptor instead. -func (*CodeMetadata_TargetOwnership) Descriptor() ([]byte, []int) { - return file_code_metadata_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *CodeMetadata_TargetOwnership) GetTargetName() string { - if x != nil && x.TargetName != nil { - return *x.TargetName - } - return "" -} - -func (x *CodeMetadata_TargetOwnership) GetPath() string { - if x != nil && x.Path != nil { - return *x.Path - } - return "" -} - -func (x *CodeMetadata_TargetOwnership) GetTrendyTeamId() string { - if x != nil && x.TrendyTeamId != nil { - return *x.TrendyTeamId - } - return "" -} - -func (x *CodeMetadata_TargetOwnership) GetSourceFiles() []string { - if x != nil { - return x.SourceFiles - } - return nil -} - -var File_code_metadata_proto protoreflect.FileDescriptor - -var file_code_metadata_proto_rawDesc = []byte{ - 0x0a, 0x13, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x02, 0x0a, 0x0c, 0x43, - 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x65, 0x0a, 0x15, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x5f, - 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x64, - 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x13, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, - 0x73, 0x74, 0x1a, 0x8f, 0x01, 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x74, - 0x72, 0x65, 0x6e, 0x64, 0x79, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x79, 0x54, 0x65, 0x61, 0x6d, 0x49, - 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, - 0x69, 0x6c, 0x65, 0x73, 0x42, 0x2b, 0x5a, 0x29, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f, - 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x63, 0x6f, - 0x64, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, -} - -var ( - file_code_metadata_proto_rawDescOnce sync.Once - file_code_metadata_proto_rawDescData = file_code_metadata_proto_rawDesc -) - -func file_code_metadata_proto_rawDescGZIP() []byte { - file_code_metadata_proto_rawDescOnce.Do(func() { - file_code_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_code_metadata_proto_rawDescData) - }) - return file_code_metadata_proto_rawDescData -} - -var file_code_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_code_metadata_proto_goTypes = []interface{}{ - (*CodeMetadata)(nil), // 0: code_metadata_proto.CodeMetadata - (*CodeMetadata_TargetOwnership)(nil), // 1: code_metadata_proto.CodeMetadata.TargetOwnership -} -var file_code_metadata_proto_depIdxs = []int32{ - 1, // 0: code_metadata_proto.CodeMetadata.target_ownership_list:type_name -> code_metadata_proto.CodeMetadata.TargetOwnership - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_code_metadata_proto_init() } -func file_code_metadata_proto_init() { - if File_code_metadata_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_code_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_code_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeMetadata_TargetOwnership); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_code_metadata_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_code_metadata_proto_goTypes, - DependencyIndexes: file_code_metadata_proto_depIdxs, - MessageInfos: file_code_metadata_proto_msgTypes, - }.Build() - File_code_metadata_proto = out.File - file_code_metadata_proto_rawDesc = nil - file_code_metadata_proto_goTypes = nil - file_code_metadata_proto_depIdxs = nil -} diff --git a/testing/code_metadata_proto/code_metadata.proto b/testing/code_metadata_proto/code_metadata.proto deleted file mode 100644 index 254836300..000000000 --- a/testing/code_metadata_proto/code_metadata.proto +++ /dev/null @@ -1,37 +0,0 @@ -// 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. - -syntax = "proto2"; -package code_metadata_proto; -option go_package = "android/soong/testing/code_metadata_proto"; - -message CodeMetadata { - - message TargetOwnership { - // REQUIRED: Name of the build target - optional string target_name = 1; - - // REQUIRED: Code location of the target. - // To be used to support legacy/backup systems that use OWNERS file and is - // also required for our dashboard to support per code location basis UI - optional string path = 2; - - // REQUIRED: Team ID of the team that owns this target. - optional string trendy_team_id = 3; - - // OPTIONAL: The src files of the target. - // To be used to determine ownership of a file for ownership - repeated string source_files = 4; - } - - // List of all code targets and their metadata. - repeated TargetOwnership target_ownership_list = 1; -} diff --git a/testing/code_metadata_proto/regen.sh b/testing/code_metadata_proto/regen.sh deleted file mode 100644 index ffe06f7e2..000000000 --- a/testing/code_metadata_proto/regen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -aprotoc --go_out=paths=source_relative:. code_metadata.proto diff --git a/testing/init.go b/testing/init.go deleted file mode 100644 index edcbf59b4..000000000 --- a/testing/init.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2022 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 testing - -import ( - "android/soong/android" -) - -var ( - pctx = android.NewPackageContext("android/soong/testing") -) - -func init() { - RegisterBuildComponents(android.InitRegistrationContext) - pctx.HostBinToolVariable("metadata", "metadata") -} - -func RegisterBuildComponents(ctx android.RegistrationContext) { - ctx.RegisterModuleType("code_metadata", CodeMetadataFactory) - ctx.RegisterModuleType("test_spec", TestSpecFactory) - ctx.RegisterParallelSingletonType("all_code_metadata", AllCodeMetadataFactory) - ctx.RegisterParallelSingletonType("all_test_specs", AllTestSpecsFactory) -} diff --git a/testing/test.go b/testing/test.go deleted file mode 100644 index cd97a8fac..000000000 --- a/testing/test.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2023 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 testing - -import ( - "android/soong/android" -) - -var PrepareForTestWithTestingBuildComponents = android.FixtureRegisterWithContext(RegisterBuildComponents) diff --git a/testing/test_spec.go b/testing/test_spec.go deleted file mode 100644 index 4d885c6de..000000000 --- a/testing/test_spec.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2020 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 testing - -import ( - "path/filepath" - "strconv" - - "android/soong/android" - "android/soong/testing/test_spec_proto" - "google.golang.org/protobuf/proto" - - "github.com/google/blueprint" -) - -// ErrTestModuleDataNotFound is the error message for missing test module provider data. -const ErrTestModuleDataNotFound = "The module '%s' does not provide test specification data. Hint: This issue could arise if either the module is not a valid testing module or if it lacks the required 'TestModuleProviderKey' provider.\n" - -func TestSpecFactory() android.Module { - module := &TestSpecModule{} - - android.InitAndroidModule(module) - android.InitDefaultableModule(module) - module.AddProperties(&module.properties) - - return module -} - -type TestSpecModule struct { - android.ModuleBase - android.DefaultableModuleBase - - // Properties for "test_spec" - properties struct { - // Specifies the name of the test config. - Name string - // Specifies the team ID. - TeamId string - // Specifies the list of tests covered under this module. - Tests []string - } -} - -type testsDepTagType struct { - blueprint.BaseDependencyTag -} - -var testsDepTag = testsDepTagType{} - -func (module *TestSpecModule) DepsMutator(ctx android.BottomUpMutatorContext) { - // Validate Properties - if len(module.properties.TeamId) == 0 { - ctx.PropertyErrorf("TeamId", "Team Id not found in the test_spec module. Hint: Maybe the TeamId property hasn't been properly specified.") - } - if !isInt(module.properties.TeamId) { - ctx.PropertyErrorf("TeamId", "Invalid value for Team ID. The Team ID must be an integer.") - } - if len(module.properties.Tests) == 0 { - ctx.PropertyErrorf("Tests", "Expected to attribute some test but none found. Hint: Maybe the test property hasn't been properly specified.") - } - ctx.AddDependency(ctx.Module(), testsDepTag, module.properties.Tests...) -} -func isInt(s string) bool { - _, err := strconv.Atoi(s) - return err == nil -} - -// Provider published by TestSpec -type TestSpecProviderData struct { - IntermediatePath android.WritablePath -} - -var TestSpecProviderKey = blueprint.NewProvider[TestSpecProviderData]() - -type TestModuleProviderData struct { -} - -var TestModuleProviderKey = blueprint.NewProvider[TestModuleProviderData]() - -func (module *TestSpecModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { - for _, m := range ctx.GetDirectDepsWithTag(testsDepTag) { - if _, ok := android.OtherModuleProvider(ctx, m, TestModuleProviderKey); !ok { - ctx.ModuleErrorf(ErrTestModuleDataNotFound, m.Name()) - } - } - bpFilePath := filepath.Join(ctx.ModuleDir(), ctx.BlueprintsFile()) - metadataList := make( - []*test_spec_proto.TestSpec_OwnershipMetadata, 0, - len(module.properties.Tests), - ) - for _, test := range module.properties.Tests { - targetName := test - metadata := test_spec_proto.TestSpec_OwnershipMetadata{ - TrendyTeamId: &module.properties.TeamId, - TargetName: &targetName, - Path: &bpFilePath, - } - metadataList = append(metadataList, &metadata) - } - intermediatePath := android.PathForModuleOut( - ctx, "intermediateTestSpecMetadata.pb", - ) - testSpecMetadata := test_spec_proto.TestSpec{OwnershipMetadataList: metadataList} - protoData, err := proto.Marshal(&testSpecMetadata) - if err != nil { - ctx.ModuleErrorf("Error: %s", err.Error()) - } - android.WriteFileRuleVerbatim(ctx, intermediatePath, string(protoData)) - - android.SetProvider(ctx, - TestSpecProviderKey, TestSpecProviderData{ - IntermediatePath: intermediatePath, - }, - ) -} diff --git a/testing/test_spec_proto/Android.bp b/testing/test_spec_proto/Android.bp deleted file mode 100644 index 1070d1a9c..000000000 --- a/testing/test_spec_proto/Android.bp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 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 { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -bootstrap_go_package { - name: "soong-testing-test_spec_proto", - pkgPath: "android/soong/testing/test_spec_proto", - deps: [ - "golang-protobuf-reflect-protoreflect", - "golang-protobuf-runtime-protoimpl", - ], - srcs: [ - "test_spec.pb.go", - ], - visibility: [ - "//build/make/tools/metadata", - "//build/soong:__subpackages__", - "//vendor:__subpackages__", - ], -} - -python_library_host { - name: "test-spec-proto-py", - pkg_path: "test_spec", - srcs: [ - "test_spec.proto", - ], - libs: [ - "libprotobuf-python", - ], - proto: { - canonical_path_from_root: false, - }, - visibility: ["//tools/asuite/team_build_scripts"], -} diff --git a/testing/test_spec_proto/OWNERS b/testing/test_spec_proto/OWNERS deleted file mode 100644 index 03bcdf1c4..000000000 --- a/testing/test_spec_proto/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -dariofreni@google.com -joeo@google.com -ronish@google.com -caditya@google.com diff --git a/testing/test_spec_proto/regen.sh b/testing/test_spec_proto/regen.sh deleted file mode 100644 index 2cf820375..000000000 --- a/testing/test_spec_proto/regen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -aprotoc --go_out=paths=source_relative:. test_spec.proto diff --git a/testing/test_spec_proto/test_spec.pb.go b/testing/test_spec_proto/test_spec.pb.go deleted file mode 100644 index 5cce60029..000000000 --- a/testing/test_spec_proto/test_spec.pb.go +++ /dev/null @@ -1,244 +0,0 @@ -// 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: test_spec.proto - -package test_spec_proto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type TestSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of all test targets and their metadata. - OwnershipMetadataList []*TestSpec_OwnershipMetadata `protobuf:"bytes,1,rep,name=ownership_metadata_list,json=ownershipMetadataList" json:"ownership_metadata_list,omitempty"` -} - -func (x *TestSpec) Reset() { - *x = TestSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_test_spec_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestSpec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestSpec) ProtoMessage() {} - -func (x *TestSpec) ProtoReflect() protoreflect.Message { - mi := &file_test_spec_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TestSpec.ProtoReflect.Descriptor instead. -func (*TestSpec) Descriptor() ([]byte, []int) { - return file_test_spec_proto_rawDescGZIP(), []int{0} -} - -func (x *TestSpec) GetOwnershipMetadataList() []*TestSpec_OwnershipMetadata { - if x != nil { - return x.OwnershipMetadataList - } - return nil -} - -type TestSpec_OwnershipMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TargetName *string `protobuf:"bytes,1,opt,name=target_name,json=targetName" json:"target_name,omitempty"` - Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - TrendyTeamId *string `protobuf:"bytes,3,opt,name=trendy_team_id,json=trendyTeamId" json:"trendy_team_id,omitempty"` -} - -func (x *TestSpec_OwnershipMetadata) Reset() { - *x = TestSpec_OwnershipMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_test_spec_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestSpec_OwnershipMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestSpec_OwnershipMetadata) ProtoMessage() {} - -func (x *TestSpec_OwnershipMetadata) ProtoReflect() protoreflect.Message { - mi := &file_test_spec_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TestSpec_OwnershipMetadata.ProtoReflect.Descriptor instead. -func (*TestSpec_OwnershipMetadata) Descriptor() ([]byte, []int) { - return file_test_spec_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *TestSpec_OwnershipMetadata) GetTargetName() string { - if x != nil && x.TargetName != nil { - return *x.TargetName - } - return "" -} - -func (x *TestSpec_OwnershipMetadata) GetPath() string { - if x != nil && x.Path != nil { - return *x.Path - } - return "" -} - -func (x *TestSpec_OwnershipMetadata) GetTrendyTeamId() string { - if x != nil && x.TrendyTeamId != nil { - return *x.TrendyTeamId - } - return "" -} - -var File_test_spec_proto protoreflect.FileDescriptor - -var file_test_spec_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xdf, 0x01, 0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, - 0x63, 0x0a, 0x17, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x73, 0x68, 0x69, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x15, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x6e, 0x0a, 0x11, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, - 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x24, - 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x79, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x79, 0x54, 0x65, - 0x61, 0x6d, 0x49, 0x64, 0x42, 0x27, 0x5a, 0x25, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f, - 0x73, 0x6f, 0x6f, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, -} - -var ( - file_test_spec_proto_rawDescOnce sync.Once - file_test_spec_proto_rawDescData = file_test_spec_proto_rawDesc -) - -func file_test_spec_proto_rawDescGZIP() []byte { - file_test_spec_proto_rawDescOnce.Do(func() { - file_test_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_spec_proto_rawDescData) - }) - return file_test_spec_proto_rawDescData -} - -var file_test_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_test_spec_proto_goTypes = []interface{}{ - (*TestSpec)(nil), // 0: test_spec_proto.TestSpec - (*TestSpec_OwnershipMetadata)(nil), // 1: test_spec_proto.TestSpec.OwnershipMetadata -} -var file_test_spec_proto_depIdxs = []int32{ - 1, // 0: test_spec_proto.TestSpec.ownership_metadata_list:type_name -> test_spec_proto.TestSpec.OwnershipMetadata - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_test_spec_proto_init() } -func file_test_spec_proto_init() { - if File_test_spec_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_test_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestSpec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_test_spec_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestSpec_OwnershipMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_test_spec_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_test_spec_proto_goTypes, - DependencyIndexes: file_test_spec_proto_depIdxs, - MessageInfos: file_test_spec_proto_msgTypes, - }.Build() - File_test_spec_proto = out.File - file_test_spec_proto_rawDesc = nil - file_test_spec_proto_goTypes = nil - file_test_spec_proto_depIdxs = nil -} diff --git a/testing/test_spec_proto/test_spec.proto b/testing/test_spec_proto/test_spec.proto deleted file mode 100644 index 86bc78954..000000000 --- a/testing/test_spec_proto/test_spec.proto +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - -syntax = "proto2"; -package test_spec_proto; -option go_package = "android/soong/testing/test_spec_proto"; - -message TestSpec { - - message OwnershipMetadata { - // REQUIRED: Name of the build target - optional string target_name = 1; - - // REQUIRED: Code location of the target. - // To be used to support legacy/backup systems that use OWNERS file and is - // also required for our dashboard to support per code location basis UI - optional string path = 2; - - // REQUIRED: Team ID of the team that owns this target. - optional string trendy_team_id = 3; - } - - // List of all test targets and their metadata. - repeated OwnershipMetadata ownership_metadata_list = 1; -} |