Deployed artifacts manipulation //////////////////////////////////////////
513741
public void addDeployedArtifact(ResourceDefinitionEntity deployedArtifact) {
    if (deployedArtifacts == null) {
      deployedArtifacts = new HashMap<Class<?>, List>();
    }

    Class<?> clazz = deployedArtifact.getClass();
    List artifacts = deployedArtifacts.get(clazz);
    if (artifacts == null) {
      artifacts = new ArrayList();
      deployedArtifacts.put(clazz, artifacts);
    }

    artifacts.add(deployedArtifact);
  }
60553
function bootstrapAdapters( services, adapterModules, artifacts ) {

   const adapterServices = {
      adapterUtilities: services.adapterUtilities,
      artifactProvider: services.artifactProvider,
      configuration: services.configuration,
      flowService: services.flowService,
      globalEventBus: services.globalEventBus,
      debugEventBus: services.debugEventBus,
      heartbeat: services.heartbeat,
      log: services.log,
      storage: services.storage,
      tooling: services.tooling,
      // TODO (https://github.com/LaxarJS/laxar/issues/363 and https://github.com/LaxarJS/laxar/issues/397)
      // Fixing the latter issue broke laxar-mocks, since it could no longer access the widget loader.
      // To temporarily fix this, we re-add the widget loader to the exposed services.
      // Nevertheless on the medium /short term we want to be able to load single widgets into the page
      // (the first issue above) and use the api that will be created for this in laxar-mocks.
      widgetLoader: services.widgetLoader
   };

   const { log } = services;
   const adapterModulesByTechnology = {};
   const artifactsByTechnology = {};

   adapterModules.forEach( module => {
      adapterModulesByTechnology[ module.technology ] = module;
      artifactsByTechnology[ module.technology ] = { widgets: [], controls: [] };
   } );

   [ 'widgets', 'controls' ].forEach( type => {
      artifacts[ type ].forEach( artifact => {
         const { technology } = artifact.descriptor.integration;
         if( !adapterModulesByTechnology[ technology ] ) {
            const { name } = artifact.descriptor;
            log.fatal( 'Unknown integration technology: [0], required by "[1]"', technology, name );
            return;
         }
         artifactsByTechnology[ technology ][ type ].push( artifact );
      } );
   } );

   const adaptersByTechnology = {};
   Object.keys( adapterModulesByTechnology ).forEach( technology => {
      const adapterModule = adapterModulesByTechnology[ technology ];
      const artifacts = artifactsByTechnology[ technology ];
      adaptersByTechnology[ technology ] = adapterModule.bootstrap( artifacts, adapterServices );
   } );
   return adaptersByTechnology;
}
346861
def add_artifact(self, artifact):
        '''
        '''
        artifact.env_time = self.age
        self.artifacts.append(artifact)
        self._log(logging.DEBUG, "ARTIFACTS appended: '{}', length={}"
                  .format(artifact, len(self.artifacts)))
658305
@SuppressWarnings( "rawtypes" )
	private Artifact<?> emitLandingPageCacheManifest( LinkerContext context, TreeLogger logger, ArtifactSet artifacts ) throws UnableToCompleteException
	{
		StringBuilder publicSourcesSb = new StringBuilder();
		StringBuilder staticResoucesSb = new StringBuilder();

		if( artifacts != null )
		{
			// Iterate over all emitted artifacts, and collect all cacheable
			// artifacts
			for( Artifact artifact : artifacts )
			{
				if( artifact instanceof EmittedArtifact )
				{
					EmittedArtifact ea = (EmittedArtifact) artifact;
					String pathName = ea.getPartialPath();
					if( pathName.endsWith( "symbolMap" ) || pathName.endsWith( ".xml.gz" ) || pathName.endsWith( "rpc.log" ) || pathName.endsWith( "gwt.rpc" ) || pathName.endsWith( "manifest.txt" ) || pathName.startsWith( "rpcPolicyManifest" )
							|| pathName.startsWith( "soycReport" ) || pathName.endsWith( ".cssmap" ) )
					{
						continue;// skip these resources
					}
					else
					{
						publicSourcesSb.append( context.getModuleName() ).append( "/" ).append( pathName.replace( "\\", "/" ) ).append( "\n" );
					}
				}
			}

			String[] cacheExtraFiles = getCacheExtraFiles( logger, context );
			for( int i = 0; i < cacheExtraFiles.length; i++ )
			{
				staticResoucesSb.append( cacheExtraFiles[i] );
				staticResoucesSb.append( "\n" );
			}
		}

		// build cache list
		StringBuilder sb = new StringBuilder();
		sb.append( "CACHE MANIFEST\n" );
		sb.append( "# " + UUID.randomUUID() + "-" + System.currentTimeMillis() + "\n" );
		// we have to generate this unique id because the resources can change
		// but
		// the hashed cache.html files can remain the same.
		sb.append( "# Note: must change this every time for cache to invalidate\n" );
		sb.append( "\n" );
		sb.append( "CACHE:\n" );
		sb.append( "# Static app files\n" );
		sb.append( staticResoucesSb );
		sb.append( "\n# Generated app files\n" );
		sb.append( publicSourcesSb );
		sb.append( "\n\n" );
		sb.append( "# All other resources require the user to be online.\n" );
		sb.append( "NETWORK:\n" );
		sb.append( "*\n" );
		sb.append( "http://*\n" );
		sb.append( "\n\n" );
		sb.append( "# Available values: fast, prefer-online\n" );
		sb.append( "SETTINGS:\n" );
		sb.append( "fast\n" );
		logger.log( TreeLogger.DEBUG, "Be sure your landing page's <html> tag declares a manifest: <html manifest=" + MANIFEST + "\">" );

		// Create the manifest as a new artifact and return it:
		return emitString( logger, sb.toString(), "../" + MANIFEST );
	}
