Builds the book .ent file that is a basic requirement to build the book.

@param buildData Information and data structures for the build.
@return The book .ent file filled with content from the Content Spec.
3362
protected String buildBookEntityFile(final BuildData buildData) throws BuildProcessingException {
        final ContentSpec contentSpec = buildData.getContentSpec();

        final StringBuilder retValue = new StringBuilder();

        if (!buildData.getBuildOptions().getUseOldBugLinks() && buildData.getBuildOptions().getInsertBugLinks()) {
            // Add the bug link entities
            retValue.append("<!-- BUG LINK ENTITIES -->\n");
            try {
                final BaseBugLinkStrategy bugLinkStrategy = buildData.getBugLinkStrategy();
                final BugLinkOptions bugLinkOptions = buildData.getBugLinkOptions();
                retValue.append(bugLinkStrategy.generateEntities(bugLinkOptions, buildData.getBuildName(), buildData.getBuildDate()));
            } catch (UnsupportedEncodingException e) {
                throw new BuildProcessingException(e);
            } catch (BugLinkException e) {
                throw new BuildProcessingException(e);
            } catch (final Exception ex) {
                throw new BuildProcessingException("Failed to insert Bug Links into the DOM Document", ex);
            }
        }

        retValue.append("<!-- CS ENTITIES -->\n");
        final String entities = ContentSpecUtilities.generateEntitiesForContentSpec(contentSpec, buildData.getDocBookVersion(),
                buildData.getEscapedBookTitle(), buildData.getOriginalBookTitle(), buildData.getOriginalBookProduct());
        retValue.append(entities);

        // Add the docbook.ent file for DocBook 5 builds
        if (buildData.getDocBookVersion() == DocBookVersion.DOCBOOK_50) {
            retValue.append("<!-- START DOCBOOK ENTITIES -->\n");
            retValue.append(docbook45Entities);
        }

        return retValue.toString();
    }
1177844
public void setNodeData(byte[] nodeData)
    {
        this.nodeData = (nodeData != null) ? Arrays.copyOf(nodeData, nodeData.length) : null;
    }
1176069
public String build() {
    StringBuilder sb = new StringBuilder(funcName + "(");

    // Join args and kwargs into simple strings.
    String args =
        argList.stream()
            .map(PyExpr::getText)
            .filter(Objects::nonNull)
            .collect(Collectors.joining(", "));
    String kwargs =
        kwargMap.entrySet().stream()
            .map(entry -> entry.getKey() + "=" + entry.getValue().getText())
            .filter(Objects::nonNull)
            .collect(Collectors.joining(", "));

    // Strip empty strings.
    args = Strings.emptyToNull(args);
    kwargs = Strings.emptyToNull(kwargs);

    // Join all pieces together.
    Joiner.on(", ").skipNulls().appendTo(sb, args, kwargs, unpackedKwargs);

    sb.append(")");
    return sb.toString();
  }
439069
@Override
    public void build() throws DocletException {
        SortedSet<TypeElement> rootclasses = new TreeSet<>(utils.makeGeneralPurposeComparator());
        rootclasses.addAll(configuration.getIncludedTypeElements());
        if (!serialClassFoundToDocument(rootclasses)) {
            //Nothing to document.
            return;
        }
        writer = configuration.getWriterFactory().getSerializedFormWriter();
        if (writer == null) {
            //Doclet does not support this output.
            return;
        }
        build(layoutParser.parseXML(NAME), contentTree);
    }
917714
protected void populateDatabaseTopics(final BuildData buildData,
            final Map<String, BaseTopicWrapper<?>> topics) throws BuildProcessingException {
        final List<TopicWrapper> allTopics = new ArrayList<TopicWrapper>();
        final List<TopicWrapper> latestTopics = new ArrayList<TopicWrapper>();
        final List<TopicWrapper> revisionTopics = new ArrayList<TopicWrapper>();

        // Calculate the ids of all the topics to get
        final List<ITopicNode> topicNodes = buildData.getContentSpec().getAllTopicNodes();
        for (final ITopicNode topicNode : topicNodes) {
            // Determine which topics we need to fetch the latest topics for and which topics we need to fetch revisions for.
            final TopicWrapper topic;
            if (topicNode.getRevision() != null && !buildData.getBuildOptions().getUseLatestVersions()) {
                topic = topicProvider.getTopic(topicNode.getDBId(), topicNode.getRevision());
                revisionTopics.add(topic);
                allTopics.add(topic);
            } else if (buildData.getBuildOptions().getMaxRevision() != null && !buildData.getBuildOptions().getUseLatestVersions()) {
                topic = topicProvider.getTopic(topicNode.getDBId(), buildData.getBuildOptions().getMaxRevision());
                revisionTopics.add(topic);
                allTopics.add(topic);
            } else {
                topic = topicProvider.getTopic(topicNode.getDBId());
                latestTopics.add(topic);
                allTopics.add(topic);
            }

            // Add the topic to the topics collection
            final String key = DocBookBuildUtilities.getTopicBuildKey(topic);
            topics.put(key, topic);
            buildData.getBuildDatabase().add(topicNode, key);
        }
    }
