/* (non-Javadoc)
@see com.tobedevoured.naether.api.Naether#addBuildArtifact(java.lang.String, java.lang.String, java.lang.String)
960880
public void addBuildArtifact(String notation, String path, String pom) {
        Artifact artifact = new DefaultArtifact(notation);
        artifact = artifact.setFile( new File(path) );
        
        this.buildArtifacts.add( artifact );
        
        String pomNotation = new StringBuilder( artifact.getGroupId() ).append(":")
            .append( artifact.getArtifactId() ).append(":")
            .append( Const.POM).append(":").append( artifact.getBaseVersion() ).toString();
        
        artifact = new DefaultArtifact(pomNotation);
        artifact = artifact.setFile( new File(pom) );
        
        this.buildArtifacts.add( artifact );
    }
1060371
public ISarlConstructorBuilder addSarlConstructor() {
		ISarlConstructorBuilder builder = this.iSarlConstructorBuilderProvider.get();
		builder.eInit(getSarlEvent(), getTypeResolutionContext());
		return builder;
	}
1025371
@Override
    public void visitBeanDefinitionConstructor(AnnotationMetadata annotationMetadata,
                                               boolean requiresReflection) {
        if (constructorVisitor == null) {
            // first build the constructor
            visitBeanDefinitionConstructorInternal(annotationMetadata, requiresReflection, Collections.emptyMap(), null, null);

            // now prepare the implementation of the build method. See BeanFactory interface
            visitBuildMethodDefinition(annotationMetadata, Collections.emptyMap(), Collections.emptyMap());

            // now override the injectBean method
            visitInjectMethodDefinition();
        }
    }
334900
public static BuildInfo appendBuildInfo(CpsScript cpsScript, Map<String, Object> stepVariables) {
        BuildInfo buildInfo = (BuildInfo) stepVariables.get(BUILD_INFO);
        if (buildInfo == null) {
            buildInfo = (BuildInfo) cpsScript.invokeMethod("newBuildInfo", Maps.newLinkedHashMap());
            stepVariables.put(BUILD_INFO, buildInfo);
        }
        buildInfo.setCpsScript(cpsScript);
        return buildInfo;
    }
509387
protected void registerBuildingAttributes() {
        // Default LmlActorBuilder:
        addBuildingAttributeProcessor(new SkinLmlAttribute(), "skin");
        addBuildingAttributeProcessor(new StyleLmlAttribute(), "style", "class");
        addBuildingAttributeProcessor(new OnResultInitialLmlAttribute(), "result", "onResult");
        addBuildingAttributeProcessor(new ToButtonTableLmlAttribute(), "toButtonTable");
        addBuildingAttributeProcessor(new ToDialogTableLmlAttribute(), "toDialogTable");
        addBuildingAttributeProcessor(new ToTitleTableLmlAttribute(), "toTitleTable");
        // Text:
        addBuildingAttributeProcessor(new TextLmlAttribute(), "text", "value");
        // Aligned:
        addBuildingAttributeProcessor(new HorizontalLmlAttribute(), "horizontal");
        addBuildingAttributeProcessor(new VerticalLmlAttribute(), "vertical");
        // FloatRange:
        addBuildingAttributeProcessor(new RangeInitialValueLmlAttribute(), "value");
        addBuildingAttributeProcessor(new RangeMaxValueLmlAttribute(), "max");
        addBuildingAttributeProcessor(new RangeMinValueLmlAttribute(), "min");
        addBuildingAttributeProcessor(new RangeStepSizeLmlAttribute(), "stepSize", "step");
        // Tooltip:
        addBuildingAttributeProcessor(new TooltipManagerLmlAttribute(), "tooltipManager");
    }
630252
public MethodInfo addDefaultConstructor() {
        Modifiers modifiers = new Modifiers();
        modifiers.setPublic(true);
        MethodInfo mi = addConstructor(modifiers, null, null);
        CodeBuilder builder = new CodeBuilder(mi);
        builder.loadThis();
        builder.invokeSuperConstructor();
        builder.returnVoid();
        return mi;
    }
715947
private void addCommonLoggingEventFieldsToConstructor(final MethodSpec.Builder constructorBuilder) {
        constructorBuilder.addParameter(TypeName.get(String.class), "message", Modifier.FINAL);
        constructorBuilder.addParameter(TypeName.get(String.class), "sourceFile", Modifier.FINAL);
        constructorBuilder.addParameter(TypeName.LONG, "lineNumber", Modifier.FINAL);
        constructorBuilder.addParameter(TypeName.get(String.class), "type", Modifier.FINAL);
        constructorBuilder.addParameter(TypeName.LONG, "sid", Modifier.FINAL);
        constructorBuilder.addParameter(TypeName.get(String.class), "logLevel", Modifier.FINAL);
        constructorBuilder.addParameter(TypeName.LONG, "timestamp", Modifier.FINAL);
        constructorBuilder.addCode("super(message,sourceFile,lineNumber,type,sid,logLevel,timestamp);");
    }
1007772
protected void generateBuilderFactoryContributions() {
		final List<TopElementDescription> topElements = generateTopElements(true, false);
		final boolean enableAppenders = getCodeBuilderConfig().isISourceAppendableEnable();
		for (final TopElementDescription element : topElements) {
			final String createFunctionName = "create" //$NON-NLS-1$
					+ Strings.toFirstUpper(element.getElementDescription().getName());
			this.builderFactoryContributions.addContribution(new StringConcatenationClient() {
				@Override
				protected void appendTo(TargetStringConcatenation it) {
					it.append("\t/** Create the factory for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
							+ element.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param name the name of the " + element.getElementDescription().getName()); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param resourceSet the set of the resources that must be used for"); //$NON-NLS-1$
					it.newLine();
					it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @return the factory."); //$NON-NLS-1$
					it.newLine();
					it.append("\t */"); //$NON-NLS-1$
					it.newLine();
					it.append("\t@"); //$NON-NLS-1$
					it.append(Pure.class);
					it.newLine();
					it.append("\tpublic "); //$NON-NLS-1$
					it.append(element.getElementDescription().getBuilderInterfaceType());
					it.append(" "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(String name, "); //$NON-NLS-1$
					it.append(ResourceSet.class);
					it.append(" resourceSet) {"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\t return "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(name, createResource(resourceSet));"); //$NON-NLS-1$
					it.newLine();
					it.append("\t}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
					it.append("\t/** Create the factory for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
							+ element.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param name the name of the " + element.getElementDescription().getName()); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param resource the resource that must be used for"); //$NON-NLS-1$
					it.newLine();
					it.append("\t *    containing the generated element, and resolving types from names."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @return the factory."); //$NON-NLS-1$
					it.newLine();
					it.append("\t */"); //$NON-NLS-1$
					it.newLine();
					it.append("\t@"); //$NON-NLS-1$
					it.append(Pure.class);
					it.newLine();
					it.append("\tpublic "); //$NON-NLS-1$
					it.append(element.getElementDescription().getBuilderInterfaceType());
					it.append(" "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(String name, "); //$NON-NLS-1$
					it.append(Resource.class);
					it.append(" resource) {"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\t"); //$NON-NLS-1$
					it.append(getScriptBuilderInterface());
					it.append(" scriptBuilder = createScript(getFooPackageName(), resource);"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\treturn scriptBuilder.add"); //$NON-NLS-1$
					it.append(Strings.toFirstUpper(element.getElementDescription().getName()));
					it.append("(name);"); //$NON-NLS-1$
					it.newLine();
					it.append("\t}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
				}
			});
			if (enableAppenders) {
				final String buildFunctionName = "build" + Strings.toFirstUpper(//$NON-NLS-1$
						element.getElementDescription().getName());
				final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl(
						element.getElementDescription().getName());
				this.builderFactoryContributions.addContribution(new StringConcatenationClient() {
					@Override
					protected void appendTo(TargetStringConcatenation it) {
						it.append("\t/** Create the appender for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
								+ element.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param name the name of the " + element.getElementDescription().getName()); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param resourceSet the set of the resources that must be used for"); //$NON-NLS-1$
						it.newLine();
						it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @return the appender."); //$NON-NLS-1$
						it.newLine();
						it.append("\t */"); //$NON-NLS-1$
						it.newLine();
						it.append("\t@"); //$NON-NLS-1$
						it.append(Pure.class);
						it.newLine();
						it.append("\tpublic "); //$NON-NLS-1$
						it.append(appender);
						it.append(" "); //$NON-NLS-1$
						it.append(buildFunctionName);
						it.append("(String name, "); //$NON-NLS-1$
						it.append(ResourceSet.class);
						it.append(" resourceSet) {"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\t"); //$NON-NLS-1$
						it.append(appender);
						it.append(" a = new "); //$NON-NLS-1$
						it.append(appender);
						it.append("("); //$NON-NLS-1$
						it.append(createFunctionName);
						it.append("(name, resourceSet));"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\tgetInjector().injectMembers(a);"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\treturn a;"); //$NON-NLS-1$
						it.newLine();
						it.append("\t}"); //$NON-NLS-1$
						it.newLineIfNotEmpty();
						it.newLine();
						it.append("\t/** Create the appender for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
								+ element.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param name the name of the " + element.getElementDescription().getName()); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param resource the resource that must be used for"); //$NON-NLS-1$
						it.newLine();
						it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @return the appender."); //$NON-NLS-1$
						it.newLine();
						it.append("\t */"); //$NON-NLS-1$
						it.newLine();
						it.append("\t@"); //$NON-NLS-1$
						it.append(Pure.class);
						it.newLine();
						it.append("\tpublic "); //$NON-NLS-1$
						it.append(appender);
						it.append(" "); //$NON-NLS-1$
						it.append(buildFunctionName);
						it.append("(String name, "); //$NON-NLS-1$
						it.append(Resource.class);
						it.append(" resource) {"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\t"); //$NON-NLS-1$
						it.append(appender);
						it.append(" a = new "); //$NON-NLS-1$
						it.append(appender);
						it.append("("); //$NON-NLS-1$
						it.append(createFunctionName);
						it.append("(name, resource));"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\tgetInjector().injectMembers(a);"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\treturn a;"); //$NON-NLS-1$
						it.newLine();
						it.append("\t}"); //$NON-NLS-1$
						it.newLineIfNotEmpty();
						it.newLine();
					}
				});
			}
		}
	}
390045
@Override
    public DEBBuilder addProvide(String name, String version, Condition... dependency)
    {
        control.addProvides(name);
        return this;
    }
1245746
private void addSource() {

    	// TODO this should be shared between here and IDLReader
    	File generatedSources = new File(getBaseDir(), generatedSourceDir);

        this.getProject().addCompileSourceRoot( generatedSources.getAbsolutePath() );
        this.getLog().debug( "Source directory " + generatedSources + " added." );
	}
824486
public boolean needsRebuild(final CCTask task, final TargetInfo target, final int dependencyDepth) {
    // look at any files where the compositeLastModified
    // is not known, but the includes are known
    //
    boolean mustRebuild = false;
    final CompilerConfiguration compiler = (CompilerConfiguration) target.getConfiguration();
    final String includePathIdentifier = compiler.getIncludePathIdentifier();
    final File[] sources = target.getSources();
    final DependencyInfo[] dependInfos = new DependencyInfo[sources.length];
    final long outputLastModified = target.getOutput().lastModified();
    //
    // try to solve problem using existing dependency info
    // (not parsing any new files)
    //
    DependencyInfo[] stack = new DependencyInfo[50];
    boolean rebuildOnStackExhaustion = true;
    if (dependencyDepth >= 0) {
      if (dependencyDepth < 50) {
        stack = new DependencyInfo[dependencyDepth];
      }
      rebuildOnStackExhaustion = false;
    }
    final TimestampChecker checker = new TimestampChecker(outputLastModified, rebuildOnStackExhaustion);
    for (int i = 0; i < sources.length && !mustRebuild; i++) {
      final File source = sources[i];
      final String relative = CUtil.getRelativePath(this.baseDirPath, source);
      DependencyInfo dependInfo = getDependencyInfo(relative, includePathIdentifier);
      if (dependInfo == null) {
        task.log("Parsing " + relative, Project.MSG_VERBOSE);
        dependInfo = parseIncludes(task, compiler, source);
      }
      walkDependencies(task, dependInfo, compiler, stack, checker);
      mustRebuild = checker.getMustRebuild();
    }
    return mustRebuild;
  }
259612
protected final void addPathTo(final StringBuilder result) {
        if (this.parent != null) {
            this.parent.addPathTo(result);
            if (!(this.parent instanceof PJsonArray)) {
                result.append(".");
            }
        }
        result.append(getPathElement(this.contextName));
    }
336946
public void addFieldInfo (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText)
  {
    add (SingleError.builderInfo ().setErrorFieldName (sFieldName).setErrorText (sText).build ());
  }
1051444
@Override
    public T addAsLibrary(File resource, ArchivePath target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource must be specified");
        Validate.notNull(target, "Target must be specified");

        if (resource.isFile()) {
            return addAsLibrary(new FileAsset(resource), target);
        }

        if (resource.listFiles().length == 0) {
            return addAsLibrary(new FileAsset(resource), target);
        }

        for (File file : resource.listFiles()) {
            addAsLibrary(file, new BasicPath(target, file.getName()));
        }
        return covarientReturn();
    }
670301
@RequestMapping(value = "builds/{buildId}/signature", method = RequestMethod.PUT)
    public Build updateBuildSignature(@PathVariable ID buildId, @RequestBody SignatureRequest request) {
        // Gets from the repository
        Build build = structureService.getBuild(buildId);
        // Updates
        build = build.withSignature(
                request.getSignature(build.getSignature())
        );
        // Saves in repository
        structureService.saveBuild(build);
        // As resource
        return build;
    }
897642
static void addTagToBuilder(Tag tag, TagMapBuilderImpl builder) {
    builder.put(tag.getKey(), tag.getValue(), tag.getTagMetadata());
  }
753537
@Override
    public DEBBuilder addRequire(String name, String version, Condition... dependency)
    {
        control.addDepends(release, version, dependency);
        return this;
    }