Appends the target name to the bundles path

Each target build should be written in its own subfolder, e.g:

dist/bundles/node
dist/bundles/web
dist/bundles/worker

This should only happen when target is explicitly set.
977250
function adjustBundlesPath(data, options) {
	var path = require("path");
	var configuration = clone(data.configuration);

	var bundlesPath = configuration.bundlesPath;
	Object.defineProperty(configuration, "bundlesPath", {
		configurable: true,
		get: function() {
			return path.join(bundlesPath, options.target);
		}
	});

	return assign({}, omit(data, ["configuration"]), {
		configuration: configuration
	});
}
1093241
def setup_build_path(build_path):
    
    if os.path.isdir(build_path):
        fname = os.path.join(build_path, 'CMakeCache.txt')
        if os.path.exists(fname):
            sys.stderr.write('aborting setup\n')
            sys.stderr.write(
                'build directory {0} which contains CMakeCache.txt already exists\n'.
                format(build_path))
            sys.stderr.write(
                'remove the build directory and then rerun setup\n')
            sys.exit(1)
    else:
        os.makedirs(build_path, 0o755)
12441
def add_executable name, path
      path = expand_local_path path
      executables << OpenStruct.new( :name => name, :path => path, :file_target => self )
    end
1217352
def _create_target_tree(self, target):
        
        source = self
        with source.walker as walker:

            @walker.folder_visitor
            def visit_folder(folder):
                """
                Create the mirror directory
                """
                if folder != source:
                    Folder(folder.get_mirror(target, source)).make()
1301412
def set_target(self, target):
        '''
        '''
        self.targetname = target
        m = __import__('buildozer.targets.{0}'.format(target),
                       fromlist=['buildozer'])
        self.target = m.get_target(self)
        self.check_build_layout()
        self.check_configuration_tokens()
383253
function ( taskName ) {
			var task = grunt.config.get( "bundles" )[taskName];

			var retVal = {};
			if ( task && task.aliases ) {
				var aliases = task.aliases;
				if ( !sys.isEmpty( aliases ) ) {
					grunt.verbose.writeln( "Adding aliases for " + taskName );
					if ( sys.isArray( aliases ) ) {
						sys.each( aliases, function ( map ) {
							map = map || {};

							if ( !sys.isString( map.dest ) ) {map.dest = map.cwd;}
							if ( !sys.isString( map.dest ) ) {return grunt.util.error( "dest or cwd is required" );}

							map.cwd = map.cwd || "";
							map.expand = map.expand !== false;
							var files = grunt.file.expand( map, map.src );
							sys.each( files, function ( item ) {
								var thisPath;
								if ( sys.isEmpty( map.dest ) ) {
									thisPath = item;
								} else {
									thisPath = path.join( map.dest, item );
								}

								var thisAlias = thisPath.replace( /\.[^/.]+$/, "" ).replace( /\\/g, "/" );

								retVal[thisAlias] = resolvePath( path.join( map.cwd, item ) );

							} );
						} );
					} else {
						sys.each( aliases, function ( item, key ) {
							retVal[key] = resolvePath( item );
						} );

					}
				}
			}
			return retVal;
		}
708576
public static Path appendPath(Path prefix, String subpath) {
        return asPath(appendPath(prefix.getPath(), subpath));
    }
111742
def compile_bundle_entry(self, spec, entry):
        

        modname, source, target, modpath = entry
        bundled_modpath = {modname: modpath}
        bundled_target = {modname: target}
        export_module_name = []
        if isfile(source):
            export_module_name.append(modname)
            copy_target = join(spec[BUILD_DIR], target)
            if not exists(dirname(copy_target)):
                makedirs(dirname(copy_target))
            shutil.copy(source, copy_target)
        elif isdir(source):
            copy_target = join(spec[BUILD_DIR], modname)
            shutil.copytree(source, copy_target)

        return bundled_modpath, bundled_target, export_module_name
108803
private void createFolder(final StructrShellCommand parent, final Folder currentFolder, final String target) throws FrameworkException, IOException {

		final App app = StructrApp.getInstance();
		if (target.contains("/")) {

			final int lastSlashIndex      = target.lastIndexOf("/");
			final String targetFolderPath = target.substring(0, lastSlashIndex);
			final String targetFolderName = target.substring(lastSlashIndex + 1);
			final Folder parentFolder     = parent.findRelativeFolder(currentFolder, targetFolderPath);

			if (parentFolder != null) {

				checkAndCreateFolder(app, parent, parentFolder, targetFolderName);

			} else {

				term.println("Folder " + targetFolderPath + " does not exist");
			}

		} else {

			checkAndCreateFolder(app, parent, currentFolder, target);
		}
	}
