diff options
author | 2021-03-18 01:32:07 +0000 | |
---|---|---|
committer | 2021-03-18 01:43:50 +0000 | |
commit | 94b6960b39e8fe9fdd6bbfac338659dd2b48aa79 (patch) | |
tree | cc7f012761686519bc2949c844456c7d67bc5a08 | |
parent | 45a497180892a47cd69758b9d9126b7c608485ce (diff) |
Add preparers for xml
Bug: 181070625
Test: m nothing
Change-Id: I150889a025e1c23eebe1e2764b07fdbd2babef49
-rw-r--r-- | xml/Android.bp | 1 | ||||
-rw-r--r-- | xml/testing.go | 19 | ||||
-rw-r--r-- | xml/xml.go | 6 |
3 files changed, 25 insertions, 1 deletions
diff --git a/xml/Android.bp b/xml/Android.bp index a5e5f4c7f..154293032 100644 --- a/xml/Android.bp +++ b/xml/Android.bp @@ -13,6 +13,7 @@ bootstrap_go_package { "soong-etc", ], srcs: [ + "testing.go", "xml.go", ], testSrcs: [ diff --git a/xml/testing.go b/xml/testing.go new file mode 100644 index 000000000..1d09f1055 --- /dev/null +++ b/xml/testing.go @@ -0,0 +1,19 @@ +// 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 xml + +import "android/soong/android" + +var PreparerForTestWithXmlBuildComponents = android.FixtureRegisterWithContext(registerXmlBuildComponents) diff --git a/xml/xml.go b/xml/xml.go index 8810ae4d5..c28107847 100644 --- a/xml/xml.go +++ b/xml/xml.go @@ -53,10 +53,14 @@ var ( ) func init() { - android.RegisterModuleType("prebuilt_etc_xml", PrebuiltEtcXmlFactory) + registerXmlBuildComponents(android.InitRegistrationContext) pctx.HostBinToolVariable("XmlLintCmd", "xmllint") } +func registerXmlBuildComponents(ctx android.RegistrationContext) { + ctx.RegisterModuleType("prebuilt_etc_xml", PrebuiltEtcXmlFactory) +} + type prebuiltEtcXmlProperties struct { // Optional DTD that will be used to validate the xml file. Schema *string `android:"path"` |