Skip to content

Commit

Permalink
Add preparers for xml
Browse files Browse the repository at this point in the history
Bug: 181070625
Test: m nothing
Change-Id: I150889a025e1c23eebe1e2764b07fdbd2babef49
  • Loading branch information
paulduffin committed Mar 18, 2021
1 parent 45a4971 commit 94b6960
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions xml/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ bootstrap_go_package {
"soong-etc",
],
srcs: [
"testing.go",
"xml.go",
],
testSrcs: [
Expand Down
19 changes: 19 additions & 0 deletions xml/testing.go
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 5 additions & 1 deletion xml/xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 94b6960

Please sign in to comment.