172241
protected void addSourceFolder(String path) {
		final List<String> existingFolders1 = this.project.getCompileSourceRoots();
		final List<String> existingFolders2 = this.project.getTestCompileSourceRoots();
		if (!existingFolders1.contains(path) && !existingFolders2.contains(path)) {
			getLog().info(MessageFormat.format(Messages.InitializeMojo_0, path));
			this.session.getCurrentProject().addCompileSourceRoot(path);
		} else {
			getLog().info(MessageFormat.format(Messages.InitializeMojo_1, path));
		}
	}
978079
def setup_path(invoke_minversion=None):
    """"""
    # print("INVOKE.tasks: setup_path")
    if not os.path.isdir(TASKS_VENDOR_DIR):
        print("SKIP: TASKS_VENDOR_DIR=%s is missing" % TASKS_VENDOR_DIR)
        return
    elif os.path.abspath(TASKS_VENDOR_DIR) in sys.path:
        # -- SETUP ALREADY DONE:
        # return
        pass

    use_vendor_bundles = os.environ.get("INVOKE_TASKS_USE_VENDOR_BUNDLES", "no")
    if need_vendor_bundles(invoke_minversion):
        use_vendor_bundles = "yes"

    if use_vendor_bundles == "yes":
        syspath_insert(0, os.path.abspath(TASKS_VENDOR_DIR))
        if setup_path_for_bundle(INVOKE_BUNDLE, pos=1):
            import invoke
            bundle_path = os.path.relpath(INVOKE_BUNDLE, os.getcwd())
            print("USING: %s (version: %s)" % (bundle_path, invoke.__version__))
    else:
        # -- BEST-EFFORT: May rescue something
        syspath_append(os.path.abspath(TASKS_VENDOR_DIR))
        setup_path_for_bundle(INVOKE_BUNDLE, pos=len(sys.path))

    if DEBUG_SYSPATH:
        for index, p in enumerate(sys.path):
            print("  %d.  %s" % (index, p))
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()
1210860
def create_from_targets(self,list_targs):
        
        for this_target in list_targs:
            self.node.append(this_target.get_node())
1342779
def cd(self, *subpaths):
        
        target = os.path.join(*subpaths)
        os.chdir(target)
268312
def append_path(sprocket, path) # :nodoc:
      path = Pathname.new(path).expand_path(root)
      sprocket.append_path(path) if path.exist?
    end
1262541
def write_setup(self, root_target, reduced_dependencies, chroot):
    
    setup_keywords = root_target.provides.setup_py_keywords.copy()

    package_dir = {'': self.SOURCE_ROOT}
    packages, namespace_packages, resources = self.find_packages(root_target, chroot)

    if namespace_packages:
      setup_keywords['namespace_packages'] = list(sorted(namespace_packages))

    if packages:
      setup_keywords.update(
          package_dir=package_dir,
          packages=list(sorted(packages)),
          package_data=dict((str(package), list(map(str, rs)))
                            for (package, rs) in resources.items()))

    setup_keywords['install_requires'] = list(self.install_requires(reduced_dependencies))

    for binary_name, entry_point in self.iter_entry_points(root_target):
      if 'entry_points' not in setup_keywords:
        setup_keywords['entry_points'] = {}
      if 'console_scripts' not in setup_keywords['entry_points']:
        setup_keywords['entry_points']['console_scripts'] = []
      setup_keywords['entry_points']['console_scripts'].append(
          '{} = {}'.format(binary_name, entry_point))

    setup_py = self._setup_boilerplate().format(setup_dict=distutils_repr(setup_keywords),
                                                setup_target=root_target.address.reference())
    chroot.write(ensure_binary(setup_py), 'setup.py')

    # Make sure that `setup.py` is included.
    chroot.write('include *.py', 'MANIFEST.in', mode='w')
328541
def mkdir(self, target_folder):
        
        self.printv("Making directory: %s" % target_folder)
        self.k.key = re.sub(r"^/|/$", "", target_folder) + "/"
        self.k.set_contents_from_string('')
        self.k.close()