Lines Matching refs:config
28 func SetupOutDir(ctx Context, config Config) {
29 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "Android.mk"))
30 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "CleanSpec.mk"))
31 if !config.SkipMake() {
32 ensureEmptyFileExists(ctx, filepath.Join(config.SoongOutDir(), ".soong.in_make"))
36 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "ninja_build"))
37 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), ".out-dir"))
39 if buildDateTimeFile, ok := config.environ.Get("BUILD_DATETIME_FILE"); ok {
40 err := ioutil.WriteFile(buildDateTimeFile, []byte(config.buildDateTime), 0777)
62 func createCombinedBuildNinjaFile(ctx Context, config Config) {
64 if config.SkipMake() {
65 if _, err := os.Stat(config.CombinedNinjaFile()); err == nil || !os.IsNotExist(err) {
70 file, err := os.Create(config.CombinedNinjaFile())
76 if err := combinedBuildNinjaTemplate.Execute(file, config); err != nil {
102 func checkCaseSensitivity(ctx Context, config Config) {
103 outDir := config.OutDir()
133 func help(ctx Context, config Config, what int) {
134 cmd := Command(ctx, config, "help.sh", "build/make/help.sh")
141 func Build(ctx Context, config Config, what int) {
142 ctx.Verboseln("Starting build with args:", config.Arguments())
143 ctx.Verboseln("Environment:", config.Environment().Environ())
145 if totalRAM := config.TotalRAM(); totalRAM != 0 {
159 } else if ram <= float32(config.Parallel()) {
160 ctx.Printf("Warning: high -j%d count compared to %.3vGB of RAM", config.Parallel(), ram)
168 if config.SkipMake() {
173 if inList("help", config.Arguments()) {
174 help(ctx, config, what)
176 } else if inList("clean", config.Arguments()) || inList("clobber", config.Arguments()) {
177 clean(ctx, config, what)
182 buildLock := BecomeSingletonOrFail(ctx, config)
187 SetupOutDir(ctx, config)
189 checkCaseSensitivity(ctx, config)
191 ensureEmptyDirectoriesExist(ctx, config.TempDir())
193 SetupPath(ctx, config)
195 if config.StartGoma() {
197 startGoma(ctx, config)
200 if config.StartRBE() {
202 startRBE(ctx, config)
206 // Run make for product config
207 runMakeProductConfig(ctx, config)
210 if inList("installclean", config.Arguments()) ||
211 inList("install-clean", config.Arguments()) {
212 installClean(ctx, config, what)
215 } else if inList("dataclean", config.Arguments()) ||
216 inList("data-clean", config.Arguments()) {
217 dataClean(ctx, config, what)
224 runSoong(ctx, config)
229 genKatiSuffix(ctx, config)
230 runKatiCleanSpec(ctx, config)
231 runKatiBuild(ctx, config)
232 runKatiPackage(ctx, config)
234 ioutil.WriteFile(config.LastKatiSuffixFile(), []byte(config.KatiSuffix()), 0777)
237 if katiSuffix, err := ioutil.ReadFile(config.LastKatiSuffixFile()); err == nil {
238 ctx.Verboseln("Loaded previous kati config:", string(katiSuffix))
239 config.SetKatiSuffix(string(katiSuffix))
244 createCombinedBuildNinjaFile(ctx, config)
246 distGzipFile(ctx, config, config.CombinedNinjaFile())
249 testForDanglingRules(ctx, config)
253 if !config.SkipMake() {
254 installCleanIfNecessary(ctx, config)
258 runNinja(ctx, config)
264 func distGzipFile(ctx Context, config Config, src string, subDirs ...string) {
265 if !config.Dist() {
270 destDir := filepath.Join(config.DistDir(), "soong_ui", subDir)
286 func distFile(ctx Context, config Config, src string, subDirs ...string) {
287 if !config.Dist() {
292 destDir := filepath.Join(config.DistDir(), "soong_ui", subDir)