759232
def artifact(name, version)
      unless artifact?(name, version)
        artifact = Artifact.new(self, name, version)
        @artifacts["#{name}-#{version}"] = artifact
        @artifacts_by_name[name] << artifact
      end

      @artifacts["#{name}-#{version}"]
    end
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.");
                }
            }
        }
    }
470608
@Override
    public void artifactInstalling(RepositoryEvent event) {
        log.finer("Installing " + event.getArtifact() + " to " + event.getFile());
    }
877215
public void setArtifacts(java.util.Collection<Artifact> artifacts) {
        if (artifacts == null) {
            this.artifacts = null;
            return;
        }

        this.artifacts = new java.util.ArrayList<Artifact>(artifacts);
    }
1062440
def _get_artifact_context(run, file_type):
    """"""
    sha1sum = None
    image_file = False
    log_file = False
    config_file = False

    if request.path == '/image':
        image_file = True
        if file_type == 'before':
            sha1sum = run.ref_image
        elif file_type == 'diff':
            sha1sum = run.diff_image
        elif file_type == 'after':
            sha1sum = run.image
        else:
            abort(400)
    elif request.path == '/log':
        log_file = True
        if file_type == 'before':
            sha1sum = run.ref_log
        elif file_type == 'diff':
            sha1sum = run.diff_log
        elif file_type == 'after':
            sha1sum = run.log
        else:
            abort(400)
    elif request.path == '/config':
        config_file = True
        if file_type == 'before':
            sha1sum = run.ref_config
        elif file_type == 'after':
            sha1sum = run.config
        else:
            abort(400)

    return image_file, log_file, config_file, sha1sum
1138028
def _save_artifact(build, data, content_type):
    """"""
    sha1sum = hashlib.sha1(data).hexdigest()
    artifact = models.Artifact.query.filter_by(id=sha1sum).first()

    if artifact:
      logging.debug('Upload already exists: artifact_id=%r', sha1sum)
    else:
      logging.info('Upload received: artifact_id=%r, content_type=%r',
                   sha1sum, content_type)
      artifact = models.Artifact(
          id=sha1sum,
          content_type=content_type,
          data=data)
      _artifact_created(artifact)

    artifact.owners.append(build)
    return artifact
49466
public void deployArtifact(DeployArtifact deployArtifact) throws DeployException {
        log.debug("deploy artifact: {} ", deployArtifact.getNotation());
        
        RepositoryClient repoClient = new RepositoryClient(this.getLocalRepoPath());
        
        DeployRequest deployRequest = new DeployRequest();
        deployRequest.addArtifact(deployArtifact.getJarArtifact());
        if (deployArtifact.getPomArtifact() != null) {
            deployRequest.addArtifact(deployArtifact.getPomArtifact());
        }
        deployRequest.setRepository(deployArtifact.getRemoteRepo());

        log.debug("deploying artifact {}", deployArtifact.getNotation());
        try {
            repoClient.deploy(deployRequest);
        } catch (DeploymentException e) {
            log.error("Failed to deploy artifact", e);
            throw new DeployException(e);
        }
    }
1347425
public final void addArtifact(@NotNull final Artifact artifact) {
        Contract.requireArgNotNull("artifact", artifact);
        if (artifacts == null) {
            artifacts = new ArrayList<>();
        }
        artifacts.add(artifact);
    }
1368822
function(children) {
				var attempt = 0;
				var uniqueName = prefix;
				
				// find a unique name for the new artifact
				var possiblyCollidingNames = children.filter(function(child){
					return 0 === child.Name.indexOf(prefix);
				}).map(function(child){
					return child.Name;
				});
				
				while (-1 !== possiblyCollidingNames.indexOf(uniqueName)){
					attempt++;
					uniqueName = prefix.concat(" (").concat(attempt).concat(")");  //$NON-NLS-1$ //$NON-NLS-0$
				}
				
				return uniqueName;
			}
710930
public void setPromoted(final boolean promoted) {
        this.promoted = promoted;

        for (final Artifact artifact : artifacts) {
            artifact.setPromoted(promoted);
        }

        for (final Module suModule : submodules) {
            suModule.setPromoted(promoted);
        }
    }
715919
private void performUnArchive() throws MojoExecutionException
    {
        Artifact artifact = findArtifact();

        getLog().debug(String.format("Source XAR = [%s]", artifact.getFile()));
        unpack(artifact.getFile(), this.outputDirectory, "XAR Plugin", true, getIncludes(), getExcludes());
        unpackDependentXars(artifact);
    }
1172935
function cleanup() {
  const artifacts = ['.requirements'];
  if (this.options.zip) {
    if (this.serverless.service.package.individually) {
      this.targetFuncs.forEach(f => {
        artifacts.push(path.join(f.module, '.requirements.zip'));
        artifacts.push(path.join(f.module, 'unzip_requirements.py'));
      });
    } else {
      artifacts.push('.requirements.zip');
      artifacts.push('unzip_requirements.py');
    }
  }

  return BbPromise.all(
    artifacts.map(artifact =>
      fse.removeAsync(path.join(this.servicePath, artifact))
    )
  );
}
489964
def new_artifact_content name, options = {}, &block
      type = get_type(options)
      content = extract_content type, options, &block
      %Q{class #{marker(name, type)}
  #{content}
end}
    end