Merge "Make OutDir() and SoongOutDir() be consistent."
This commit is contained in:
@@ -72,7 +72,7 @@ func (c Config) SoongOutDir() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c Config) OutDir() string {
|
func (c Config) OutDir() string {
|
||||||
return c.soongOutDir
|
return c.outDir
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Config) RunGoTests() bool {
|
func (c Config) RunGoTests() bool {
|
||||||
@@ -138,7 +138,8 @@ type config struct {
|
|||||||
|
|
||||||
deviceConfig *deviceConfig
|
deviceConfig *deviceConfig
|
||||||
|
|
||||||
soongOutDir string // the path of the build output directory
|
outDir string // The output directory (usually out/)
|
||||||
|
soongOutDir string
|
||||||
moduleListFile string // the path to the file which lists blueprint files to parse.
|
moduleListFile string // the path to the file which lists blueprint files to parse.
|
||||||
|
|
||||||
runGoTests bool
|
runGoTests bool
|
||||||
@@ -302,9 +303,10 @@ func saveToBazelConfigFile(config *productVariables, outDir string) error {
|
|||||||
|
|
||||||
// NullConfig returns a mostly empty Config for use by standalone tools like dexpreopt_gen that
|
// NullConfig returns a mostly empty Config for use by standalone tools like dexpreopt_gen that
|
||||||
// use the android package.
|
// use the android package.
|
||||||
func NullConfig(soongOutDir string) Config {
|
func NullConfig(outDir, soongOutDir string) Config {
|
||||||
return Config{
|
return Config{
|
||||||
config: &config{
|
config: &config{
|
||||||
|
outDir: outDir,
|
||||||
soongOutDir: soongOutDir,
|
soongOutDir: soongOutDir,
|
||||||
fs: pathtools.OsFs,
|
fs: pathtools.OsFs,
|
||||||
},
|
},
|
||||||
@@ -338,6 +340,9 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
|
|||||||
ShippingApiLevel: stringPtr("30"),
|
ShippingApiLevel: stringPtr("30"),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
outDir: buildDir,
|
||||||
|
// soongOutDir is inconsistent with production (it should be buildDir + "/soong")
|
||||||
|
// but a lot of tests assume this :(
|
||||||
soongOutDir: buildDir,
|
soongOutDir: buildDir,
|
||||||
captureBuild: true,
|
captureBuild: true,
|
||||||
env: envCopy,
|
env: envCopy,
|
||||||
@@ -434,6 +439,7 @@ func NewConfig(cmdlineArgs bootstrap.Args, soongOutDir string, availableEnv map[
|
|||||||
|
|
||||||
env: availableEnv,
|
env: availableEnv,
|
||||||
|
|
||||||
|
outDir: cmdlineArgs.OutDir,
|
||||||
soongOutDir: soongOutDir,
|
soongOutDir: soongOutDir,
|
||||||
runGoTests: cmdlineArgs.RunGoTests,
|
runGoTests: cmdlineArgs.RunGoTests,
|
||||||
useValidationsForGoTests: cmdlineArgs.UseValidations,
|
useValidationsForGoTests: cmdlineArgs.UseValidations,
|
||||||
|
@@ -35,7 +35,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
topDir string
|
topDir string
|
||||||
outDir string
|
soongOutDir string
|
||||||
availableEnvFile string
|
availableEnvFile string
|
||||||
usedEnvFile string
|
usedEnvFile string
|
||||||
|
|
||||||
@@ -55,13 +55,12 @@ var (
|
|||||||
func init() {
|
func init() {
|
||||||
// Flags that make sense in every mode
|
// Flags that make sense in every mode
|
||||||
flag.StringVar(&topDir, "top", "", "Top directory of the Android source tree")
|
flag.StringVar(&topDir, "top", "", "Top directory of the Android source tree")
|
||||||
flag.StringVar(&outDir, "out", "", "Soong output directory (usually $TOP/out/soong)")
|
flag.StringVar(&soongOutDir, "soong_out", "", "Soong output directory (usually $TOP/out/soong)")
|
||||||
flag.StringVar(&availableEnvFile, "available_env", "", "File containing available environment variables")
|
flag.StringVar(&availableEnvFile, "available_env", "", "File containing available environment variables")
|
||||||
flag.StringVar(&usedEnvFile, "used_env", "", "File containing used environment variables")
|
flag.StringVar(&usedEnvFile, "used_env", "", "File containing used environment variables")
|
||||||
flag.StringVar(&globFile, "globFile", "build-globs.ninja", "the Ninja file of globs to output")
|
flag.StringVar(&globFile, "globFile", "build-globs.ninja", "the Ninja file of globs to output")
|
||||||
flag.StringVar(&globListDir, "globListDir", "", "the directory containing the glob list files")
|
flag.StringVar(&globListDir, "globListDir", "", "the directory containing the glob list files")
|
||||||
flag.StringVar(&cmdlineArgs.SoongOutDir, "b", ".", "the build output directory")
|
flag.StringVar(&cmdlineArgs.OutDir, "out", "", "the ninja builddir directory")
|
||||||
flag.StringVar(&cmdlineArgs.OutDir, "n", "", "the ninja builddir directory")
|
|
||||||
flag.StringVar(&cmdlineArgs.ModuleListFile, "l", "", "file that lists filepaths to parse")
|
flag.StringVar(&cmdlineArgs.ModuleListFile, "l", "", "file that lists filepaths to parse")
|
||||||
|
|
||||||
// Debug flags
|
// Debug flags
|
||||||
@@ -298,7 +297,7 @@ func main() {
|
|||||||
|
|
||||||
availableEnv := parseAvailableEnv()
|
availableEnv := parseAvailableEnv()
|
||||||
|
|
||||||
configuration := newConfig(cmdlineArgs, outDir, availableEnv)
|
configuration := newConfig(cmdlineArgs, soongOutDir, availableEnv)
|
||||||
extraNinjaDeps := []string{
|
extraNinjaDeps := []string{
|
||||||
configuration.ProductVariablesFileName,
|
configuration.ProductVariablesFileName,
|
||||||
usedEnvFile,
|
usedEnvFile,
|
||||||
|
@@ -87,7 +87,9 @@ func main() {
|
|||||||
usage("--module configuration file is required")
|
usage("--module configuration file is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := &builderContext{android.NullConfig(*outDir)}
|
// NOTE: duplicating --out_dir here is incorrect (one should be the another
|
||||||
|
// plus "/soong" but doing so apparently breaks dexpreopt
|
||||||
|
ctx := &builderContext{android.NullConfig(*outDir, *outDir)}
|
||||||
|
|
||||||
globalSoongConfigData, err := ioutil.ReadFile(*globalSoongConfigPath)
|
globalSoongConfigData, err := ioutil.ReadFile(*globalSoongConfigPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user