For a distutils command to verify that the artifact build step is
    possible.
558044
def has_calmjs_artifact_declarations(cmd, registry_name='calmjs.artifacts'):
    

    return any(get(registry_name).iter_records_for(
        cmd.distribution.get_name()))
33725
def build(self):
        
        pkg_security([self.name])
        self.error_uns()
        if self.FAULT:
            print("")
            self.msg.template(78)
            print("| Package {0} {1} {2} {3}".format(self.prgnam, self.red,
                                                     self.FAULT, self.endc))
            self.msg.template(78)
        else:
            sources = []
            if not os.path.exists(self.meta.build_path):
                os.makedirs(self.meta.build_path)
            if not os.path.exists(self._SOURCES):
                os.makedirs(self._SOURCES)
            os.chdir(self.meta.build_path)
            Download(self.meta.build_path, self.sbo_dwn.split(),
                     repo="sbo").start()
            Download(self._SOURCES, self.source_dwn, repo="sbo").start()
            script = self.sbo_dwn.split("/")[-1]
            for src in self.source_dwn:
                sources.append(src.split("/")[-1])
            BuildPackage(script, sources, self.meta.build_path,
                         auto=False).build()
            slack_package(self.prgnam)
636664
def _create_dist(self,
                   dist_tgt,
                   dist_target_dir,
                   setup_requires_pex,
                   snapshot_fingerprint,
                   is_platform_specific):
    """"""
    self._copy_sources(dist_tgt, dist_target_dir)

    setup_py_snapshot_version_argv = self._generate_snapshot_bdist_wheel_argv(
      snapshot_fingerprint, is_platform_specific)

    cmd = safe_shlex_join(setup_requires_pex.cmdline(setup_py_snapshot_version_argv))
    with self.context.new_workunit('setup.py', cmd=cmd, labels=[WorkUnitLabel.TOOL]) as workunit:
      with pushd(dist_target_dir):
        result = setup_requires_pex.run(args=setup_py_snapshot_version_argv,
                                        stdout=workunit.output('stdout'),
                                        stderr=workunit.output('stderr'))
        if result != 0:
          raise self.BuildLocalPythonDistributionsError(
            "Installation of python distribution from target {target} into directory {into_dir} "
            "failed (return value of run() was: {rc!r}).\n"
            "The pex with any requirements is located at: {interpreter}.\n"
            "The host system's compiler and linker were used.\n"
            "The setup command was: {command}."
            .format(target=dist_tgt,
                    into_dir=dist_target_dir,
                    rc=result,
                    interpreter=setup_requires_pex.path(),
                    command=setup_py_snapshot_version_argv))
136711
def _verify_install(desired, new_pkgs, ignore_epoch=False, new_caps=None):
    '''
    
    '''
    ok = []
    failed = []
    if not new_caps:
        new_caps = dict()
    for pkgname, pkgver in desired.items():
        # FreeBSD pkg supports `openjdk` and `java/openjdk7` package names.
        # Homebrew for Mac OSX does something similar with tap names
        # prefixing package names, separated with a slash.
        has_origin = '/' in pkgname

        if __grains__['os'] == 'FreeBSD' and has_origin:
            cver = [k for k, v in six.iteritems(new_pkgs) if v['origin'] == pkgname]
        elif __grains__['os'] == 'MacOS' and has_origin:
            cver = new_pkgs.get(pkgname, new_pkgs.get(pkgname.split('/')[-1]))
        elif __grains__['os'] == 'OpenBSD':
            cver = new_pkgs.get(pkgname.split('%')[0])
        elif __grains__['os_family'] == 'Debian':
            cver = new_pkgs.get(pkgname.split('=')[0])
        else:
            cver = new_pkgs.get(pkgname)
            if not cver and pkgname in new_caps:
                cver = new_pkgs.get(new_caps.get(pkgname)[0])

        if not cver:
            failed.append(pkgname)
            continue
        elif pkgver == 'latest':
            ok.append(pkgname)
            continue
        elif not __salt__['pkg_resource.version_clean'](pkgver):
            ok.append(pkgname)
            continue
        elif pkgver.endswith("*") and cver[0].startswith(pkgver[:-1]):
            ok.append(pkgname)
            continue
        if _fulfills_version_string(cver, pkgver, ignore_epoch=ignore_epoch):
            ok.append(pkgname)
        else:
            failed.append(pkgname)
    return ok, failed
