Bundle everything using `flatpak-bundler`.
761243
function (options, dir, callback) {
  var name = _.template('<%= id %>_<%= branch %>_<%= arch %>.flatpak')(options)
  var dest = options.rename(options.dest, name)
  options.logger('Creating package at ' + dest)
  var extraExports = []
  if (options.icon && !_.isObject(options.icon)) extraExports.push(getPixmapPath(options))

  var files = [
    [dir, '/']
  ]
  var symlinks = [
    [path.join('/lib', options.id, options.bin), path.join('/bin', options.bin)]
  ]

  flatpak.bundle({
    id: options.id,
    branch: options.branch,
    base: options.base,
    baseVersion: options.baseVersion,
    baseFlatpakref: options.baseFlatpakref,
    runtime: options.runtime,
    runtimeVersion: options.runtimeVersion,
    runtimeFlatpakref: options.runtimeFlatpakref,
    sdk: options.sdk,
    sdkFlatpakref: options.sdkFlatpakref,
    finishArgs: options.finishArgs,
    command: options.bin,
    files: files.concat(options.files),
    symlinks: symlinks.concat(options.symlinks),
    extraExports: extraExports,
    modules: options.modules
  }, {
    arch: options.arch,
    bundlePath: dest
  }, function (err) {
    callback(err, dir)
  })
}
830914
function updateAllPackages(rootPkgPath, packagesPath) {
  const paths = findPackages(packagesPath);

  return paths.reduce((promise, pkgPath) => promise.then(() => updateSinglePackage(rootPkgPath, pkgPath)), Promise.resolve());
}
717135
def clean(bundle, before, after, keep_last):
    
    bundles_module.clean(
        bundle,
        before,
        after,
        keep_last,
    )
470596
def init_flatpak():
    
    tessdata_files = glob.glob("/app/share/locale/*/*.traineddata")
    if len(tessdata_files) <= 0:
        return os.path.exists("/app")

    localdir = os.path.expanduser("~/.local")
    base_data_dir = os.getenv(
        "XDG_DATA_HOME",
        os.path.join(localdir, "share")
    )
    tessdatadir = os.path.join(base_data_dir, "paperwork", "tessdata")

    logger.info("Assuming we are running in Flatpak."
                " Building tessdata directory {} ...".format(tessdatadir))
    util.rm_rf(tessdatadir)
    util.mkdir_p(tessdatadir)

    os.symlink("/app/share/tessdata/eng.traineddata",
               os.path.join(tessdatadir, "eng.traineddata"))
    os.symlink("/app/share/tessdata/osd.traineddata",
               os.path.join(tessdatadir, "osd.traineddata"))
    os.symlink("/app/share/tessdata/configs",
               os.path.join(tessdatadir, "configs"))
    os.symlink("/app/share/tessdata/tessconfigs",
               os.path.join(tessdatadir, "tessconfigs"))
    for tessdata in tessdata_files:
        logger.info("{} found".format(tessdata))
        os.symlink(tessdata, os.path.join(tessdatadir,
                                          os.path.basename(tessdata)))
    os.environ['TESSDATA_PREFIX'] = os.path.dirname(tessdatadir)
    logger.info("Tessdata directory ready")
    return True
76573
function setupPipeline() {
      var deps = bundler.pipeline.get('deps');
      deps.push(getCache(deps._streams[0].cache));
    }
623789
function compileBundle (bundle, dest) {
  return bundle.bundle()
    .on('error', gutil.log.bind(gutil, 'Browserify Error'))
    .pipe(source(dest))
    .pipe(buffer()) // buffer file contents (is this necessary?)
    .pipe(gulp.dest(dir.prod + 'scripts/'))
}
807413
function bundleApp(codeList, ns, domload, compile, before, npmTree, o) {
  var l = []
    , usedBuiltIns = npmTree._builtIns
    , len = 0;
  delete npmTree._builtIns;

  // 1. construct the global namespace object
  l.push("window." + ns + " = {data:{}, path:{}};");

  // 2. attach path code to the namespace object so that require.js can efficiently resolve paths
  l.push('\n// include npm::path');
  var pathCode = read(join(builtInDir, 'path.posix.js'));
  l.push('(function (exports) {\n ' + pathCode + '\n}(window.' + ns + '.path));');

  // 3. pull in serialized data
  Object.keys(o.data).forEach(function (name) {
    return l.push(ns + ".data." + name + " = " + o.data[name] + ";");
  });

  // 4. attach require code
  var config = {
    namespace : ns
  , domains   : Object.keys(o.domains) // TODO: remove npm from here
  , arbiters  : o.arbiters
  , logging   : o.logLevel
  , npmTree   : npmTree
  , builtIns  : builtIns
  , slash     : '/' //TODO: figure out if different types can coexist, if so, determine in resolver, and on client
  };

  l.push(anonWrap(read(join(dir, 'require.js'))
    .replace(/VERSION/, JSON.parse(read(join(dir, '..', 'package.json'))).version)
    .replace(/REQUIRECONFIG/, JSON.stringify(config))
  ));

  // 5. include CommonJS compatible code in the order they have to be defined
  var defineWrap = function (exportName, domain, code) {
    return ns + ".define('" + exportName + "','" + domain + "',function (require, module, exports) {\n" + code + "\n});";
  };

  // 6. harvest function splits code into app and non-app code and defineWraps
  var harvest = function (onlyMain) {
    codeList.forEach(function (pair) {
      var dom = pair[0]
        , file = pair[1]
        , basename = file.split('.')[0];
      if ((dom === 'app') !== onlyMain) {
        return;
      }
      var code = before(compile(join(o.domains[dom], file)));
      l.push(defineWrap(basename, dom, code));
    });
  };

  // 7.a) include required builtIns
  l.push("\n// node builtins\n");
  len = l.length;
  usedBuiltIns.forEach(function (b) {
    if (b === 'path') { // already included
      return;
    }
    l.push(defineWrap(b, 'npm', read(join(builtInDir, b + '.js'))));
  });
  if (l.length === len) {
    l.pop();
  }

  // 7.b) include modules not on the app domain
  l.push("\n// shared code\n");
  len = l.length;
  harvest(false);
  if (l.length === len) {
    l.pop();
  }

  // 7.c) include modules on the app domain, and wait for domloader if set
  l.push("\n// app code - safety wrapped\n\n");
  domload(harvest(true));

  // 8. use a closure to encapsulate the private internal data and APIs
  return anonWrap(l.join('\n'));
}
157108
def bundle_apps(self, bundle_name, bundle_apps):
        
        bundle_file = os.path.join(
            self.app_path, self.args.outdir, '{}-bundle.zip'.format(bundle_name)
        )
        z = zipfile.ZipFile(bundle_file, 'w')
        for app in bundle_apps:
            # update package data
            self.package_data['bundle'].append(
                {'action': 'Adding App:', 'output': os.path.basename(app)}
            )
            z.write(app, os.path.basename(app))

        # update package data
        self.package_data['bundle'].append(
            {'action': 'Created Bundle:', 'output': os.path.basename(bundle_file)}
        )
        z.close()
