Rename common to android
Rename the "common" package to "android", because common is too
generic. Also removes all android.Android naming stutter.
Ran:
gomvpkg -from 'android/soong/common' -to 'android/soong/android'
gorename -from '"android/soong/android".AndroidModuleContext' -to 'ModuleContext'
gorename -from '"android/soong/android".AndroidBaseContext' -to 'BaseContext'
gorename -from '"android/soong/android".AndroidModuleBase' -to 'ModuleBase'
gorename -from '"android/soong/android".AndroidBottomUpMutatorContext' -to 'BottomUpMutatorContext'
gorename -from '"android/soong/android".AndroidTopDownMutatorContext' -to 'TopDownMutatorContext'
gorename -from '"android/soong/android".AndroidModule' -to 'Module'
Change-Id: I3b23590b8ce7c8a1ea1139411d84a53163288da7
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 3467e69..103d5ea 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -20,12 +20,12 @@
"path/filepath"
"strings"
- "android/soong/common"
+ "android/soong/android"
)
-func (c *Module) AndroidMk() (ret common.AndroidMkData, err error) {
+func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
ret.OutputFile = c.outputFile
- ret.Extra = append(ret.Extra, func(w io.Writer, outputFile common.Path) (err error) {
+ ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) (err error) {
fmt.Fprintln(w, "LOCAL_SANITIZE := never")
if len(c.Properties.AndroidMkSharedLibs) > 0 {
fmt.Fprintln(w, "LOCAL_SHARED_LIBRARIES := "+strings.Join(c.Properties.AndroidMkSharedLibs, " "))
@@ -36,7 +36,7 @@
callSubAndroidMk := func(obj interface{}) {
if obj != nil {
if androidmk, ok := obj.(interface {
- AndroidMk(*common.AndroidMkData)
+ AndroidMk(*android.AndroidMkData)
}); ok {
androidmk.AndroidMk(&ret)
}
@@ -56,7 +56,7 @@
return ret, nil
}
-func (library *baseLinker) AndroidMk(ret *common.AndroidMkData) {
+func (library *baseLinker) AndroidMk(ret *android.AndroidMkData) {
if library.static() {
ret.Class = "STATIC_LIBRARIES"
} else {
@@ -64,10 +64,10 @@
}
}
-func (library *libraryLinker) AndroidMk(ret *common.AndroidMkData) {
+func (library *libraryLinker) AndroidMk(ret *android.AndroidMkData) {
library.baseLinker.AndroidMk(ret)
- ret.Extra = append(ret.Extra, func(w io.Writer, outputFile common.Path) error {
+ ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
var exportedIncludes []string
for _, flag := range library.exportedFlags() {
if strings.HasPrefix(flag, "-I") {
@@ -88,7 +88,7 @@
})
}
-func (object *objectLinker) AndroidMk(ret *common.AndroidMkData) {
+func (object *objectLinker) AndroidMk(ret *android.AndroidMkData) {
ret.Custom = func(w io.Writer, name, prefix string) error {
out := ret.OutputFile.Path()
@@ -99,26 +99,26 @@
}
}
-func (binary *binaryLinker) AndroidMk(ret *common.AndroidMkData) {
+func (binary *binaryLinker) AndroidMk(ret *android.AndroidMkData) {
ret.Class = "EXECUTABLES"
- ret.Extra = append(ret.Extra, func(w io.Writer, outputFile common.Path) error {
+ ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
fmt.Fprintln(w, "LOCAL_CXX_STL := none")
fmt.Fprintln(w, "LOCAL_SYSTEM_SHARED_LIBRARIES :=")
return nil
})
}
-func (test *testLinker) AndroidMk(ret *common.AndroidMkData) {
+func (test *testLinker) AndroidMk(ret *android.AndroidMkData) {
test.binaryLinker.AndroidMk(ret)
if Bool(test.Properties.Test_per_src) {
ret.SubName = test.binaryLinker.Properties.Stem
}
}
-func (library *toolchainLibraryLinker) AndroidMk(ret *common.AndroidMkData) {
+func (library *toolchainLibraryLinker) AndroidMk(ret *android.AndroidMkData) {
library.baseLinker.AndroidMk(ret)
- ret.Extra = append(ret.Extra, func(w io.Writer, outputFile common.Path) error {
+ ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := "+outputFile.Ext())
fmt.Fprintln(w, "LOCAL_CXX_STL := none")
fmt.Fprintln(w, "LOCAL_SYSTEM_SHARED_LIBRARIES :=")
@@ -127,8 +127,8 @@
})
}
-func (installer *baseInstaller) AndroidMk(ret *common.AndroidMkData) {
- ret.Extra = append(ret.Extra, func(w io.Writer, outputFile common.Path) error {
+func (installer *baseInstaller) AndroidMk(ret *android.AndroidMkData) {
+ ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
path := installer.path.RelPathString()
dir, file := filepath.Split(path)
stem := strings.TrimSuffix(file, filepath.Ext(file))
diff --git a/cc/arm64_device.go b/cc/arm64_device.go
index 8ee2bc4..dcdce0f 100644
--- a/cc/arm64_device.go
+++ b/cc/arm64_device.go
@@ -18,7 +18,7 @@
"fmt"
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -195,7 +195,7 @@
return "libclang_rt.asan-aarch64-android.so"
}
-func arm64ToolchainFactory(arch common.Arch) Toolchain {
+func arm64ToolchainFactory(arch android.Arch) Toolchain {
if arch.ArchVariant != "armv8-a" {
panic(fmt.Sprintf("Unknown ARM architecture version: %q", arch.ArchVariant))
}
@@ -207,5 +207,5 @@
}
func init() {
- registerDeviceToolchainFactory(common.Arm64, arm64ToolchainFactory)
+ registerDeviceToolchainFactory(android.Arm64, arm64ToolchainFactory)
}
diff --git a/cc/arm_device.go b/cc/arm_device.go
index 323ebc9..1b467da 100644
--- a/cc/arm_device.go
+++ b/cc/arm_device.go
@@ -18,7 +18,7 @@
"fmt"
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -348,7 +348,7 @@
return "libclang_rt.asan-arm-android.so"
}
-func armToolchainFactory(arch common.Arch) Toolchain {
+func armToolchainFactory(arch android.Arch) Toolchain {
var fixCortexA8 string
toolchainCflags := make([]string, 2, 3)
toolchainClangCflags := make([]string, 2, 3)
@@ -391,5 +391,5 @@
}
func init() {
- registerDeviceToolchainFactory(common.Arm, armToolchainFactory)
+ registerDeviceToolchainFactory(android.Arm, armToolchainFactory)
}
diff --git a/cc/builder.go b/cc/builder.go
index cd12635..4efcc27 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -19,7 +19,7 @@
// functions.
import (
- "android/soong/common"
+ "android/soong/android"
"fmt"
"runtime"
"strconv"
@@ -36,7 +36,7 @@
)
var (
- pctx = common.NewPackageContext("android/soong/cc")
+ pctx = android.NewPackageContext("android/soong/cc")
cc = pctx.StaticRule("cc",
blueprint.RuleParams{
@@ -170,10 +170,10 @@
}
// Generate rules for compiling multiple .c, .cpp, or .S files to individual .o files
-func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFiles common.Paths,
- flags builderFlags, deps common.Paths) (objFiles common.Paths) {
+func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles android.Paths,
+ flags builderFlags, deps android.Paths) (objFiles android.Paths) {
- objFiles = make(common.Paths, len(srcFiles))
+ objFiles = make(android.Paths, len(srcFiles))
cflags := flags.globalFlags + " " + flags.cFlags + " " + flags.conlyFlags
cppflags := flags.globalFlags + " " + flags.cFlags + " " + flags.cppFlags
@@ -188,7 +188,7 @@
}
for i, srcFile := range srcFiles {
- objFile := common.ObjPathWithExt(ctx, srcFile, subdir, "o")
+ objFile := android.ObjPathWithExt(ctx, srcFile, subdir, "o")
objFiles[i] = objFile
@@ -225,7 +225,7 @@
ccCmd = gccCmd(flags.toolchain, ccCmd)
}
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: cc,
Output: objFile,
Input: srcFile,
@@ -241,13 +241,13 @@
}
// Generate a rule for compiling multiple .o files to a static library (.a)
-func TransformObjToStaticLib(ctx common.AndroidModuleContext, objFiles common.Paths,
- flags builderFlags, outputFile common.ModuleOutPath) {
+func TransformObjToStaticLib(ctx android.ModuleContext, objFiles android.Paths,
+ flags builderFlags, outputFile android.ModuleOutPath) {
arCmd := gccCmd(flags.toolchain, "ar")
arFlags := "crsPD"
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: ar,
Output: outputFile,
Inputs: objFiles,
@@ -262,21 +262,21 @@
// darwin. The darwin ar tool doesn't support @file for list files, and has a
// very small command line length limit, so we have to split the ar into multiple
// steps, each appending to the previous one.
-func TransformDarwinObjToStaticLib(ctx common.AndroidModuleContext, objFiles common.Paths,
- flags builderFlags, outputPath common.ModuleOutPath) {
+func TransformDarwinObjToStaticLib(ctx android.ModuleContext, objFiles android.Paths,
+ flags builderFlags, outputPath android.ModuleOutPath) {
arFlags := "cqs"
if len(objFiles) == 0 {
- dummy := common.PathForModuleOut(ctx, "dummy" + objectExtension)
- dummyAr := common.PathForModuleOut(ctx, "dummy" + staticLibraryExtension)
+ dummy := android.PathForModuleOut(ctx, "dummy"+objectExtension)
+ dummyAr := android.PathForModuleOut(ctx, "dummy"+staticLibraryExtension)
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: emptyFile,
Output: dummy,
})
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: darwinAr,
Output: dummyAr,
Input: dummy,
@@ -285,7 +285,7 @@
},
})
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: darwinAppendAr,
Output: outputPath,
Input: dummy,
@@ -325,9 +325,9 @@
})
} else {
ctx.Build(pctx, blueprint.BuildParams{
- Rule: darwinAppendAr,
- Outputs: []string{out},
- Inputs: l,
+ Rule: darwinAppendAr,
+ Outputs: []string{out},
+ Inputs: l,
Args: map[string]string{
"arFlags": arFlags,
"inAr": in,
@@ -339,9 +339,9 @@
// Generate a rule for compiling multiple .o files, plus static libraries, whole static libraries,
// and shared libraires, to a shared library (.so) or dynamic executable
-func TransformObjToDynamicBinary(ctx common.AndroidModuleContext,
- objFiles, sharedLibs, staticLibs, lateStaticLibs, wholeStaticLibs, deps common.Paths,
- crtBegin, crtEnd common.OptionalPath, groupLate bool, flags builderFlags, outputFile common.WritablePath) {
+func TransformObjToDynamicBinary(ctx android.ModuleContext,
+ objFiles, sharedLibs, staticLibs, lateStaticLibs, wholeStaticLibs, deps android.Paths,
+ crtBegin, crtEnd android.OptionalPath, groupLate bool, flags builderFlags, outputFile android.WritablePath) {
var ldCmd string
if flags.clang {
@@ -359,7 +359,7 @@
if len(wholeStaticLibs) > 0 {
if ctx.Host() && ctx.Darwin() {
- libFlagsList = append(libFlagsList, common.JoinWithPrefix(wholeStaticLibs.Strings(), "-force_load "))
+ libFlagsList = append(libFlagsList, android.JoinWithPrefix(wholeStaticLibs.Strings(), "-force_load "))
} else {
libFlagsList = append(libFlagsList, "-Wl,--whole-archive ")
libFlagsList = append(libFlagsList, wholeStaticLibs.Strings()...)
@@ -398,7 +398,7 @@
deps = append(deps, crtBegin.Path(), crtEnd.Path())
}
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: ld,
Output: outputFile,
Inputs: objFiles,
@@ -415,8 +415,8 @@
}
// Generate a rule for compiling multiple .o files to a .o using ld partial linking
-func TransformObjsToObj(ctx common.AndroidModuleContext, objFiles common.Paths,
- flags builderFlags, outputFile common.WritablePath) {
+func TransformObjsToObj(ctx android.ModuleContext, objFiles android.Paths,
+ flags builderFlags, outputFile android.WritablePath) {
var ldCmd string
if flags.clang {
@@ -425,7 +425,7 @@
ldCmd = gccCmd(flags.toolchain, "g++")
}
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: partialLd,
Output: outputFile,
Inputs: objFiles,
@@ -437,12 +437,12 @@
}
// Generate a rule for runing objcopy --prefix-symbols on a binary
-func TransformBinaryPrefixSymbols(ctx common.AndroidModuleContext, prefix string, inputFile common.Path,
- flags builderFlags, outputFile common.WritablePath) {
+func TransformBinaryPrefixSymbols(ctx android.ModuleContext, prefix string, inputFile android.Path,
+ flags builderFlags, outputFile android.WritablePath) {
objcopyCmd := gccCmd(flags.toolchain, "objcopy")
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: prefixSymbols,
Output: outputFile,
Input: inputFile,
@@ -453,8 +453,8 @@
})
}
-func TransformStrip(ctx common.AndroidModuleContext, inputFile common.Path,
- outputFile common.WritablePath, flags builderFlags) {
+func TransformStrip(ctx android.ModuleContext, inputFile android.Path,
+ outputFile android.WritablePath, flags builderFlags) {
crossCompile := gccCmd(flags.toolchain, "")
args := ""
@@ -468,7 +468,7 @@
args += " --keep-symbols"
}
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: strip,
Output: outputFile,
Input: inputFile,
@@ -479,20 +479,20 @@
})
}
-func TransformDarwinStrip(ctx common.AndroidModuleContext, inputFile common.Path,
- outputFile common.WritablePath) {
+func TransformDarwinStrip(ctx android.ModuleContext, inputFile android.Path,
+ outputFile android.WritablePath) {
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: darwinStrip,
Output: outputFile,
Input: inputFile,
})
}
-func CopyGccLib(ctx common.AndroidModuleContext, libName string,
- flags builderFlags, outputFile common.WritablePath) {
+func CopyGccLib(ctx android.ModuleContext, libName string,
+ flags builderFlags, outputFile android.WritablePath) {
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: copyGccLib,
Output: outputFile,
Args: map[string]string{
diff --git a/cc/cc.go b/cc/cc.go
index 62d77f5..d5f17a8 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -27,7 +27,7 @@
"github.com/google/blueprint/proptools"
"android/soong"
- "android/soong/common"
+ "android/soong/android"
"android/soong/genrule"
)
@@ -56,19 +56,19 @@
// LinkageMutator must be registered after common.ArchMutator, but that is guaranteed by
// the Go initialization order because this package depends on common, so common's init
// functions will run first.
- common.RegisterBottomUpMutator("link", linkageMutator)
- common.RegisterBottomUpMutator("test_per_src", testPerSrcMutator)
- common.RegisterBottomUpMutator("deps", depsMutator)
+ android.RegisterBottomUpMutator("link", linkageMutator)
+ android.RegisterBottomUpMutator("test_per_src", testPerSrcMutator)
+ android.RegisterBottomUpMutator("deps", depsMutator)
- common.RegisterTopDownMutator("asan_deps", sanitizerDepsMutator(asan))
- common.RegisterBottomUpMutator("asan", sanitizerMutator(asan))
+ android.RegisterTopDownMutator("asan_deps", sanitizerDepsMutator(asan))
+ android.RegisterBottomUpMutator("asan", sanitizerMutator(asan))
- common.RegisterTopDownMutator("tsan_deps", sanitizerDepsMutator(tsan))
- common.RegisterBottomUpMutator("tsan", sanitizerMutator(tsan))
+ android.RegisterTopDownMutator("tsan_deps", sanitizerDepsMutator(tsan))
+ android.RegisterBottomUpMutator("tsan", sanitizerMutator(tsan))
}
var (
- HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", common.Config.PrebuiltOS)
+ HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
LibcRoot = pctx.SourcePathVariable("LibcRoot", "bionic/libc")
)
@@ -118,7 +118,7 @@
)
func init() {
- if common.CurrentHostType() == common.Linux {
+ if android.CurrentHostType() == android.Linux {
commonGlobalCflags = append(commonGlobalCflags, "-fdebug-prefix-map=/proc/self/cwd=")
}
@@ -163,13 +163,13 @@
pctx.SourcePathVariable("clangDefaultBase", "prebuilts/clang/host")
pctx.VariableFunc("clangBase", func(config interface{}) (string, error) {
- if override := config.(common.Config).Getenv("LLVM_PREBUILTS_BASE"); override != "" {
+ if override := config.(android.Config).Getenv("LLVM_PREBUILTS_BASE"); override != "" {
return override, nil
}
return "${clangDefaultBase}", nil
})
pctx.VariableFunc("clangVersion", func(config interface{}) (string, error) {
- if override := config.(common.Config).Getenv("LLVM_PREBUILTS_VERSION"); override != "" {
+ if override := config.(android.Config).Getenv("LLVM_PREBUILTS_VERSION"); override != "" {
return override, nil
}
return "clang-2812033", nil
@@ -193,18 +193,18 @@
}
type PathDeps struct {
- SharedLibs, LateSharedLibs common.Paths
- StaticLibs, LateStaticLibs, WholeStaticLibs common.Paths
+ SharedLibs, LateSharedLibs android.Paths
+ StaticLibs, LateStaticLibs, WholeStaticLibs android.Paths
- ObjFiles common.Paths
- WholeStaticLibObjFiles common.Paths
+ ObjFiles android.Paths
+ WholeStaticLibObjFiles android.Paths
- GeneratedSources common.Paths
- GeneratedHeaders common.Paths
+ GeneratedSources android.Paths
+ GeneratedHeaders android.Paths
Cflags, ReexportedCflags []string
- CrtBegin, CrtEnd common.OptionalPath
+ CrtBegin, CrtEnd android.OptionalPath
}
type Flags struct {
@@ -224,7 +224,7 @@
RequiredInstructionSet string
DynamicLinker string
- CFlagsDeps common.Paths // Files depended on by compiler flags
+ CFlagsDeps android.Paths // Files depended on by compiler flags
}
type BaseCompilerProperties struct {
@@ -460,12 +460,12 @@
}
type ModuleContext interface {
- common.AndroidModuleContext
+ android.ModuleContext
ModuleContextIntf
}
type BaseModuleContext interface {
- common.AndroidBaseContext
+ android.BaseContext
ModuleContextIntf
}
@@ -483,18 +483,18 @@
type compiler interface {
feature
- compile(ctx ModuleContext, flags Flags, deps PathDeps) common.Paths
+ compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Paths
}
type linker interface {
feature
- link(ctx ModuleContext, flags Flags, deps PathDeps, objFiles common.Paths) common.Path
+ link(ctx ModuleContext, flags Flags, deps PathDeps, objFiles android.Paths) android.Path
installable() bool
}
type installer interface {
props() []interface{}
- install(ctx ModuleContext, path common.Path)
+ install(ctx ModuleContext, path android.Path)
inData() bool
}
@@ -522,15 +522,15 @@
// the blueprint.Module interface. It delegates to compiler, linker, and installer interfaces
// to construct the output file. Behavior can be customized with a Customizer interface
type Module struct {
- common.AndroidModuleBase
- common.DefaultableModule
+ android.ModuleBase
+ android.DefaultableModule
Properties BaseProperties
unused UnusedProperties
// initialize before calling Init
- hod common.HostOrDeviceSupported
- multilib common.Multilib
+ hod android.HostOrDeviceSupported
+ multilib android.Multilib
// delegates, initialize before calling Init
customizer Customizer
@@ -543,7 +543,7 @@
androidMkSharedLibDeps []string
- outputFile common.OptionalPath
+ outputFile android.OptionalPath
cachedToolchain Toolchain
}
@@ -572,18 +572,18 @@
props = append(props, feature.props()...)
}
- _, props = common.InitAndroidArchModule(c, c.hod, c.multilib, props...)
+ _, props = android.InitAndroidArchModule(c, c.hod, c.multilib, props...)
- return common.InitDefaultableModule(c, c, props...)
+ return android.InitDefaultableModule(c, c, props...)
}
type baseModuleContext struct {
- common.AndroidBaseContext
+ android.BaseContext
moduleContextImpl
}
type moduleContext struct {
- common.AndroidModuleContext
+ android.ModuleContext
moduleContextImpl
}
@@ -645,23 +645,23 @@
return ""
}
-func newBaseModule(hod common.HostOrDeviceSupported, multilib common.Multilib) *Module {
+func newBaseModule(hod android.HostOrDeviceSupported, multilib android.Multilib) *Module {
return &Module{
hod: hod,
multilib: multilib,
}
}
-func newModule(hod common.HostOrDeviceSupported, multilib common.Multilib) *Module {
+func newModule(hod android.HostOrDeviceSupported, multilib android.Multilib) *Module {
module := newBaseModule(hod, multilib)
module.stl = &stl{}
module.sanitize = &sanitize{}
return module
}
-func (c *Module) GenerateAndroidBuildActions(actx common.AndroidModuleContext) {
+func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
ctx := &moduleContext{
- AndroidModuleContext: actx,
+ ModuleContext: actx,
moduleContextImpl: moduleContextImpl{
mod: c,
},
@@ -711,7 +711,7 @@
flags.CFlags = append(flags.CFlags, deps.Cflags...)
- var objFiles common.Paths
+ var objFiles android.Paths
if c.compiler != nil {
objFiles = c.compiler.compile(ctx, flags, deps)
if ctx.Failed() {
@@ -724,7 +724,7 @@
if ctx.Failed() {
return
}
- c.outputFile = common.OptionalPathForPath(outputFile)
+ c.outputFile = android.OptionalPathForPath(outputFile)
if c.installer != nil && c.linker.installable() {
c.installer.install(ctx, outputFile)
@@ -796,9 +796,9 @@
return deps
}
-func (c *Module) depsMutator(actx common.AndroidBottomUpMutatorContext) {
+func (c *Module) depsMutator(actx android.BottomUpMutatorContext) {
ctx := &baseModuleContext{
- AndroidBaseContext: actx,
+ BaseContext: actx,
moduleContextImpl: moduleContextImpl{
mod: c,
},
@@ -843,7 +843,7 @@
}
}
-func depsMutator(ctx common.AndroidBottomUpMutatorContext) {
+func depsMutator(ctx android.BottomUpMutatorContext) {
if c, ok := ctx.Module().(*Module); ok {
c.depsMutator(ctx)
}
@@ -870,14 +870,14 @@
}
// Convert dependencies to paths. Returns a PathDeps containing paths
-func (c *Module) depsToPaths(ctx common.AndroidModuleContext) PathDeps {
+func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
var depPaths PathDeps
ctx.VisitDirectDeps(func(m blueprint.Module) {
name := ctx.OtherModuleName(m)
tag := ctx.OtherModuleDependencyTag(m)
- a, _ := m.(common.AndroidModule)
+ a, _ := m.(android.Module)
if a == nil {
ctx.ModuleErrorf("module %q not an android module", name)
return
@@ -886,7 +886,7 @@
c, _ := m.(*Module)
if c == nil {
switch tag {
- case common.DefaultsDepTag:
+ case android.DefaultsDepTag:
case genSourceDepTag:
if genRule, ok := m.(genrule.SourceFileGenerator); ok {
depPaths.GeneratedSources = append(depPaths.GeneratedSources,
@@ -899,7 +899,7 @@
depPaths.GeneratedHeaders = append(depPaths.GeneratedHeaders,
genRule.GeneratedSourceFiles()...)
depPaths.Cflags = append(depPaths.Cflags,
- includeDirsToFlags(common.Paths{genRule.GeneratedHeaderDir()}))
+ includeDirsToFlags(android.Paths{genRule.GeneratedHeaderDir()}))
} else {
ctx.ModuleErrorf("module %q is not a genrule", name)
}
@@ -938,7 +938,7 @@
}
}
- var depPtr *common.Paths
+ var depPtr *android.Paths
switch tag {
case sharedDepTag:
@@ -1039,14 +1039,14 @@
flags.YaccFlags = append(flags.YaccFlags, compiler.Properties.Yaccflags...)
// Include dir cflags
- rootIncludeDirs := common.PathsForSource(ctx, compiler.Properties.Include_dirs)
- localIncludeDirs := common.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs)
+ rootIncludeDirs := android.PathsForSource(ctx, compiler.Properties.Include_dirs)
+ localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs)
flags.GlobalFlags = append(flags.GlobalFlags,
includeDirsToFlags(localIncludeDirs),
includeDirsToFlags(rootIncludeDirs))
- rootIncludeFiles := common.PathsForSource(ctx, compiler.Properties.Include_files)
- localIncludeFiles := common.PathsForModuleSrc(ctx, compiler.Properties.Local_include_files)
+ rootIncludeFiles := android.PathsForSource(ctx, compiler.Properties.Include_files)
+ localIncludeFiles := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_files)
flags.GlobalFlags = append(flags.GlobalFlags,
includeFilesToFlags(rootIncludeFiles),
@@ -1061,9 +1061,9 @@
}
flags.GlobalFlags = append(flags.GlobalFlags, []string{
- "-I" + common.PathForModuleSrc(ctx).String(),
- "-I" + common.PathForModuleOut(ctx).String(),
- "-I" + common.PathForModuleGen(ctx).String(),
+ "-I" + android.PathForModuleSrc(ctx).String(),
+ "-I" + android.PathForModuleOut(ctx).String(),
+ "-I" + android.PathForModuleGen(ctx).String(),
}...)
}
@@ -1164,7 +1164,7 @@
// vendor/device specific things), we could extend this to be a ternary
// value.
strict := true
- if strings.HasPrefix(common.PathForModuleSrc(ctx).String(), "external/") {
+ if strings.HasPrefix(android.PathForModuleSrc(ctx).String(), "external/") {
strict = false
}
@@ -1177,7 +1177,7 @@
return flags
}
-func (compiler *baseCompiler) compile(ctx ModuleContext, flags Flags, deps PathDeps) common.Paths {
+func (compiler *baseCompiler) compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Paths {
// Compile files listed in c.Properties.Srcs into objects
objFiles := compiler.compileObjs(ctx, flags, "",
compiler.Properties.Srcs, compiler.Properties.Exclude_srcs,
@@ -1191,8 +1191,8 @@
}
// Compile a list of source files into objects a specified subdirectory
-func (compiler *baseCompiler) compileObjs(ctx common.AndroidModuleContext, flags Flags,
- subdir string, srcFiles, excludes []string, extraSrcs, deps common.Paths) common.Paths {
+func (compiler *baseCompiler) compileObjs(ctx android.ModuleContext, flags Flags,
+ subdir string, srcFiles, excludes []string, extraSrcs, deps android.Paths) android.Paths {
buildFlags := flagsToBuilderFlags(flags)
@@ -1349,7 +1349,7 @@
dir64 string
data bool
- path common.OutputPath
+ path android.OutputPath
}
var _ installer = (*baseInstaller)(nil)
@@ -1358,12 +1358,12 @@
return []interface{}{&installer.Properties}
}
-func (installer *baseInstaller) install(ctx ModuleContext, file common.Path) {
+func (installer *baseInstaller) install(ctx ModuleContext, file android.Path) {
subDir := installer.dir
if ctx.toolchain().Is64Bit() && installer.dir64 != "" {
subDir = installer.dir64
}
- dir := common.PathForModuleInstall(ctx, subDir, installer.Properties.Relative_install_path)
+ dir := android.PathForModuleInstall(ctx, subDir, installer.Properties.Relative_install_path)
installer.path = ctx.InstallFile(dir, file)
}
@@ -1382,8 +1382,8 @@
}
func (f *flagExporter) exportIncludes(ctx ModuleContext, inc string) {
- includeDirs := common.PathsForModuleSrc(ctx, f.Properties.Export_include_dirs)
- f.flags = append(f.flags, common.JoinWithPrefix(includeDirs.Strings(), inc))
+ includeDirs := android.PathsForModuleSrc(ctx, f.Properties.Export_include_dirs)
+ f.flags = append(f.flags, android.JoinWithPrefix(includeDirs.Strings(), inc))
}
func (f *flagExporter) reexportFlags(flags []string) {
@@ -1407,7 +1407,7 @@
Properties LibraryCompilerProperties
// For reusing static library objects for shared library
- reuseObjFiles common.Paths
+ reuseObjFiles android.Paths
}
var _ compiler = (*libraryCompiler)(nil)
@@ -1423,7 +1423,7 @@
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
// all code is position independent, and then those warnings get promoted to
// errors.
- if ctx.HostType() != common.Windows {
+ if ctx.HostType() != android.Windows {
flags.CFlags = append(flags.CFlags, "-fPIC")
}
@@ -1436,18 +1436,18 @@
return flags
}
-func (library *libraryCompiler) compile(ctx ModuleContext, flags Flags, deps PathDeps) common.Paths {
- var objFiles common.Paths
+func (library *libraryCompiler) compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Paths {
+ var objFiles android.Paths
objFiles = library.baseCompiler.compile(ctx, flags, deps)
library.reuseObjFiles = objFiles
if library.linker.static() {
- objFiles = append(objFiles, library.compileObjs(ctx, flags, common.DeviceStaticLibrary,
+ objFiles = append(objFiles, library.compileObjs(ctx, flags, android.DeviceStaticLibrary,
library.Properties.Static.Srcs, library.Properties.Static.Exclude_srcs,
nil, deps.GeneratedHeaders)...)
} else {
- objFiles = append(objFiles, library.compileObjs(ctx, flags, common.DeviceSharedLibrary,
+ objFiles = append(objFiles, library.compileObjs(ctx, flags, android.DeviceSharedLibrary,
library.Properties.Shared.Srcs, library.Properties.Shared.Exclude_srcs,
nil, deps.GeneratedHeaders)...)
}
@@ -1472,7 +1472,7 @@
wholeStaticMissingDeps []string
// For whole_static_libs
- objFiles common.Paths
+ objFiles android.Paths
}
var _ linker = (*libraryLinker)(nil)
@@ -1549,12 +1549,12 @@
}
func (library *libraryLinker) linkStatic(ctx ModuleContext,
- flags Flags, deps PathDeps, objFiles common.Paths) common.Path {
+ flags Flags, deps PathDeps, objFiles android.Paths) android.Path {
- library.objFiles = append(common.Paths{}, deps.WholeStaticLibObjFiles...)
+ library.objFiles = append(android.Paths{}, deps.WholeStaticLibObjFiles...)
library.objFiles = append(library.objFiles, objFiles...)
- outputFile := common.PathForModuleOut(ctx,
+ outputFile := android.PathForModuleOut(ctx,
ctx.ModuleName()+library.Properties.VariantName+staticLibraryExtension)
if ctx.Darwin() {
@@ -1571,14 +1571,14 @@
}
func (library *libraryLinker) linkShared(ctx ModuleContext,
- flags Flags, deps PathDeps, objFiles common.Paths) common.Path {
+ flags Flags, deps PathDeps, objFiles android.Paths) android.Path {
- var linkerDeps common.Paths
+ var linkerDeps android.Paths
- versionScript := common.OptionalPathForModuleSrc(ctx, library.Properties.Version_script)
- unexportedSymbols := common.OptionalPathForModuleSrc(ctx, library.Properties.Unexported_symbols_list)
- forceNotWeakSymbols := common.OptionalPathForModuleSrc(ctx, library.Properties.Force_symbols_not_weak_list)
- forceWeakSymbols := common.OptionalPathForModuleSrc(ctx, library.Properties.Force_symbols_weak_list)
+ versionScript := android.OptionalPathForModuleSrc(ctx, library.Properties.Version_script)
+ unexportedSymbols := android.OptionalPathForModuleSrc(ctx, library.Properties.Unexported_symbols_list)
+ forceNotWeakSymbols := android.OptionalPathForModuleSrc(ctx, library.Properties.Force_symbols_not_weak_list)
+ forceWeakSymbols := android.OptionalPathForModuleSrc(ctx, library.Properties.Force_symbols_weak_list)
if !ctx.Darwin() {
if versionScript.Valid() {
flags.LdFlags = append(flags.LdFlags, "-Wl,--version-script,"+versionScript.String())
@@ -1612,14 +1612,14 @@
}
fileName := ctx.ModuleName() + library.Properties.VariantName + flags.Toolchain.ShlibSuffix()
- outputFile := common.PathForModuleOut(ctx, fileName)
+ outputFile := android.PathForModuleOut(ctx, fileName)
ret := outputFile
builderFlags := flagsToBuilderFlags(flags)
if library.stripper.needsStrip(ctx) {
strippedOutputFile := outputFile
- outputFile = common.PathForModuleOut(ctx, "unstripped", fileName)
+ outputFile = android.PathForModuleOut(ctx, "unstripped", fileName)
library.stripper.strip(ctx, outputFile, strippedOutputFile, builderFlags)
}
@@ -1634,11 +1634,11 @@
}
func (library *libraryLinker) link(ctx ModuleContext,
- flags Flags, deps PathDeps, objFiles common.Paths) common.Path {
+ flags Flags, deps PathDeps, objFiles android.Paths) android.Path {
objFiles = append(objFiles, deps.ObjFiles...)
- var out common.Path
+ var out android.Path
if library.static() {
out = library.linkStatic(ctx, flags, deps, objFiles)
} else {
@@ -1678,7 +1678,7 @@
sanitize *sanitize
}
-func (library *libraryInstaller) install(ctx ModuleContext, file common.Path) {
+func (library *libraryInstaller) install(ctx ModuleContext, file android.Path) {
if !library.linker.static() {
library.baseInstaller.install(ctx, file)
}
@@ -1688,8 +1688,8 @@
return library.baseInstaller.inData() || library.sanitize.inData()
}
-func NewLibrary(hod common.HostOrDeviceSupported, shared, static bool) *Module {
- module := newModule(hod, common.MultilibBoth)
+func NewLibrary(hod android.HostOrDeviceSupported, shared, static bool) *Module {
+ module := newModule(hod, android.MultilibBoth)
linker := &libraryLinker{}
linker.dynamicProperties.BuildShared = shared
@@ -1712,7 +1712,7 @@
}
func libraryFactory() (blueprint.Module, []interface{}) {
- module := NewLibrary(common.HostAndDeviceSupported, true, true)
+ module := NewLibrary(android.HostAndDeviceSupported, true, true)
return module.Init()
}
@@ -1725,7 +1725,7 @@
}
func objectFactory() (blueprint.Module, []interface{}) {
- module := newBaseModule(common.DeviceSupported, common.MultilibBoth)
+ module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
module.compiler = &baseCompiler{}
module.linker = &objectLinker{}
return module.Init()
@@ -1753,15 +1753,15 @@
}
func (object *objectLinker) link(ctx ModuleContext,
- flags Flags, deps PathDeps, objFiles common.Paths) common.Path {
+ flags Flags, deps PathDeps, objFiles android.Paths) android.Path {
objFiles = append(objFiles, deps.ObjFiles...)
- var outputFile common.Path
+ var outputFile android.Path
if len(objFiles) == 1 {
outputFile = objFiles[0]
} else {
- output := common.PathForModuleOut(ctx, ctx.ModuleName()+objectExtension)
+ output := android.PathForModuleOut(ctx, ctx.ModuleName()+objectExtension)
TransformObjsToObj(ctx, objFiles, flagsToBuilderFlags(flags), output)
outputFile = output
}
@@ -1784,7 +1784,7 @@
Properties BinaryLinkerProperties
- hostToolPath common.OptionalPath
+ hostToolPath android.OptionalPath
}
var _ linker = (*binaryLinker)(nil)
@@ -1861,8 +1861,8 @@
return true
}
-func NewBinary(hod common.HostOrDeviceSupported) *Module {
- module := newModule(hod, common.MultilibFirst)
+func NewBinary(hod android.HostOrDeviceSupported) *Module {
+ module := newModule(hod, android.MultilibFirst)
module.compiler = &baseCompiler{}
module.linker = &binaryLinker{}
module.installer = &baseInstaller{
@@ -1872,7 +1872,7 @@
}
func binaryFactory() (blueprint.Module, []interface{}) {
- module := NewBinary(common.HostAndDeviceSupported)
+ module := NewBinary(android.HostAndDeviceSupported)
return module.Init()
}
@@ -1881,7 +1881,7 @@
static := Bool(binary.Properties.Static_executable)
if ctx.Host() {
- if ctx.HostType() == common.Linux {
+ if ctx.HostType() == android.Linux {
if binary.Properties.Static_executable == nil && Bool(ctx.AConfig().ProductVariables.HostStaticBinaries) {
static = true
}
@@ -1901,7 +1901,7 @@
if ctx.Host() && !binary.staticBinary() {
flags.LdFlags = append(flags.LdFlags, "-pie")
- if ctx.HostType() == common.Windows {
+ if ctx.HostType() == android.Windows {
flags.LdFlags = append(flags.LdFlags, "-Wl,-e_mainCRTStartup")
}
}
@@ -1909,7 +1909,7 @@
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
// all code is position independent, and then those warnings get promoted to
// errors.
- if ctx.HostType() != common.Windows {
+ if ctx.HostType() != android.Windows {
flags.CFlags = append(flags.CFlags, "-fpie")
}
@@ -1958,16 +1958,16 @@
}
func (binary *binaryLinker) link(ctx ModuleContext,
- flags Flags, deps PathDeps, objFiles common.Paths) common.Path {
+ flags Flags, deps PathDeps, objFiles android.Paths) android.Path {
fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
- outputFile := common.PathForModuleOut(ctx, fileName)
+ outputFile := android.PathForModuleOut(ctx, fileName)
ret := outputFile
if ctx.HostOrDevice().Host() {
- binary.hostToolPath = common.OptionalPathForPath(outputFile)
+ binary.hostToolPath = android.OptionalPathForPath(outputFile)
}
- var linkerDeps common.Paths
+ var linkerDeps android.Paths
sharedLibs := deps.SharedLibs
sharedLibs = append(sharedLibs, deps.LateSharedLibs...)
@@ -1980,13 +1980,13 @@
if binary.stripper.needsStrip(ctx) {
strippedOutputFile := outputFile
- outputFile = common.PathForModuleOut(ctx, "unstripped", fileName)
+ outputFile = android.PathForModuleOut(ctx, "unstripped", fileName)
binary.stripper.strip(ctx, outputFile, strippedOutputFile, builderFlags)
}
if binary.Properties.Prefix_symbols != "" {
afterPrefixSymbols := outputFile
- outputFile = common.PathForModuleOut(ctx, "unprefixed", fileName)
+ outputFile = android.PathForModuleOut(ctx, "unprefixed", fileName)
TransformBinaryPrefixSymbols(ctx, binary.Properties.Prefix_symbols, outputFile,
flagsToBuilderFlags(flags), afterPrefixSymbols)
}
@@ -1998,7 +1998,7 @@
return ret
}
-func (binary *binaryLinker) HostToolPath() common.OptionalPath {
+func (binary *binaryLinker) HostToolPath() android.OptionalPath {
return binary.hostToolPath
}
@@ -2010,7 +2010,7 @@
return !ctx.AConfig().EmbeddedInMake() && !stripper.StripProperties.Strip.None
}
-func (stripper *stripper) strip(ctx ModuleContext, in, out common.ModuleOutPath,
+func (stripper *stripper) strip(ctx ModuleContext, in, out android.ModuleOutPath,
flags builderFlags) {
if ctx.Darwin() {
TransformDarwinStrip(ctx, in, out)
@@ -2022,7 +2022,7 @@
}
}
-func testPerSrcMutator(mctx common.AndroidBottomUpMutatorContext) {
+func testPerSrcMutator(mctx android.BottomUpMutatorContext) {
if m, ok := mctx.Module().(*Module); ok {
if test, ok := m.linker.(*testLinker); ok {
if Bool(test.Properties.Test_per_src) {
@@ -2071,12 +2071,12 @@
flags.CFlags = append(flags.CFlags, "-O0", "-g")
switch ctx.HostType() {
- case common.Windows:
+ case android.Windows:
flags.CFlags = append(flags.CFlags, "-DGTEST_OS_WINDOWS")
- case common.Linux:
+ case android.Linux:
flags.CFlags = append(flags.CFlags, "-DGTEST_OS_LINUX")
flags.LdFlags = append(flags.LdFlags, "-lpthread")
- case common.Darwin:
+ case android.Darwin:
flags.CFlags = append(flags.CFlags, "-DGTEST_OS_MAC")
flags.LdFlags = append(flags.LdFlags, "-lpthread")
}
@@ -2110,14 +2110,14 @@
baseInstaller
}
-func (installer *testInstaller) install(ctx ModuleContext, file common.Path) {
+func (installer *testInstaller) install(ctx ModuleContext, file android.Path) {
installer.dir = filepath.Join(installer.dir, ctx.ModuleName())
installer.dir64 = filepath.Join(installer.dir64, ctx.ModuleName())
installer.baseInstaller.install(ctx, file)
}
-func NewTest(hod common.HostOrDeviceSupported) *Module {
- module := newModule(hod, common.MultilibBoth)
+func NewTest(hod android.HostOrDeviceSupported) *Module {
+ module := newModule(hod, android.MultilibBoth)
module.compiler = &baseCompiler{}
linker := &testLinker{}
linker.Properties.Gtest = true
@@ -2133,7 +2133,7 @@
}
func testFactory() (blueprint.Module, []interface{}) {
- module := NewTest(common.HostAndDeviceSupported)
+ module := NewTest(android.HostAndDeviceSupported)
return module.Init()
}
@@ -2147,8 +2147,8 @@
return deps
}
-func NewBenchmark(hod common.HostOrDeviceSupported) *Module {
- module := newModule(hod, common.MultilibFirst)
+func NewBenchmark(hod android.HostOrDeviceSupported) *Module {
+ module := newModule(hod, android.MultilibFirst)
module.compiler = &baseCompiler{}
module.linker = &benchmarkLinker{}
module.installer = &baseInstaller{
@@ -2160,7 +2160,7 @@
}
func benchmarkFactory() (blueprint.Module, []interface{}) {
- module := NewBenchmark(common.HostAndDeviceSupported)
+ module := NewBenchmark(android.HostAndDeviceSupported)
return module.Init()
}
@@ -2169,7 +2169,7 @@
//
func libraryStaticFactory() (blueprint.Module, []interface{}) {
- module := NewLibrary(common.HostAndDeviceSupported, false, true)
+ module := NewLibrary(android.HostAndDeviceSupported, false, true)
return module.Init()
}
@@ -2178,7 +2178,7 @@
//
func librarySharedFactory() (blueprint.Module, []interface{}) {
- module := NewLibrary(common.HostAndDeviceSupported, true, false)
+ module := NewLibrary(android.HostAndDeviceSupported, true, false)
return module.Init()
}
@@ -2187,7 +2187,7 @@
//
func libraryHostStaticFactory() (blueprint.Module, []interface{}) {
- module := NewLibrary(common.HostSupported, false, true)
+ module := NewLibrary(android.HostSupported, false, true)
return module.Init()
}
@@ -2196,7 +2196,7 @@
//
func libraryHostSharedFactory() (blueprint.Module, []interface{}) {
- module := NewLibrary(common.HostSupported, true, false)
+ module := NewLibrary(android.HostSupported, true, false)
return module.Init()
}
@@ -2205,7 +2205,7 @@
//
func binaryHostFactory() (blueprint.Module, []interface{}) {
- module := NewBinary(common.HostSupported)
+ module := NewBinary(android.HostSupported)
return module.Init()
}
@@ -2214,7 +2214,7 @@
//
func testHostFactory() (blueprint.Module, []interface{}) {
- module := NewTest(common.HostSupported)
+ module := NewTest(android.HostSupported)
return module.Init()
}
@@ -2223,7 +2223,7 @@
//
func benchmarkHostFactory() (blueprint.Module, []interface{}) {
- module := NewBenchmark(common.HostSupported)
+ module := NewBenchmark(android.HostSupported)
return module.Init()
}
@@ -2231,11 +2231,11 @@
// Defaults
//
type Defaults struct {
- common.AndroidModuleBase
- common.DefaultsModule
+ android.ModuleBase
+ android.DefaultsModule
}
-func (*Defaults) GenerateAndroidBuildActions(ctx common.AndroidModuleContext) {
+func (*Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func defaultsFactory() (blueprint.Module, []interface{}) {
@@ -2256,10 +2256,10 @@
&StripProperties{},
}
- _, propertyStructs = common.InitAndroidArchModule(module, common.HostAndDeviceDefault,
- common.MultilibDefault, propertyStructs...)
+ _, propertyStructs = android.InitAndroidArchModule(module, android.HostAndDeviceDefault,
+ android.MultilibDefault, propertyStructs...)
- return common.InitDefaultsModule(module, module, propertyStructs...)
+ return android.InitDefaultsModule(module, module, propertyStructs...)
}
//
@@ -2286,7 +2286,7 @@
}
func toolchainLibraryFactory() (blueprint.Module, []interface{}) {
- module := newBaseModule(common.DeviceSupported, common.MultilibBoth)
+ module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
module.compiler = &baseCompiler{}
module.linker = &toolchainLibraryLinker{}
module.Properties.Clang = proptools.BoolPtr(false)
@@ -2294,10 +2294,10 @@
}
func (library *toolchainLibraryLinker) link(ctx ModuleContext,
- flags Flags, deps PathDeps, objFiles common.Paths) common.Path {
+ flags Flags, deps PathDeps, objFiles android.Paths) android.Path {
libName := ctx.ModuleName() + staticLibraryExtension
- outputFile := common.PathForModuleOut(ctx, libName)
+ outputFile := android.PathForModuleOut(ctx, libName)
if flags.Clang {
ctx.ModuleErrorf("toolchain_library must use GCC, not Clang")
@@ -2320,19 +2320,19 @@
// either (with the exception of the shared STLs, which are installed to the app's directory rather
// than to the system image).
-func getNdkLibDir(ctx common.AndroidModuleContext, toolchain Toolchain, version string) common.SourcePath {
+func getNdkLibDir(ctx android.ModuleContext, toolchain Toolchain, version string) android.SourcePath {
suffix := ""
// Most 64-bit NDK prebuilts store libraries in "lib64", except for arm64 which is not a
// multilib toolchain and stores the libraries in "lib".
- if toolchain.Is64Bit() && ctx.Arch().ArchType != common.Arm64 {
+ if toolchain.Is64Bit() && ctx.Arch().ArchType != android.Arm64 {
suffix = "64"
}
- return common.PathForSource(ctx, fmt.Sprintf("prebuilts/ndk/current/platforms/android-%s/arch-%s/usr/lib%s",
+ return android.PathForSource(ctx, fmt.Sprintf("prebuilts/ndk/current/platforms/android-%s/arch-%s/usr/lib%s",
version, toolchain.Name(), suffix))
}
-func ndkPrebuiltModuleToPath(ctx common.AndroidModuleContext, toolchain Toolchain,
- ext string, version string) common.Path {
+func ndkPrebuiltModuleToPath(ctx android.ModuleContext, toolchain Toolchain,
+ ext string, version string) android.Path {
// NDK prebuilts are named like: ndk_NAME.EXT.SDK_VERSION.
// We want to translate to just NAME.EXT
@@ -2351,13 +2351,13 @@
}
func ndkPrebuiltObjectFactory() (blueprint.Module, []interface{}) {
- module := newBaseModule(common.DeviceSupported, common.MultilibBoth)
+ module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
module.linker = &ndkPrebuiltObjectLinker{}
return module.Init()
}
func (c *ndkPrebuiltObjectLinker) link(ctx ModuleContext, flags Flags,
- deps PathDeps, objFiles common.Paths) common.Path {
+ deps PathDeps, objFiles android.Paths) android.Path {
// A null build step, but it sets up the output path.
if !strings.HasPrefix(ctx.ModuleName(), "ndk_crt") {
ctx.ModuleErrorf("NDK prebuilts must have an ndk_crt prefixed name")
@@ -2383,7 +2383,7 @@
}
func ndkPrebuiltLibraryFactory() (blueprint.Module, []interface{}) {
- module := newBaseModule(common.DeviceSupported, common.MultilibBoth)
+ module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
linker := &ndkPrebuiltLibraryLinker{}
linker.dynamicProperties.BuildShared = true
module.linker = linker
@@ -2391,7 +2391,7 @@
}
func (ndk *ndkPrebuiltLibraryLinker) link(ctx ModuleContext, flags Flags,
- deps PathDeps, objFiles common.Paths) common.Path {
+ deps PathDeps, objFiles android.Paths) android.Path {
// A null build step, but it sets up the output path.
if !strings.HasPrefix(ctx.ModuleName(), "ndk_lib") {
ctx.ModuleErrorf("NDK prebuilts must have an ndk_lib prefixed name")
@@ -2412,7 +2412,7 @@
}
func ndkPrebuiltSharedStlFactory() (blueprint.Module, []interface{}) {
- module := newBaseModule(common.DeviceSupported, common.MultilibBoth)
+ module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
linker := &ndkPrebuiltStlLinker{}
linker.dynamicProperties.BuildShared = true
module.linker = linker
@@ -2420,14 +2420,14 @@
}
func ndkPrebuiltStaticStlFactory() (blueprint.Module, []interface{}) {
- module := newBaseModule(common.DeviceSupported, common.MultilibBoth)
+ module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
linker := &ndkPrebuiltStlLinker{}
linker.dynamicProperties.BuildStatic = true
module.linker = linker
return module.Init()
}
-func getNdkStlLibDir(ctx common.AndroidModuleContext, toolchain Toolchain, stl string) common.SourcePath {
+func getNdkStlLibDir(ctx android.ModuleContext, toolchain Toolchain, stl string) android.SourcePath {
gccVersion := toolchain.GccVersion()
var libDir string
switch stl {
@@ -2441,15 +2441,15 @@
if libDir != "" {
ndkSrcRoot := "prebuilts/ndk/current/sources"
- return common.PathForSource(ctx, ndkSrcRoot).Join(ctx, libDir, ctx.Arch().Abi[0])
+ return android.PathForSource(ctx, ndkSrcRoot).Join(ctx, libDir, ctx.Arch().Abi[0])
}
ctx.ModuleErrorf("Unknown NDK STL: %s", stl)
- return common.PathForSource(ctx, "")
+ return android.PathForSource(ctx, "")
}
func (ndk *ndkPrebuiltStlLinker) link(ctx ModuleContext, flags Flags,
- deps PathDeps, objFiles common.Paths) common.Path {
+ deps PathDeps, objFiles android.Paths) android.Path {
// A null build step, but it sets up the output path.
if !strings.HasPrefix(ctx.ModuleName(), "ndk_lib") {
ctx.ModuleErrorf("NDK prebuilts must have an ndk_lib prefixed name")
@@ -2469,7 +2469,7 @@
return libDir.Join(ctx, libName+libExt)
}
-func linkageMutator(mctx common.AndroidBottomUpMutatorContext) {
+func linkageMutator(mctx android.BottomUpMutatorContext) {
if m, ok := mctx.Module().(*Module); ok {
if m.linker != nil {
if linker, ok := m.linker.(baseLinkerInterface); ok {
diff --git a/cc/gen.go b/cc/gen.go
index 94e2304..efcc478 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -21,7 +21,7 @@
import (
"github.com/google/blueprint"
- "android/soong/common"
+ "android/soong/android"
)
func init() {
@@ -47,12 +47,12 @@
})
)
-func genYacc(ctx common.AndroidModuleContext, yaccFile common.Path, outFile common.ModuleGenPath, yaccFlags string) (headerFile common.ModuleGenPath) {
- headerFile = common.GenPathWithExt(ctx, yaccFile, "h")
+func genYacc(ctx android.ModuleContext, yaccFile android.Path, outFile android.ModuleGenPath, yaccFlags string) (headerFile android.ModuleGenPath) {
+ headerFile = android.GenPathWithExt(ctx, yaccFile, "h")
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: yacc,
- Outputs: common.WritablePaths{outFile, headerFile},
+ Outputs: android.WritablePaths{outFile, headerFile},
Input: yaccFile,
Args: map[string]string{
"yaccFlags": yaccFlags,
@@ -64,35 +64,35 @@
return headerFile
}
-func genLex(ctx common.AndroidModuleContext, lexFile common.Path, outFile common.ModuleGenPath) {
- ctx.ModuleBuild(pctx, common.ModuleBuildParams{
+func genLex(ctx android.ModuleContext, lexFile android.Path, outFile android.ModuleGenPath) {
+ ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: lex,
Output: outFile,
Input: lexFile,
})
}
-func genSources(ctx common.AndroidModuleContext, srcFiles common.Paths,
- buildFlags builderFlags) (common.Paths, common.Paths) {
+func genSources(ctx android.ModuleContext, srcFiles android.Paths,
+ buildFlags builderFlags) (android.Paths, android.Paths) {
- var deps common.Paths
+ var deps android.Paths
for i, srcFile := range srcFiles {
switch srcFile.Ext() {
case ".y":
- cFile := common.GenPathWithExt(ctx, srcFile, "c")
+ cFile := android.GenPathWithExt(ctx, srcFile, "c")
srcFiles[i] = cFile
deps = append(deps, genYacc(ctx, srcFile, cFile, buildFlags.yaccFlags))
case ".yy":
- cppFile := common.GenPathWithExt(ctx, srcFile, "cpp")
+ cppFile := android.GenPathWithExt(ctx, srcFile, "cpp")
srcFiles[i] = cppFile
deps = append(deps, genYacc(ctx, srcFile, cppFile, buildFlags.yaccFlags))
case ".l":
- cFile := common.GenPathWithExt(ctx, srcFile, "c")
+ cFile := android.GenPathWithExt(ctx, srcFile, "c")
srcFiles[i] = cFile
genLex(ctx, srcFile, cFile)
case ".ll":
- cppFile := common.GenPathWithExt(ctx, srcFile, "cpp")
+ cppFile := android.GenPathWithExt(ctx, srcFile, "cpp")
srcFiles[i] = cppFile
genLex(ctx, srcFile, cppFile)
}
diff --git a/cc/makevars.go b/cc/makevars.go
index b0d371f..3e72a7a 100644
--- a/cc/makevars.go
+++ b/cc/makevars.go
@@ -19,14 +19,14 @@
"path/filepath"
"strings"
- "android/soong/common"
+ "android/soong/android"
)
func init() {
- common.RegisterMakeVarsProvider(pctx, makeVarsProvider)
+ android.RegisterMakeVarsProvider(pctx, makeVarsProvider)
}
-func makeVarsProvider(ctx common.MakeVarsContext) {
+func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("LLVM_PREBUILTS_VERSION", "${clangVersion}")
ctx.Strict("LLVM_PREBUILTS_BASE", "${clangBase}")
ctx.Strict("LLVM_PREBUILTS_PATH", "${clangBin}")
@@ -35,32 +35,32 @@
ctx.Strict("LLVM_AS", "${clangBin}/llvm-as")
ctx.Strict("LLVM_LINK", "${clangBin}/llvm-link")
- hostType := common.CurrentHostType()
+ hostType := android.CurrentHostType()
arches := ctx.Config().HostArches[hostType]
- makeVarsToolchain(ctx, "", common.Host, hostType, arches[0])
+ makeVarsToolchain(ctx, "", android.Host, hostType, arches[0])
if len(arches) > 1 {
- makeVarsToolchain(ctx, "2ND_", common.Host, hostType, arches[1])
+ makeVarsToolchain(ctx, "2ND_", android.Host, hostType, arches[1])
}
- if winArches, ok := ctx.Config().HostArches[common.Windows]; ok {
- makeVarsToolchain(ctx, "", common.Host, common.Windows, winArches[0])
+ if winArches, ok := ctx.Config().HostArches[android.Windows]; ok {
+ makeVarsToolchain(ctx, "", android.Host, android.Windows, winArches[0])
if len(winArches) > 1 {
- makeVarsToolchain(ctx, "2ND_", common.Host, common.Windows, winArches[1])
+ makeVarsToolchain(ctx, "2ND_", android.Host, android.Windows, winArches[1])
}
}
arches = ctx.Config().DeviceArches
- makeVarsToolchain(ctx, "", common.Device, common.NoHostType, arches[0])
+ makeVarsToolchain(ctx, "", android.Device, android.NoHostType, arches[0])
if len(arches) > 1 {
- makeVarsToolchain(ctx, "2ND_", common.Device, common.NoHostType, arches[1])
+ makeVarsToolchain(ctx, "2ND_", android.Device, android.NoHostType, arches[1])
}
}
-func makeVarsToolchain(ctx common.MakeVarsContext, secondPrefix string,
- hod common.HostOrDevice, ht common.HostType, arch common.Arch) {
+func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
+ hod android.HostOrDevice, ht android.HostType, arch android.Arch) {
var typePrefix string
if hod.Host() {
- if ht == common.Windows {
+ if ht == android.Windows {
typePrefix = "HOST_CROSS_"
} else {
typePrefix = "HOST_"
@@ -102,7 +102,7 @@
if toolchain.ClangSupported() {
clangPrefix := secondPrefix + "CLANG_" + typePrefix
clangExtras := "-target " + toolchain.ClangTriple()
- if ht != common.Darwin {
+ if ht != android.Darwin {
clangExtras += " -B" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), "bin")
}
@@ -131,7 +131,7 @@
ctx.Strict(makePrefix+"CC", gccCmd(toolchain, "gcc"))
ctx.Strict(makePrefix+"CXX", gccCmd(toolchain, "g++"))
- if ht == common.Darwin {
+ if ht == android.Darwin {
ctx.Strict(makePrefix+"AR", "${macArPath}")
} else {
ctx.Strict(makePrefix+"AR", gccCmd(toolchain, "ar"))
@@ -139,7 +139,7 @@
ctx.Strict(makePrefix+"NM", gccCmd(toolchain, "nm"))
}
- if ht == common.Windows {
+ if ht == android.Windows {
ctx.Strict(makePrefix+"OBJDUMP", gccCmd(toolchain, "objdump"))
}
diff --git a/cc/mips64_device.go b/cc/mips64_device.go
index 8f85b47..1bd6a3c 100644
--- a/cc/mips64_device.go
+++ b/cc/mips64_device.go
@@ -17,7 +17,7 @@
import (
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -87,7 +87,7 @@
)
func init() {
- common.RegisterArchFeatures(common.Mips64, "mips64r6",
+ android.RegisterArchFeatures(android.Mips64, "mips64r6",
"rev6")
pctx.StaticVariable("mips64GccVersion", mips64GccVersion)
@@ -185,7 +185,7 @@
return "${mips64ClangLdflags}"
}
-func mips64ToolchainFactory(arch common.Arch) Toolchain {
+func mips64ToolchainFactory(arch android.Arch) Toolchain {
return &toolchainMips64{
cflags: "${mips64Cflags}",
clangCflags: "${mips64ClangCflags}",
@@ -195,5 +195,5 @@
}
func init() {
- registerDeviceToolchainFactory(common.Mips64, mips64ToolchainFactory)
+ registerDeviceToolchainFactory(android.Mips64, mips64ToolchainFactory)
}
diff --git a/cc/mips_device.go b/cc/mips_device.go
index eed18d6..86e7dee 100644
--- a/cc/mips_device.go
+++ b/cc/mips_device.go
@@ -17,7 +17,7 @@
import (
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -122,7 +122,7 @@
)
func init() {
- common.RegisterArchFeatures(common.Mips, "mips32r6",
+ android.RegisterArchFeatures(android.Mips, "mips32r6",
"rev6")
pctx.StaticVariable("mipsGccVersion", mipsGccVersion)
@@ -233,7 +233,7 @@
return "${mipsClangLdflags}"
}
-func mipsToolchainFactory(arch common.Arch) Toolchain {
+func mipsToolchainFactory(arch android.Arch) Toolchain {
return &toolchainMips{
cflags: "${mipsCflags}",
clangCflags: "${mipsClangCflags}",
@@ -243,5 +243,5 @@
}
func init() {
- registerDeviceToolchainFactory(common.Mips, mipsToolchainFactory)
+ registerDeviceToolchainFactory(android.Mips, mipsToolchainFactory)
}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 94c56ce..4162e97 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -20,7 +20,7 @@
"github.com/google/blueprint"
- "android/soong/common"
+ "android/soong/android"
)
type sanitizerType int
@@ -213,7 +213,7 @@
}
if sanitize.Properties.Sanitize.Address {
- if ctx.Arch().ArchType == common.Arm {
+ if ctx.Arch().ArchType == android.Arm {
// Frame pointer based unwinder in ASan requires ARM frame setup.
// TODO: put in flags?
flags.RequiredInstructionSet = "arm"
@@ -268,7 +268,7 @@
}
}
- blacklist := common.OptionalPathForModuleSrc(ctx, sanitize.Properties.Sanitize.Blacklist)
+ blacklist := android.OptionalPathForModuleSrc(ctx, sanitize.Properties.Sanitize.Blacklist)
if blacklist.Valid() {
flags.CFlags = append(flags.CFlags, "-fsanitize-blacklist="+blacklist.String())
flags.CFlagsDeps = append(flags.CFlagsDeps, blacklist.Path())
@@ -311,8 +311,8 @@
}
// Propagate asan requirements down from binaries
-func sanitizerDepsMutator(t sanitizerType) func(common.AndroidTopDownMutatorContext) {
- return func(mctx common.AndroidTopDownMutatorContext) {
+func sanitizerDepsMutator(t sanitizerType) func(android.TopDownMutatorContext) {
+ return func(mctx android.TopDownMutatorContext) {
if c, ok := mctx.Module().(*Module); ok && c.sanitize.Sanitizer(t) {
mctx.VisitDepsDepthFirst(func(module blueprint.Module) {
if d, ok := mctx.Module().(*Module); ok && c.sanitize != nil &&
@@ -325,8 +325,8 @@
}
// Create asan variants for modules that need them
-func sanitizerMutator(t sanitizerType) func(common.AndroidBottomUpMutatorContext) {
- return func(mctx common.AndroidBottomUpMutatorContext) {
+func sanitizerMutator(t sanitizerType) func(android.BottomUpMutatorContext) {
+ return func(mctx android.BottomUpMutatorContext) {
if c, ok := mctx.Module().(*Module); ok && c.sanitize != nil {
if d, ok := c.linker.(baseLinkerInterface); ok && d.isDependencyRoot() && c.sanitize.Sanitizer(t) {
modules := mctx.CreateVariations(t.String())
diff --git a/cc/stl.go b/cc/stl.go
index b84bb6a..cdc887e 100644
--- a/cc/stl.go
+++ b/cc/stl.go
@@ -15,7 +15,7 @@
package cc
import (
- "android/soong/common"
+ "android/soong/android"
"fmt"
)
@@ -52,7 +52,7 @@
ctx.ModuleErrorf("stl: %q is not a supported STL with sdk_version set", stl.Properties.Stl)
return ""
}
- } else if ctx.HostType() == common.Windows {
+ } else if ctx.HostType() == android.Windows {
switch stl.Properties.Stl {
case "libc++", "libc++_static", "libstdc++", "":
// libc++ is not supported on mingw
@@ -97,7 +97,7 @@
deps.StaticLibs = append(deps.StaticLibs, stl.Properties.SelectedStl)
}
if ctx.Device() {
- if ctx.Arch().ArchType == common.Arm {
+ if ctx.Arch().ArchType == android.Arm {
deps.StaticLibs = append(deps.StaticLibs, "libunwind_llvm")
}
if ctx.staticBinary() {
@@ -138,7 +138,7 @@
flags.LdFlags = append(flags.LdFlags, hostDynamicGccLibs[ctx.HostType()]...)
}
} else {
- if ctx.Arch().ArchType == common.Arm {
+ if ctx.Arch().ArchType == android.Arm {
flags.LdFlags = append(flags.LdFlags, "-Wl,--exclude-libs,libunwind_llvm.a")
}
}
@@ -147,14 +147,14 @@
// tree is in good enough shape to not need it.
// Host builds will use GNU libstdc++.
if ctx.Device() {
- flags.CFlags = append(flags.CFlags, "-I"+common.PathForSource(ctx, "bionic/libstdc++/include").String())
+ flags.CFlags = append(flags.CFlags, "-I"+android.PathForSource(ctx, "bionic/libstdc++/include").String())
} else {
// Host builds will use the system C++. libc++ on Darwin, GNU libstdc++ everywhere else
flags.CppFlags = append(flags.CppFlags, flags.Toolchain.SystemCppCppflags())
flags.LdFlags = append(flags.LdFlags, flags.Toolchain.SystemCppLdflags())
}
case "ndk_system":
- ndkSrcRoot := common.PathForSource(ctx, "prebuilts/ndk/current/sources/cxx-stl/system/include")
+ ndkSrcRoot := android.PathForSource(ctx, "prebuilts/ndk/current/sources/cxx-stl/system/include")
flags.CFlags = append(flags.CFlags, "-isystem "+ndkSrcRoot.String())
case "ndk_libc++_shared", "ndk_libc++_static":
// TODO(danalbert): This really shouldn't be here...
@@ -179,20 +179,20 @@
return flags
}
-var hostDynamicGccLibs, hostStaticGccLibs map[common.HostType][]string
+var hostDynamicGccLibs, hostStaticGccLibs map[android.HostType][]string
func init() {
- hostDynamicGccLibs = map[common.HostType][]string{
- common.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"},
- common.Darwin: []string{"-lc", "-lSystem"},
- common.Windows: []string{"-lmsvcr110", "-lmingw32", "-lgcc", "-lmoldname",
+ hostDynamicGccLibs = map[android.HostType][]string{
+ android.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"},
+ android.Darwin: []string{"-lc", "-lSystem"},
+ android.Windows: []string{"-lmsvcr110", "-lmingw32", "-lgcc", "-lmoldname",
"-lmingwex", "-lmsvcrt", "-ladvapi32", "-lshell32", "-luser32",
"-lkernel32", "-lmingw32", "-lgcc", "-lmoldname", "-lmingwex",
"-lmsvcrt"},
}
- hostStaticGccLibs = map[common.HostType][]string{
- common.Linux: []string{"-Wl,--start-group", "-lgcc", "-lgcc_eh", "-lc", "-Wl,--end-group"},
- common.Darwin: []string{"NO_STATIC_HOST_BINARIES_ON_DARWIN"},
- common.Windows: []string{"NO_STATIC_HOST_BINARIES_ON_WINDOWS"},
+ hostStaticGccLibs = map[android.HostType][]string{
+ android.Linux: []string{"-Wl,--start-group", "-lgcc", "-lgcc_eh", "-lc", "-Wl,--end-group"},
+ android.Darwin: []string{"NO_STATIC_HOST_BINARIES_ON_DARWIN"},
+ android.Windows: []string{"NO_STATIC_HOST_BINARIES_ON_WINDOWS"},
}
}
diff --git a/cc/toolchain.go b/cc/toolchain.go
index 09dcff2..d85f1ce 100644
--- a/cc/toolchain.go
+++ b/cc/toolchain.go
@@ -17,28 +17,28 @@
import (
"fmt"
- "android/soong/common"
+ "android/soong/android"
)
-type toolchainFactory func(arch common.Arch) Toolchain
+type toolchainFactory func(arch android.Arch) Toolchain
-var toolchainFactories = map[common.HostOrDevice]map[common.HostType]map[common.ArchType]toolchainFactory{
- common.Host: map[common.HostType]map[common.ArchType]toolchainFactory{
- common.Linux: make(map[common.ArchType]toolchainFactory),
- common.Darwin: make(map[common.ArchType]toolchainFactory),
- common.Windows: make(map[common.ArchType]toolchainFactory),
+var toolchainFactories = map[android.HostOrDevice]map[android.HostType]map[android.ArchType]toolchainFactory{
+ android.Host: map[android.HostType]map[android.ArchType]toolchainFactory{
+ android.Linux: make(map[android.ArchType]toolchainFactory),
+ android.Darwin: make(map[android.ArchType]toolchainFactory),
+ android.Windows: make(map[android.ArchType]toolchainFactory),
},
- common.Device: map[common.HostType]map[common.ArchType]toolchainFactory{
- common.NoHostType: make(map[common.ArchType]toolchainFactory),
+ android.Device: map[android.HostType]map[android.ArchType]toolchainFactory{
+ android.NoHostType: make(map[android.ArchType]toolchainFactory),
},
}
-func registerDeviceToolchainFactory(arch common.ArchType, factory toolchainFactory) {
- toolchainFactories[common.Device][common.NoHostType][arch] = factory
+func registerDeviceToolchainFactory(arch android.ArchType, factory toolchainFactory) {
+ toolchainFactories[android.Device][android.NoHostType][arch] = factory
}
-func registerHostToolchainFactory(ht common.HostType, arch common.ArchType, factory toolchainFactory) {
- toolchainFactories[common.Host][ht][arch] = factory
+func registerHostToolchainFactory(ht android.HostType, arch android.ArchType, factory toolchainFactory) {
+ toolchainFactories[android.Host][ht][arch] = factory
}
type Toolchain interface {
diff --git a/cc/util.go b/cc/util.go
index 70433b1..18a13a2 100644
--- a/cc/util.go
+++ b/cc/util.go
@@ -19,25 +19,25 @@
"regexp"
"strings"
- "android/soong/common"
+ "android/soong/android"
)
// Efficiently converts a list of include directories to a single string
// of cflags with -I prepended to each directory.
-func includeDirsToFlags(dirs common.Paths) string {
- return common.JoinWithPrefix(dirs.Strings(), "-I")
+func includeDirsToFlags(dirs android.Paths) string {
+ return android.JoinWithPrefix(dirs.Strings(), "-I")
}
-func includeFilesToFlags(files common.Paths) string {
- return common.JoinWithPrefix(files.Strings(), "-include ")
+func includeFilesToFlags(files android.Paths) string {
+ return android.JoinWithPrefix(files.Strings(), "-include ")
}
func ldDirsToFlags(dirs []string) string {
- return common.JoinWithPrefix(dirs, "-L")
+ return android.JoinWithPrefix(dirs, "-L")
}
func libNamesToFlags(names []string) string {
- return common.JoinWithPrefix(names, "-l")
+ return android.JoinWithPrefix(names, "-l")
}
func indexList(s string, list []string) int {
diff --git a/cc/x86_64_device.go b/cc/x86_64_device.go
index 7d9edda..65c7c00 100644
--- a/cc/x86_64_device.go
+++ b/cc/x86_64_device.go
@@ -17,7 +17,7 @@
import (
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -99,13 +99,13 @@
)
func init() {
- common.RegisterArchFeatures(common.X86_64, "",
+ android.RegisterArchFeatures(android.X86_64, "",
"ssse3",
"sse4",
"sse4_1",
"sse4_2",
"popcnt")
- common.RegisterArchFeatures(common.X86_64, "haswell",
+ android.RegisterArchFeatures(android.X86_64, "haswell",
"ssse3",
"sse4",
"sse4_1",
@@ -113,7 +113,7 @@
"aes_ni",
"avx",
"popcnt")
- common.RegisterArchFeatures(common.X86_64, "ivybridge",
+ android.RegisterArchFeatures(android.X86_64, "ivybridge",
"ssse3",
"sse4",
"sse4_1",
@@ -121,13 +121,13 @@
"aes_ni",
"avx",
"popcnt")
- common.RegisterArchFeatures(common.X86_64, "sandybridge",
+ android.RegisterArchFeatures(android.X86_64, "sandybridge",
"ssse3",
"sse4",
"sse4_1",
"sse4_2",
"popcnt")
- common.RegisterArchFeatures(common.X86_64, "silvermont",
+ android.RegisterArchFeatures(android.X86_64, "silvermont",
"ssse3",
"sse4",
"sse4_1",
@@ -239,7 +239,7 @@
return "${x86_64Ldflags}"
}
-func x86_64ToolchainFactory(arch common.Arch) Toolchain {
+func x86_64ToolchainFactory(arch android.Arch) Toolchain {
toolchainCflags := []string{
"${x86_64ToolchainCflags}",
"${x86_64" + arch.ArchVariant + "VariantCflags}",
@@ -262,5 +262,5 @@
}
func init() {
- registerDeviceToolchainFactory(common.X86_64, x86_64ToolchainFactory)
+ registerDeviceToolchainFactory(android.X86_64, x86_64ToolchainFactory)
}
diff --git a/cc/x86_darwin_host.go b/cc/x86_darwin_host.go
index 52add5c..bd164e3 100644
--- a/cc/x86_darwin_host.go
+++ b/cc/x86_darwin_host.go
@@ -5,7 +5,7 @@
"os/exec"
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -97,7 +97,7 @@
})
pctx.StaticVariable("macToolchainRoot", "${macSdkPath}/Toolchains/XcodeDefault.xctoolchain")
pctx.VariableFunc("macSdkRoot", func(config interface{}) (string, error) {
- return xcrunSdk(config.(common.Config), "--show-sdk-path")
+ return xcrunSdk(config.(android.Config), "--show-sdk-path")
})
pctx.StaticVariable("macSdkVersion", darwinSupportedSdkVersions[0])
pctx.VariableFunc("macArPath", func(config interface{}) (string, error) {
@@ -138,7 +138,7 @@
pctx.StaticVariable("darwinX8664ClangLdflags", strings.Join(darwinX8664ClangLdflags, " "))
}
-func xcrunSdk(config common.Config, arg string) (string, error) {
+func xcrunSdk(config android.Config, arg string) (string, error) {
if selected := config.Getenv("MAC_SDK_VERSION"); selected != "" {
if !inList(selected, darwinSupportedSdkVersions) {
return "", fmt.Errorf("MAC_SDK_VERSION %s isn't supported: %q", selected, darwinSupportedSdkVersions)
@@ -261,15 +261,15 @@
var toolchainDarwinX86Singleton Toolchain = &toolchainDarwinX86{}
var toolchainDarwinX8664Singleton Toolchain = &toolchainDarwinX8664{}
-func darwinX86ToolchainFactory(arch common.Arch) Toolchain {
+func darwinX86ToolchainFactory(arch android.Arch) Toolchain {
return toolchainDarwinX86Singleton
}
-func darwinX8664ToolchainFactory(arch common.Arch) Toolchain {
+func darwinX8664ToolchainFactory(arch android.Arch) Toolchain {
return toolchainDarwinX8664Singleton
}
func init() {
- registerHostToolchainFactory(common.Darwin, common.X86, darwinX86ToolchainFactory)
- registerHostToolchainFactory(common.Darwin, common.X86_64, darwinX8664ToolchainFactory)
+ registerHostToolchainFactory(android.Darwin, android.X86, darwinX86ToolchainFactory)
+ registerHostToolchainFactory(android.Darwin, android.X86_64, darwinX8664ToolchainFactory)
}
diff --git a/cc/x86_device.go b/cc/x86_device.go
index 4c0d624..d0bd8a0 100644
--- a/cc/x86_device.go
+++ b/cc/x86_device.go
@@ -17,7 +17,7 @@
import (
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -113,16 +113,16 @@
)
func init() {
- common.RegisterArchFeatures(common.X86, "x86_64",
+ android.RegisterArchFeatures(android.X86, "x86_64",
"ssse3",
"sse4",
"sse4_1",
"sse4_2",
"popcnt")
- common.RegisterArchFeatures(common.X86, "atom",
+ android.RegisterArchFeatures(android.X86, "atom",
"ssse3",
"movbe")
- common.RegisterArchFeatures(common.X86, "haswell",
+ android.RegisterArchFeatures(android.X86, "haswell",
"ssse3",
"sse4",
"sse4_1",
@@ -131,7 +131,7 @@
"avx",
"popcnt",
"movbe")
- common.RegisterArchFeatures(common.X86, "ivybridge",
+ android.RegisterArchFeatures(android.X86, "ivybridge",
"ssse3",
"sse4",
"sse4_1",
@@ -139,13 +139,13 @@
"aes_ni",
"avx",
"popcnt")
- common.RegisterArchFeatures(common.X86, "sandybridge",
+ android.RegisterArchFeatures(android.X86, "sandybridge",
"ssse3",
"sse4",
"sse4_1",
"sse4_2",
"popcnt")
- common.RegisterArchFeatures(common.X86, "silvermont",
+ android.RegisterArchFeatures(android.X86, "silvermont",
"ssse3",
"sse4",
"sse4_1",
@@ -262,7 +262,7 @@
return "libclang_rt.asan-i686-android.so"
}
-func x86ToolchainFactory(arch common.Arch) Toolchain {
+func x86ToolchainFactory(arch android.Arch) Toolchain {
toolchainCflags := []string{
"${x86ToolchainCflags}",
"${x86" + arch.ArchVariant + "VariantCflags}",
@@ -285,5 +285,5 @@
}
func init() {
- registerDeviceToolchainFactory(common.X86, x86ToolchainFactory)
+ registerDeviceToolchainFactory(android.X86, x86ToolchainFactory)
}
diff --git a/cc/x86_linux_host.go b/cc/x86_linux_host.go
index 246f83a..6562e6a 100644
--- a/cc/x86_linux_host.go
+++ b/cc/x86_linux_host.go
@@ -3,7 +3,7 @@
import (
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -227,15 +227,15 @@
var toolchainLinuxX86Singleton Toolchain = &toolchainLinuxX86{}
var toolchainLinuxX8664Singleton Toolchain = &toolchainLinuxX8664{}
-func linuxX86ToolchainFactory(arch common.Arch) Toolchain {
+func linuxX86ToolchainFactory(arch android.Arch) Toolchain {
return toolchainLinuxX86Singleton
}
-func linuxX8664ToolchainFactory(arch common.Arch) Toolchain {
+func linuxX8664ToolchainFactory(arch android.Arch) Toolchain {
return toolchainLinuxX8664Singleton
}
func init() {
- registerHostToolchainFactory(common.Linux, common.X86, linuxX86ToolchainFactory)
- registerHostToolchainFactory(common.Linux, common.X86_64, linuxX8664ToolchainFactory)
+ registerHostToolchainFactory(android.Linux, android.X86, linuxX86ToolchainFactory)
+ registerHostToolchainFactory(android.Linux, android.X86_64, linuxX8664ToolchainFactory)
}
diff --git a/cc/x86_windows_host.go b/cc/x86_windows_host.go
index 60d88a1..34d63c3 100644
--- a/cc/x86_windows_host.go
+++ b/cc/x86_windows_host.go
@@ -17,7 +17,7 @@
import (
"strings"
- "android/soong/common"
+ "android/soong/android"
)
var (
@@ -186,15 +186,15 @@
var toolchainWindowsX86Singleton Toolchain = &toolchainWindowsX86{}
var toolchainWindowsX8664Singleton Toolchain = &toolchainWindowsX8664{}
-func windowsX86ToolchainFactory(arch common.Arch) Toolchain {
+func windowsX86ToolchainFactory(arch android.Arch) Toolchain {
return toolchainWindowsX86Singleton
}
-func windowsX8664ToolchainFactory(arch common.Arch) Toolchain {
+func windowsX8664ToolchainFactory(arch android.Arch) Toolchain {
return toolchainWindowsX8664Singleton
}
func init() {
- registerHostToolchainFactory(common.Windows, common.X86, windowsX86ToolchainFactory)
- registerHostToolchainFactory(common.Windows, common.X86_64, windowsX8664ToolchainFactory)
+ registerHostToolchainFactory(android.Windows, android.X86, windowsX86ToolchainFactory)
+ registerHostToolchainFactory(android.Windows, android.X86_64, windowsX8664ToolchainFactory)
}