316661
protected function taskArtifactCreatePackages()
    {
        $rootDir      = getcwd();
        $tarBin       = $this->config(Config::KEY_ENV . '/' . Config::KEY_TAR_BIN);
        $gitDir       = $this->config(Config::KEY_DEPLOY . '/' . Config::KEY_GIT_DIR);
        $artifactsDir = $this->config(Config::KEY_DEPLOY . '/' . Config::KEY_ARTIFACTS_DIR);

        /** @var array $artifacts */
        $artifacts = $this->config(Config::KEY_DEPLOY . '/' . Config::KEY_ARTIFACTS);

        /** @var RoboFile|CollectionBuilder $collection */
        $collection = $this->collectionBuilder();
        $collection->progressMessage('cleanup old packages');

        // Ensure artifacts-dir is present
        $collection->taskFilesystemStack()->mkdir($artifactsDir);

        // Cleanup old tars
        foreach ($artifacts as $artifactName => $artifactConfig) {
            $file = "$artifactsDir/$artifactName";

            $task = $collection->taskFilesystemStack();
            $task->remove($file);
        }

        // Create Tars
        $collection->progressMessage('creating packages');
        foreach ($artifacts as $artifactName => $artifactConfig) {
            $dir = $artifactConfig['dir'];

            $artifactPath = "$rootDir/$artifactsDir/$artifactName";

            $tarOptions = '';
            if (array_key_exists('options', $artifactConfig)) {
                $options    = $artifactConfig['options'];
                $tarOptions = implode(' ', $options);
            }

            $tarCmd = "$tarBin $tarOptions -czf $artifactPath $dir";
            $task   = $collection->taskExec($tarCmd);
            $task->dir($gitDir);
        }

        return $collection;
    }
462825
def create_build_rules
      platform_flags_fixup(search_libs(@settings))

      incs = inc_dirs
      # map object to source file and make it dependent on creation of all object directories
      rule /#{build_dir}\/.*\.o/ => [ proc {|tn| obj_to_source(tn, src_dir, build_dir)}] + obj_dirs do |t|
        if t.name =~ /\/tests\//
          # test framework additions
          incs << @test_inc_dirs unless incs.include?(@test_inc_dirs)
          @settings['ADD_CXXFLAGS'] += @test_fw.cflags
          @settings['ADD_CFLAGS'] += @test_fw.cflags
        end

        tc.obj(:source => t.source,
               :object => t.name,
               :settings => @settings,
               :includes => incs.uniq)
      end

      # map dependency to source file and make it dependent on creation of all object directories
      rule /#{build_dir}\/.*\.d/ => [ proc {|tn| dep_to_source(tn, src_dir, build_dir)}] + obj_dirs do |t|
        # don't generate dependencies for assembler files XXX DS: use tc.file_extensions[:as_sources]
        if (t.source.end_with?('.S') || t.source.end_with?('.s'))
          tc.touch(t.name)
          next
        end

        if t.name =~ /\/tests\//
          # test framework additions
          incs << @test_inc_dirs unless incs.include?(@test_inc_dirs)
          @settings['ADD_CXXFLAGS'] += @test_fw.cflags
          @settings['ADD_CFLAGS'] += @test_fw.cflags
        end

        tc.dep(:source => t.source,
               :dep => t.name,
               :settings => @settings,
               :includes => incs.uniq)
      end

      # make moc source file dependent on corresponding header file, XXX DS: only if project uses QT
      rule /#{src_dir}\/.*moc_.*#{Regexp.escape(tc.moc_source)}$/ => [ proc {|tn| tn.gsub(/moc_/, '').ext(tc.moc_header_extension) } ] do |t|
        tc.moc(:source => t.source,
               :moc => t.name,
               :settings => @settings)
      end
    end
78803
def _build_tarball(src_repo) -> str:
    
    run = partial(subprocess.run, cwd=src_repo, check=True)
    run(['git', 'clean', '-xdff'])
    src_repo = Path(src_repo)
    if os.path.exists(src_repo / 'es' / 'upstream'):
        run(['git', 'submodule', 'update', '--init', '--', 'es/upstream'])
    run(['./gradlew', '--no-daemon', 'clean', 'distTar'])
    distributions = Path(src_repo) / 'app' / 'build' / 'distributions'
    return next(distributions.glob('crate-*.tar.gz'))
592986
def distcheck(appname='',version='',subdir=''):
	''''''
	import tempfile,tarfile
	if not appname:appname=Utils.g_module.APPNAME
	if not version:version=Utils.g_module.VERSION
	waf=os.path.abspath(sys.argv[0])
	tarball=dist(appname,version)
	path=appname+'-'+version
	if os.path.exists(path):
		shutil.rmtree(path)
	t=tarfile.open(tarball)
	for x in t:t.extract(x)
	t.close()
	if subdir:
		build_path=os.path.join(path,subdir)
	else:
		build_path=path
	instdir=tempfile.mkdtemp('.inst','%s-%s'%(appname,version))
	ret=Utils.pproc.Popen([waf,'configure','build','install','uninstall','--destdir='+instdir],cwd=build_path).wait()
	if ret:
		raise Utils.WafError('distcheck failed with code %i'%ret)
	if os.path.exists(instdir):
		raise Utils.WafError('distcheck succeeded, but files were left in %s'%instdir)
	shutil.rmtree(path)