1029725
function buildMetadata(f, metadataTarget, options, isText) {

  var ext = path.extname(f);
  var name = path.basename(f, ext);

  var data = buildMetadataContent(name, options, ext, isText);

  fs.ensureFileSync(metadataTarget);
  fs.writeFileSync(metadataTarget, data, 'utf8');

}
822655
public BuildRun createBuildRun(String name, DateTime date) {
        return getInstance().create().buildRun(this, name, date);
    }
1079240
@Nonnull
    public static ObjectId getCommitSHA1(@Nonnull Run<?, ?> build) throws IOException {
        List<BuildData> buildDataList = build.getActions(BuildData.class);

        Job<?, ?> parent = build.getParent();

        BuildData buildData = calculateBuildData(
            parent.getName(), parent.getFullName(), buildDataList
        );

        if (buildData == null) {
            throw new IOException(Messages.BuildDataHelper_NoBuildDataError());
        }

        // buildData?.lastBuild?.marked and fall back to .revision with null check everywhere to be defensive
        Build b = buildData.lastBuild;
        if (b != null) {
            Revision r = b.marked;
            if (r == null) {
                r = b.revision;
            }
            if (r != null) {
                return r.getSha1();
            }
        }

        // Nowhere to report => fail the build
        throw new IOException(Messages.BuildDataHelper_NoLastRevisionError());
    }
417059
public AnnotatedText build() {
    int plainTextPosition = 0;
    int totalPosition = 0;
    Map<Integer,Integer> mapping = new HashMap<>();
    mapping.put(0, 0);
    for (TextPart part : parts) {
      if (part.getType() == TextPart.Type.TEXT) {
        plainTextPosition += part.getPart().length();
        totalPosition += part.getPart().length();
      } else if (part.getType() == TextPart.Type.MARKUP) {
        totalPosition += part.getPart().length();
      } else if (part.getType() == TextPart.Type.FAKE_CONTENT) {
        plainTextPosition += part.getPart().length();
      }
      mapping.put(plainTextPosition, totalPosition);
    }
    return new AnnotatedText(parts, mapping, metaData, customMetaData);
  }
1345891
public NodeTypeData build()
   {
      if (nodeDefinitionDataBuilders.size() > 0)
      {
         childNodeDefinitions = new NodeDefinitionData[nodeDefinitionDataBuilders.size()];
         for (int i = 0; i < childNodeDefinitions.length; i++)
         {
            childNodeDefinitions[i] = nodeDefinitionDataBuilders.get(i).build();
         }
      }
      if (propertyDefinitionDataBuilders.size() > 0)
      {
         propertyDefinitions = new PropertyDefinitionData[propertyDefinitionDataBuilders.size()];
         for (int i = 0; i < propertyDefinitions.length; i++)
         {
            propertyDefinitions[i] = propertyDefinitionDataBuilders.get(i).build();
         }
      }
      return new NodeTypeDataImpl(name, primaryItemName, isMixin, isOrderable,  supertypes,
         propertyDefinitions, childNodeDefinitions);
   }
305737
public FlyWeightFlatXmlDataSet build(Reader xmlReader) throws DataSetException {
        InputSource inputSource = new InputSource(xmlReader);
        return buildInternal(inputSource);
    }
501544
public static void processTopicID(final BuildData buildData, final ITopicNode topicNode, final Document doc) {
        final BaseTopicWrapper<?> topic = topicNode.getTopic();

        // Ignore info topics
        if (!topic.hasTag(buildData.getServerEntities().getInfoTagId())) {
            // Get the id value
            final String errorXRefID = ((SpecNode) topicNode).getUniqueLinkId(buildData.isUseFixedUrls());

            // Set the id
            setDOMElementId(buildData.getDocBookVersion(), doc.getDocumentElement(), errorXRefID);
        }

        // Add the remap parameter
        final Integer topicId = topicNode.getDBId();
        doc.getDocumentElement().setAttribute("remap", "TID_" + topicId);
    }
