===== BUILD LOCATION =============================================================================================
9158
def derived_data_location
      derived_data_style = value_for_setting('IDEWorkspaceUserSettings_DerivedDataLocationStyle')
      custom_derived_data_location = value_for_setting('IDEWorkspaceUserSettings_DerivedDataCustomLocation')
      
      if derived_data_style == 2 # 2 is the code for 'Workspace-relative path'
        File.expand_path(custom_derived_data_location, self.root)
      else
        
        prefs = RXCode.xcode_preferences
        if prefs.derived_data_location_is_relative_to_workspace?
          File.expand_path(prefs.derived_data_location, self.root)
        else
          prefs.derived_data_location
        end
        
      end
    end
994651
function buildApp(src, dest, options, callback) {
  const appArgs = selectAppArgs(options);
  copy(src, dest, (error) => {
    if (error) {
      callback(`Error Copying temporary directory: ${error}`);
      return;
    }

    fs.writeFileSync(
      path.join(dest, '/nativefier.json'),
      JSON.stringify(appArgs),
    );

    maybeCopyScripts(options.inject, dest)
      .catch((err) => {
        log.warn(err);
      })
      .then(() => {
        changeAppPackageJsonName(dest, appArgs.name, appArgs.targetUrl);
        callback();
      });
  });
}
258923
function builder (config, configPath, callback) {
	var inc = new Include(config)
	inc
		.on('drain', function () {
			// All files and their dependencies loaded, root files (files with no parent file) built
			inc.build(function () {

				var output = path.resolve( configPath, config.output.path )
				var outputFiles = []

				debug('Include DONE: %d roots found output=%s', inc.roots.length, output)
				async.forEach(
					inc.roots
				, function (file, cb) {
						var relfile = path.join( output, path.relative(configPath, file.id) )

						outputFiles.push(relfile)

						debug('Include WRITING: file=%s', relfile)
						var w = fstream
							.Writer({
								path: relfile
							, mode: config.output.mode
							})
							w
							.on('close', cb)

							if (file.content)
								w.end(file.content)
							else
								fs.createReadStream(file.id).pipe(w)
				  }
				, function (err) {
						if (err) return callback(err)
						debug('%d files written out to %s', inc.roots.length, output)
						callback(
							null
						, outputFiles
						, inc.sourceFiles
						, inc.roots.map(function(root) {
								return root.id
							})
						)
					}
				)
			})
		})

	debug( path.resolve( configPath, config.input.include || '*.js' ) )
	debug( config.input.include || '*.js' )
	debug( config.input.exclude || '' )
	fileset(
		config.input.include || '*.js'
	, config.input.exclude || ''
	, { cwd: configPath }
	, function (err, files) {
			if (err) throw err

			debug('files', files)
			files
				.forEach(function (file) {
					inc.add( path.resolve( configPath, file) )
				})
		}
	)
}
268873
function customStrategy(projectDir, builder, cb)
{
  const dest = builder.getTargetDestination(projectDir);
  shelljs.rm('-rf', dest);

  const copyOptions = { overwrite: true, expand: true, dot: true };

  const onCustomInstallerFilesReady = function (err) {
    builder.buildFromSource(dest, projectDir);
    cb();
  };

  const onInstallerFilesReady = function (err) {
    if (err) {
      cb(err);
      return;
    }

    let customInstallerSrc = path.resolve(projectDir, "src", "installer");
    customInstallerSrc = fs.realpathSync(customInstallerSrc);

    const customInstallerTarget = path.resolve(dest, "src", "settings");
    copy(customInstallerSrc, customInstallerTarget, copyOptions, onCustomInstallerFilesReady);
  };

  let installerDir = path.resolve(projectDir, "node_modules", "@deskpro", INSTALLER_PACKAGE_NAME);
  installerDir = fs.realpathSync(installerDir);
  copy(installerDir, dest, copyOptions, onInstallerFilesReady);
}
574674
function build(importsObj, tree) {
  const modules = {};

  const instantiate = filepath => {
    if (modules[filepath] != null) {
      return modules[filepath];
    }

    const mod = tree.modules[filepath];
    const promise = Promise.all(
      Object.entries(mod.deps).map(([key, dep]) => {
        return instantiate(dep.filepath).then(result => [key, result]);
      })
    )
      .then(importsMap => {
        const imports = importsMap.reduce((acc, [key, module]) => {
          acc[key] = module.instance.exports;
          return acc;
        }, {});

        return WebAssembly.instantiate(
          tree.opcodes[filepath],
          Object.assign({}, imports, importsObj)
        );
      })
      .catch(e => {
        // TODO: do some logging here
        throw e;
      });

    modules[filepath] = promise;

    return promise;
  };

  modules[tree.root.filepath] = instantiate(tree.root.filepath);

  return modules[tree.root.filepath];
}
844604
def TryBuild(self, builder, text = None, extension = ""):
        
        global _ac_build_counter

        # Make sure we have a PSPAWN value, and save the current
        # SPAWN value.
        try:
            self.pspawn = self.env['PSPAWN']
        except KeyError:
            raise SCons.Errors.UserError('Missing PSPAWN construction variable.')
        try:
            save_spawn = self.env['SPAWN']
        except KeyError:
            raise SCons.Errors.UserError('Missing SPAWN construction variable.')

        nodesToBeBuilt = []

        f = "conftest_" + str(_ac_build_counter)
        pref = self.env.subst( builder.builder.prefix )
        suff = self.env.subst( builder.builder.suffix )
        target = self.confdir.File(pref + f + suff)

        try:
            # Slide our wrapper into the construction environment as
            # the SPAWN function.
            self.env['SPAWN'] = self.pspawn_wrapper
            sourcetext = self.env.Value(text)

            if text is not None:
                textFile = self.confdir.File(f + extension)
                textFileNode = self.env.SConfSourceBuilder(target=textFile,
                                                           source=sourcetext)
                nodesToBeBuilt.extend(textFileNode)
                source = textFileNode
            else:
                source = None

            nodes = builder(target = target, source = source)
            if not SCons.Util.is_List(nodes):
                nodes = [nodes]
            nodesToBeBuilt.extend(nodes)
            result = self.BuildNodes(nodesToBeBuilt)

        finally:
            self.env['SPAWN'] = save_spawn

        _ac_build_counter = _ac_build_counter + 1
        if result:
            self.lastTarget = nodes[0]
        else:
            self.lastTarget = None

        return result