1289199
function rebundle() {
    var debug, min;

    debug = sourcemaps.init({loadMaps: true});
    debug.pipe(sourcemaps.write('./', {sourceRoot: './'}))
        .pipe(gulp.dest(paths.out));

    min = rename({ suffix: '.min' });
    min.pipe(sourcemaps.init({loadMaps: true}))
        .pipe(uglify())
        .pipe(sourcemaps.write('./', {sourceRoot: './', addComment: false}))
        .pipe(gulp.dest(paths.out));

    return this.bundle()
        .on('error', handleErrors.handler)
        .pipe(handleErrors())
        .pipe(source('pixi.js'))
        .pipe(buffer())
        .pipe(mirror(
            debug,
            min
        ));
}
1323633
function Bundle(packages, name)
    {
        this.packages = _.map(packages, function (package) {

            if (_.isString(package)) {
                return new Package(package);
            }

            return package;
        });
        this.name = name || 'bundle';
    }
753162
def package(self):
        
        cmake = self.configure_cmake()
        cmake.install()
        self.copy(pattern="LICENSE.txt", dst="licenses")
        self.copy(pattern="FindFlatBuffers.cmake", dst=os.path.join("lib", "cmake", "flatbuffers"), src="CMake")
        self.copy(pattern="flathash*", dst="bin", src="bin")
        self.copy(pattern="flatc*", dst="bin", src="bin")
        if self.settings.os == "Windows" and self.options.shared:
            if self.settings.compiler == "Visual Studio":
                shutil.move(os.path.join(self.package_folder, "lib", "%s.dll" % self.name),
                            os.path.join(self.package_folder, "bin", "%s.dll" % self.name))
            elif self.settings.compiler == "gcc":
                shutil.move(os.path.join(self.package_folder, "lib", "lib%s.dll" % self.name),
                            os.path.join(self.package_folder, "bin", "lib%s.dll" % self.name))
177276
function exposeBundles(b){
    b.add("./" + packageConfig.main, {expose: packageConfig.name });
    if(packageConfig.sniper !== undefined && packageConfig.sniper.exposed !== undefined){
        for(var i=0; i<packageConfig.sniper.exposed.length; i++){
            b.require(packageConfig.sniper.exposed[i]);
        }
    }
}
262642
function bundleJsFiles () {
  return concat(jsFiles)
    .then((output) => {
      const uglified = UglifyJS.minify(output)
      if (uglified.error) {
        throw new Error(uglified.error)
      }
      return uglified.code
    })
}
510452
def buildpack(self, url):
        """"""
        cmd = ["heroku", "buildpacks:add", url, "--app", self.name]
        self._run(cmd)
334391
function bundler(entry, options, callback) {
  make_sure(options, 'pkg')
  make_sure(options, 'cwd')

  if (Object(options.babel) !== options.babel && options.babel !== false) {
    options.babel = {}
  }

  options.babel = mix({
    presets: ['es2015']
  }, options.babel, false)

  return new Builder(options).parse(entry, callback)
}
592284
def bundle(self, bundle_name):
        
        if self.args.bundle or self.tcex_json.get('package', {}).get('bundle', False):
            if self.tcex_json.get('package', {}).get('bundle_packages') is not None:
                for bundle in self.tcex_json.get('package', {}).get('bundle_packages') or []:
                    bundle_name = bundle.get('name')
                    bundle_patterns = bundle.get('patterns')

                    bundle_apps = []
                    for app in self._app_packages:
                        for app_pattern in bundle_patterns:
                            p = re.compile(app_pattern, re.IGNORECASE)
                            if p.match(app):
                                bundle_apps.append(app)

                    # bundle app in zip
                    if bundle_apps:
                        self.bundle_apps(bundle_name, bundle_apps)
            else:
                self.bundle_apps(bundle_name, self._app_packages)
28366
def distribute(build):
    
    build.packages.install("wheel")
    build.packages.install("twine")
    build.executables.run([
        "python", "setup.py",
        "sdist", "bdist_wheel", "--universal", "upload",
    ])
    build.executables.run([
        "twine", "upload", "dist/*"
    ])