void renderHtml()

in buildSrc/src/main/groovy/org/grails/gradle/PluginsTask.groovy [65:107]


    void renderHtml(List<Plugin> plugins, String templateText, Map<String, String> metadata, String fileName) {
        String siteUrl = url.get()
        File inputFile = new File(output.get().absolutePath + "/" + RenderSiteTask.DIST)
        if (!inputFile.exists()) {
            inputFile.mkdir()
        }
        File pluginsFolder = new File(inputFile.absolutePath + "/" + "plugins")
        if (!pluginsFolder.exists()) {
            pluginsFolder.mkdir()
        }
        File pluginsTagsFolder = new File(inputFile.absolutePath + "/" + "plugins" + "/" + "tags")
        if (!pluginsTagsFolder.exists()) {
            pluginsTagsFolder.mkdir()
        }
        File pluginsOwnersFolder = new File(inputFile.absolutePath + "/" + "plugins" + "/" + "owners")
        if (!pluginsOwnersFolder.exists()) {
            pluginsOwnersFolder.mkdir()
        }
        File pluginOutputFile = new File(inputFile.absolutePath + "/" + fileName)
        pluginOutputFile.createNewFile()
        String html = PluginsPage.mainContent(siteUrl, plugins, 'Grails Plugins', null)
        html = RenderSiteTask.renderHtmlWithTemplateContent(html, metadata, templateText)
        html = RenderSiteTask.highlightMenu(html, metadata, "/plugins.html")
        pluginOutputFile.text = html

        List<String> tags = plugins.stream().flatMap(p -> p.labels.stream()).distinct().collect(Collectors.toList()) as List<String>
        for (String tag in tags) {
            File tagsOutputFile = new File(pluginsTagsFolder.getPath() + "/" + tag + ".html")
            tagsOutputFile.createNewFile()
            String htmlForTags = renderHtmlPagesForTags(siteUrl, plugins, tag)
            tagsOutputFile.text = RenderSiteTask.renderHtmlWithTemplateContent(htmlForTags, metadata, templateText)
        }

        List<String> owners = plugins.stream().map(p -> p.owner.name).distinct().collect(Collectors.toList())
                as List<String>

        for (String owner in owners) {
            File ownersOutputFile = new File(pluginsOwnersFolder.getPath() + "/" + owner + ".html")
            ownersOutputFile.createNewFile()
            String htmlForOwnersFile = renderHtmlPagesForOwners(siteUrl, plugins, owner)
            ownersOutputFile.text = RenderSiteTask.renderHtmlWithTemplateContent(htmlForOwnersFile, metadata, templateText)
        }
    }