1296796
function buildBuildList() {
  const buildList = {
    'build/tests.js': allPackages.map(pkg => `packages/${pkg}/test/*.js`)
  };
  allPackages.forEach(pkg => {
    buildList[`packages/${pkg}/dist/${pkg}.js`] = [`packages/${pkg}/globals.js`];
  });
  buildList['packages/demos/dist/demos.js'] = ['packages/demos/src/*.js'];
  return buildList;
}
1030802
function createLocation () {
  var deferred = q.defer();

  // Make the directory, and report status
  mkdirp(globalConfig.db.location, function (err, made) {
    if(err) return deferred.reject(err);

    deferred.resolve(made);
  });

  return deferred.promise;
}
279955
def in_builddir(sub='.'):
    
    from functools import wraps

    def wrap_in_builddir(func):
        """Wrap the function for the new build directory."""

        @wraps(func)
        def wrap_in_builddir_func(self, *args, **kwargs):
            """The actual function inside the wrapper for the new builddir."""
            p = local.path(self.builddir) / sub
            if not p.exists():
                LOG.error("%s does not exist.", p)

            if p == local.cwd:
                LOG.debug("CWD already is %s", p)
                return func(self, *args, *kwargs)
            with local.cwd(p):
                return func(self, *args, **kwargs)

        return wrap_in_builddir_func

    return wrap_in_builddir
573446
def build(context, provider, **kwargs):  # pylint: disable=unused-argument
    """"""
    session = get_session(provider.region)
    options = kwargs.get('options', {})
    context_dict = {}
    context_dict['artifact_key_prefix'] = "%s-%s-" % (options['namespace'], options['name'])  # noqa
    default_param_name = "%shash" % context_dict['artifact_key_prefix']

    if options.get('build_output'):
        build_output = os.path.join(
            options['path'],
            options['build_output']
        )
    else:
        build_output = options['path']

    context_dict['artifact_bucket_name'] = RxrefLookup.handle(
        kwargs.get('artifact_bucket_rxref_lookup'),
        provider=provider,
        context=context
    )

    if options.get('pre_build_steps'):
        run_commands(options['pre_build_steps'], options['path'])

    context_dict['hash'] = get_hash_of_files(
        root_path=options['path'],
        directories=options.get('source_hashing', {}).get('directories')
    )

    # Now determine if the current staticsite has already been deployed
    if options.get('source_hashing', {}).get('enabled', True):
        context_dict['hash_tracking_parameter'] = options.get(
            'source_hashing', {}).get('parameter', default_param_name)

        ssm_client = session.client('ssm')

        try:
            old_parameter_value = ssm_client.get_parameter(
                Name=context_dict['hash_tracking_parameter']
            )['Parameter']['Value']
        except ssm_client.exceptions.ParameterNotFound:
            old_parameter_value = None
    else:
        context_dict['hash_tracking_disabled'] = True
        old_parameter_value = None

    context_dict['current_archive_filename'] = (
        context_dict['artifact_key_prefix'] + context_dict['hash'] + '.zip'
    )
    if old_parameter_value:
        context_dict['old_archive_filename'] = (
            context_dict['artifact_key_prefix'] + old_parameter_value + '.zip'
        )

    if old_parameter_value == context_dict['hash']:
        LOGGER.info("staticsite: skipping build; app hash %s already deployed "
                    "in this environment",
                    context_dict['hash'])
        context_dict['deploy_is_current'] = True
        return context_dict

    if does_s3_object_exist(context_dict['artifact_bucket_name'],
                            context_dict['current_archive_filename'],
                            session):
        context_dict['app_directory'] = download_and_extract_to_mkdtemp(
            context_dict['artifact_bucket_name'],
            context_dict['current_archive_filename'], session
        )
    else:
        if options.get('build_steps'):
            LOGGER.info('staticsite: executing build commands')
            run_commands(options['build_steps'], options['path'])
        zip_and_upload(build_output, context_dict['artifact_bucket_name'],
                       context_dict['current_archive_filename'], session)
        context_dict['app_directory'] = build_output

    context_dict['deploy_is_current'] = False
    return context_dict