400686
def upload(ctx, release, rebuild):
    
    dist_path = Path(DIST_PATH)
    if rebuild is False:
        if not dist_path.exists() or not list(dist_path.glob('*')):
            print("No distribution files found. Please run 'build' command first")
            return
    else:
        ctx.invoke(build, force=True)

    if release:
        args = ['twine', 'upload', 'dist/*']
    else:
        repository = 'https://test.pypi.org/legacy/'
        args = ['twine', 'upload', '--repository-url', repository, 'dist/*']

    env = os.environ.copy()

    p = subprocess.Popen(args, env=env)
    p.wait()
490188
def cli(ctx, project_dir):
    """"""
    exit_code = SCons(project_dir).verify()
    ctx.exit(exit_code)
1263167
def finalize_options(self):
        
        self.cwd = os.path.abspath(os.path.dirname(__file__))
        self.build_dirs = [
            os.path.join(self.cwd, 'build'),
            os.path.join(self.cwd, 'htmlcov'),
            os.path.join(self.cwd, 'dist'),
            os.path.join(self.cwd, 'pylink_square.egg-info')
        ]
        self.build_artifacts = ['.pyc', '.o', '.elf', '.bin']
880180
function checkThatExecutableExists(next) {
        fs.exists(nodeCompiler.releasePath, function(exists) {
          if (!exists) {
            _log(
              'error',
              'The release executable has not been generated. ' +
                'This indicates a failure in the build process. ' +
                'There is likely additional information above.',
            );
            process.exit(1);
          } else {
            next();
          }
        });
      }
1122100
public void taintPackagesThatMissArtifacts() {
        for (Package pkg : prev.packages().values()) {
            for (File f : pkg.artifacts().values()) {
                if (!f.exists()) {
                    // Hmm, the artifact on disk does not exist! Someone has removed it....
                    // Lets rebuild the package.
                    taintPackage(pkg.name(), ""+f+" is missing.");
                }
            }
        }
    }
743401
def export_dist(self, args):
        
        ctx = self.ctx
        dist = dist_from_args(ctx, args)
        if dist.needs_build:
            raise BuildInterruptingException(
                'You asked to export a dist, but there is no dist '
                'with suitable recipes available. For now, you must '
                ' create one first with the create argument.')
        if args.symlink:
            shprint(sh.ln, '-s', dist.dist_dir, args.output_dir)
        else:
            shprint(sh.cp, '-r', dist.dist_dir, args.output_dir)
1121032
def build_mmd(target_folder=DEFAULT_LIBRARY_DIR):
    """"""
    mmd_dir = tempfile.mkdtemp()
    mmd_repo = pygit2.clone_repository('https://github.com/jasedit/MultiMarkdown-5', mmd_dir,
                                       checkout_branch='fix_windows')
    mmd_repo.init_submodules()
    mmd_repo.update_submodules()
    build_dir = os.path.join(mmd_dir, 'build')
    old_pwd = os.getcwd()
    os.chdir(build_dir)

    cmake_cmd = ['cmake', '-DCMAKE_BUILD_TYPE=Release', '-DSHAREDBUILD=1', '..']
    if platform.system() == 'Windows':
        is_64bit = platform.architecture()[0] == '64bit'
        generator = 'Visual Studio 14 2015{0}'.format(' Win64' if is_64bit else '')
        cmake_cmd.insert(-1, '-G')
        cmake_cmd.insert(-1, '{0}'.format(generator))
    subprocess.call(cmake_cmd)
    PLATFORM_BUILDS[platform.system()]()

    lib_file = 'libMultiMarkdown' + SHLIB_EXT[platform.system()]
    if not os.path.exists(target_folder):
        os.mkdir(target_folder)
    src = os.path.join(build_dir, SHLIB_PREFIX[platform.system()], lib_file)
    dest = os.path.join(target_folder, lib_file)
    shutil.copyfile(src, dest)
    os.chdir(old_pwd)
    shutil.rmtree(mmd_dir, ignore_errors=True)
1136392
def build_packages(ctx, hide=False):
    """"""
    print("build_packages:")
    ctx.run("python setup.py sdist bdist_wheel", echo=True, hide=hide)
733485
def license(dir = Dir.pwd,
                license = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],
                authors = '',
                options = {
                  :filename     => 'LICENSE'
                })
      return if ((license.empty?) or (license == 'none') or (license =~ /^CC/))
      return unless FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys.include?( license )
      info "Generate the #{license} licence file"
      path = normalized_path(dir)
      use_git = FalkorLib::Git.init?(path)
      rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
      Dir.chdir( rootdir ) do
        run %( licgen #{license.downcase} #{authors} )
        run %( mv LICENSE #{options[:filename]} ) if( options[:filename] and options[:filename] != 'LICENSE')
      end
    end