843791
protected String buildPressGangWebsiteJS(final BuildData buildData) throws BuildProcessingException {
        try {
            final ContentSpec contentSpec = buildData.getContentSpec();
            final StringBuilder retValue = new StringBuilder("pressgang_website_callback([\n");

            final JsonStringEncoder encoder = JsonStringEncoder.getInstance();

            final List<? extends BaseTopicWrapper<?>> topics = buildData.getBuildDatabase().getAllTopics();
            boolean initial = true;
            for (final BaseTopicWrapper<?> topic : topics) {
                // Ignore info topics
                if (topic.hasTag(buildData.getServerEntities().getInfoTagId())) continue;

                // Insert a newline and comma to separate each array variable only after the first variable has been set
                if (!initial) {
                    retValue.append(",\n");
                } else {
                    initial = false;
                }

                // Find the fixed url to use
                final Integer topicId = topic.getTopicId();
                final List<ITopicNode> topicNodes = buildData.getBuildDatabase().getTopicNodesForTopicID(topicId);
                final SpecTopic specTopic = (SpecTopic) topicNodes.get(0);
                final String fixedUrl = specTopic.getUniqueLinkId(buildData.isUseFixedUrls());

                // Find the new since value to use
                final List<PropertyTagInTopicWrapper> newSinceProperties = topic.getProperties(
                        buildData.getServerEntities().getPressGangWebsitePropertyTagId());
                final List<String> values = new ArrayList<String>();
                if (newSinceProperties != null) {
                    for (final PropertyTagInTopicWrapper newSinceProperty : newSinceProperties) {
                        values.add(newSinceProperty.getValue());
                    }
                    Collections.sort(values);
                }

                // Opening brace
                retValue.append("\t{");

                // Data

                retValue.append("\"topicId\":").append(topicId);
                retValue.append(",\"target\":\"").append(new String(encoder.quoteAsUTF8(fixedUrl), ENCODING)).append("\"");
                retValue.append(",\"title\":\"").append(new String(encoder.quoteAsUTF8(topic.getTitle()), ENCODING)).append("\"");
                retValue.append(",\"newSince\":\"").append(
                        values.isEmpty() ? "" : new String(encoder.quoteAsUTF8(values.get(values.size() - 1)), ENCODING)).append("\"");


                // Closing brace
                retValue.append("}");
            }

            retValue.append("]");

            // Add the content spec id
            retValue.append(", ").append(contentSpec.getId());

            // Add the product
            retValue.append(", \"").append(
                    new String(encoder.quoteAsUTF8(DocBookBuildUtilities.getKeyValueNodeText(buildData, contentSpec.getProductNode())),
                            ENCODING)).append("\"");

            // Add the title
            retValue.append(", \"").append(
                    new String(encoder.quoteAsUTF8(DocBookBuildUtilities.getKeyValueNodeText(buildData, contentSpec.getTitleNode())),
                            ENCODING)).append("\"");

            // Add the version
            if (contentSpec.getVersion() != null) {
                retValue.append(", \"").append(
                        new String(encoder.quoteAsUTF8(DocBookBuildUtilities.getKeyValueNodeText(buildData, contentSpec.getVersionNode())),
                                ENCODING)).append("\"");
            } else {
                retValue.append(", null");
            }

            retValue.append(");");
            return retValue.toString();
        } catch (UnsupportedEncodingException e) {
            throw new BuildProcessingException(e);
        }
    }
1231412
public static ResourceRecordSet<TXTData> txt(String name, Collection<String> txtdata) {
    return new TXTBuilder().name(name).addAll(txtdata).build();
  }
1164163
public void build() throws IOException {
        if (! serialClassFoundToDocument(configuration.root.classes())) {
            //Nothing to document.
            return;
        }
        try {
            writer = configuration.getWriterFactory().getSerializedFormWriter();
            if (writer == null) {
                //Doclet does not support this output.
                return;
            }
        } catch (Exception e) {
            throw new DocletAbortException(e);
        }
        build(layoutParser.parseXML(NAME), contentTree);
        writer.close();
    }
289017
public static INDArray buildFromData(List<DataPoint> data) {
        INDArray ret = Nd4j.create(data.size(), data.get(0).getD());
        for (int i = 0; i < ret.slices(); i++)
            ret.putSlice(i, data.get(i).getPoint());
        return ret;
    }
570156
private void buildName(EventData data, EventData result, DataMediaPair pair) {
        DataMedia targetDataMedia = pair.getTarget();
        DataMedia sourceDataMedia = pair.getSource();
        String schemaName = buildName(data.getSchemaName(),
            sourceDataMedia.getNamespaceMode(),
            targetDataMedia.getNamespaceMode());
        String tableName = buildName(data.getTableName(), sourceDataMedia.getNameMode(), targetDataMedia.getNameMode());
        result.setSchemaName(schemaName);
        result.setTableName(tableName);
    }