1155345
function build(argv, skyPagesConfig, webpack) {

  const lintResult = tsLinter.lintSync();
  const isAot = skyPagesConfig &&
    skyPagesConfig.skyux &&
    skyPagesConfig.skyux.compileMode === 'aot';

  if (lintResult.exitCode > 0) {
    return Promise.reject(lintResult.errors);
  } else {
    localeAssetsProcessor.prepareLocaleFiles();
    const name = argv.serve ? buildServe : buildCompiler;

    return name(argv, skyPagesConfig, webpack, isAot);
  }
}
1727
function prepareBuild(config) {

  function serve(exitCode) {

    // Save our exitCode for testing
    _exitCode = exitCode;

    // Reset skyuxconfig.json
    resetConfig();

    return server.start('unused-root', tmp)
      .then(port => browser.get(`https://localhost:${port}/dist/`));
  }

  writeConfig(config);

  return new Promise((resolve, reject) => {
    rimrafPromise(path.join(tmp, 'dist'))
      .then(() => exec(`node`, [cliPath, `build`, `--logFormat`, `none`], cwdOpts))
      .then(serve)
      .then(resolve)
      .catch(err => reject(err));
  });
}
500064
function getServerBuildDirectory(): string {
  // Generate a random string to ensure uniqueness
  const buildToken = crypto.randomBytes(16).toString('hex');
  return path.resolve(os.tmpdir(), `nucleate-${buildToken}`);
}
1077553
@Override
    public void build() {
        if (site != null) {
            site.getProcessors().beforeBuildTheme(this);
        }

        initializeResourceBuilders();
        if (!builders.isEmpty()) {
            try {
                for (ResourceBuilder builder : builders) {
                    builder.build();
                }
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new RuntimeException("Theme build exception", e);
            }
        }

        if (site != null) {
            site.getProcessors().afterBuildTheme(this);
        }
    }
1362753
function build() {
  console.log('Creating an optimized production build...\n');

  webpack(config)
    .run((err, stats) => {
      if (err) {
        printErrors('Failed to compile.', [err]);
        process.exit(1);
      }

      if (stats.compilation.errors.length) {
        printErrors('Failed to compile.', stats.compilation.errors);
        process.exit(1);
      }

      if (process.env.CI && stats.compilation.warnings.length) {
        printErrors('Failed to compile.', stats.compilation.warnings);
        process.exit(1);
      }

      logSuccess('Compiled successfully.\n');

      console.log('Bundle size details:\n');
      printFileSizes(stats);

      console.log(`\nThe ${chalk.green('build')} folder is ready to be deployed.\n`);
    });
}
326906
function build(config, locale, done) {
  const shouldWatch = (util.env[`watch`] || util.env[`w`]) && (config.watch !== false);

  if (locale && config.i18n && (config.i18n.locales instanceof Array) && (locale === config.i18n.locales[0]))
    locale = undefined;

  config = normalizeConfig(config, locale);

  metalsmith(config.base || __dirname)
    .clean(false)
    .source(config.src)
    .ignore(config.ignore)
    .destination(config.dest)
    .metadata(config.metadata.global)
    .use(collections(config.collections))
    .use(related(config.related))
    .use((config.tags) ? tags(config.tags) : noop())
    .use(pagination(config.pagination))
    .use(metadata(config.metadata.collections))
    .use(markdown(config.markdown))
    .use(config.multilingual ? multilingual(locale) : noop())
    .use(permalinks(config.permalinks))
    .use(pathfinder(locale, config.i18n && config.i18n.locales))
    .use(layouts(config.layouts))
    .use(inPlace(config.inPlace))
    .use((config.prism !== false) ? prism(config.prism, locale) : noop())
    .use((config.mathjax !== false) ? mathjax(config.mathjax, locale) : noop())
    .use(permalinks(config.permalinks))
    .use(reporter(locale))
    .build(function(err) {
      if (err && shouldWatch) util.log(util.colors.blue(`[metalsmith]`), util.colors.red(err));
      done(!shouldWatch && err);
    });
}
44230
def build(self):
        """"""
        if os.path.exists(self.build_path) and not os.path.isdir(self.build_path):
            self._logger.error('Output path must be a folder if it already exists')
            return
        Compiler._mkdir(self.build_path)
        self._execute_backend_on_spec()