static def mergeContentAndMetadata()

in netbeans.apache.org/buildSrc/src/main/groovy/Utils.groovy [124:137]


    static def mergeContentAndMetadata(MergeData data) {
        def contentFile = new File(data.file)
        def ymlFile = new File(data.yml)
        def yml = loadYaml(ymlFile)
        def jb = new JsonBuilder(yml)
        //store content for a moment
        def cdata = contentFile.text
        contentFile.withWriter "UTF-8", { out ->
            writeCommonJBakeProperties(data, yml, out)
            out << "metadata=${jb.toString()}\n"
            out << "~~~~~~\n"
            out << cdata
        }
    }