Consistently use Bool instead of proptools.Bool
Use Bool instead of proptools.Bool and String instead of proptools.String.
Test: m checkbuild
Change-Id: I32d84add9f27128c7a65413e9612fd920613584f
diff --git a/java/androidmk.go b/java/androidmk.go
index c9a05c3..204b3d9 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -19,8 +19,6 @@
"io"
"strings"
- "github.com/google/blueprint/proptools"
-
"android/soong/android"
)
@@ -77,7 +75,7 @@
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
android.WriteAndroidMkData(w, data)
- if proptools.Bool(library.deviceProperties.Hostdex) && !library.Host() {
+ if Bool(library.deviceProperties.Hostdex) && !library.Host() {
fmt.Fprintln(w, "include $(CLEAR_VARS)")
fmt.Fprintln(w, "LOCAL_MODULE := "+name+"-hostdex")
fmt.Fprintln(w, "LOCAL_IS_HOST_MODULE := true")
@@ -117,7 +115,7 @@
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
Extra: []android.AndroidMkExtraFunc{
func(w io.Writer, outputFile android.Path) {
- fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := ", !proptools.Bool(prebuilt.properties.Installable))
+ fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := ", !Bool(prebuilt.properties.Installable))
fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", prebuilt.combinedClasspathFile.String())
fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", String(prebuilt.properties.Sdk_version))
},
diff --git a/java/java.go b/java/java.go
index a2eb810..04ce469 100644
--- a/java/java.go
+++ b/java/java.go
@@ -459,14 +459,14 @@
func (j *Module) deps(ctx android.BottomUpMutatorContext) {
if ctx.Device() {
- if !proptools.Bool(j.properties.No_standard_libs) {
+ if !Bool(j.properties.No_standard_libs) {
sdkDep := decodeSdkDep(ctx, String(j.deviceProperties.Sdk_version))
if sdkDep.useDefaultLibs {
ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultBootclasspathLibraries...)
if ctx.Config().TargetOpenJDK9() {
ctx.AddDependency(ctx.Module(), systemModulesTag, config.DefaultSystemModules)
}
- if !proptools.Bool(j.properties.No_framework_libs) {
+ if !Bool(j.properties.No_framework_libs) {
ctx.AddDependency(ctx.Module(), libTag, config.DefaultLibraries...)
}
} else if sdkDep.useModule {
@@ -907,7 +907,7 @@
// Don't add kotlin-stdlib if using (on-device) renamed stdlib
// (it's expected to be on device bootclasspath)
- if !proptools.Bool(j.properties.Renamed_kotlin_stdlib) {
+ if !Bool(j.properties.Renamed_kotlin_stdlib) {
jars = append(jars, deps.kotlinStdlib...)
}
}
@@ -984,7 +984,7 @@
resArgs = append(resArgs, fileArgs...)
resDeps = append(resDeps, fileDeps...)
- if proptools.Bool(j.properties.Include_srcs) {
+ if Bool(j.properties.Include_srcs) {
srcArgs, srcDeps := SourceFilesToJarArgs(ctx, j.properties.Srcs, j.properties.Exclude_srcs)
resArgs = append(resArgs, srcArgs...)
resDeps = append(resDeps, srcDeps...)
@@ -1026,7 +1026,7 @@
}
// Use renamed kotlin standard library?
- if srcFiles.HasExt(".kt") && proptools.Bool(j.properties.Renamed_kotlin_stdlib) {
+ if srcFiles.HasExt(".kt") && Bool(j.properties.Renamed_kotlin_stdlib) {
jarjarFile := android.PathForModuleOut(ctx, "kotlin-renamed", jarName)
TransformJarJar(ctx, jarjarFile, outputFile,
android.PathForSource(ctx, "external/kotlinc/jarjar-rules.txt"))
diff --git a/java/proto.go b/java/proto.go
index 2991ad9..cfd733a 100644
--- a/java/proto.go
+++ b/java/proto.go
@@ -18,7 +18,6 @@
"strings"
"github.com/google/blueprint"
- "github.com/google/blueprint/proptools"
"android/soong/android"
)
@@ -67,7 +66,7 @@
}
func protoDeps(ctx android.BottomUpMutatorContext, p *android.ProtoProperties) {
- switch proptools.String(p.Proto.Type) {
+ switch String(p.Proto.Type) {
case "micro":
ctx.AddDependency(ctx.Module(), staticLibTag, "libprotobuf-java-micro")
case "nano":
@@ -82,14 +81,14 @@
}
default:
ctx.PropertyErrorf("proto.type", "unknown proto type %q",
- proptools.String(p.Proto.Type))
+ String(p.Proto.Type))
}
}
func protoFlags(ctx android.ModuleContext, j *CompilerProperties, p *android.ProtoProperties,
flags javaBuilderFlags) javaBuilderFlags {
- switch proptools.String(p.Proto.Type) {
+ switch String(p.Proto.Type) {
case "micro":
flags.protoOutTypeFlag = "--javamicro_out"
case "nano":
@@ -101,7 +100,7 @@
flags.protoOutTypeFlag = "--java_out"
default:
ctx.PropertyErrorf("proto.type", "unknown proto type %q",
- proptools.String(p.Proto.Type))
+ String(p.Proto.Type))
}
if len(j.Proto.Output_params) > 0 {