All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.4.3.3.source-code.BUILD.bazel Maven / Gradle / Ivy

Go to download

StringTemplate is a java template engine for generating source code, web pages, emails, or any other formatted text output. StringTemplate is particularly good at multi-targeted code generators, multiple site skins, and internationalization/localization. It evolved over years of effort developing jGuru.com. StringTemplate also powers the ANTLR 3 and 4 code generator. Its distinguishing characteristic is that unlike other engines, it strictly enforces model-view separation. Strict separation makes websites and code generators more flexible and maintainable; it also provides an excellent defense against malicious template authors.

There is a newer version: 4.3.4
Show newest version
"""BUILD.bazel file for StringTemplate 4."""

load("@rules_java//java:defs.bzl", "java_library")

package(default_visibility = ["//:__pkg__"])

java_library(
    name = "stringtemplate4",
    srcs = glob(["**/*.java"]) + [
        "org/stringtemplate/v4/compiler/CodeGenerator.java",
        "org/stringtemplate/v4/compiler/GroupLexer.java",
        "org/stringtemplate/v4/compiler/GroupParser.java",
        "org/stringtemplate/v4/compiler/STParser.java",
    ],
    resources = glob(["**/*.jfd"]),
    deps = ["@antlr3//:java_runtime"],
)

genrule(
    name = "stringtemplate4_bootstrap",
    srcs = [
        "org/stringtemplate/v4/compiler/CodeGenerator.g",
        "org/stringtemplate/v4/compiler/Group.g",
        "org/stringtemplate/v4/compiler/STParser.g",
        "org/stringtemplate/v4/compiler/STLexer.tokens",
    ],
    outs = [
        "org/stringtemplate/v4/compiler/CodeGenerator.java",
        "org/stringtemplate/v4/compiler/GroupLexer.java",
        "org/stringtemplate/v4/compiler/GroupParser.java",
        "org/stringtemplate/v4/compiler/STParser.java",
    ],
    cmd = """
      cp $(location :org/stringtemplate/v4/compiler/STLexer.tokens) $(RULEDIR)/org/stringtemplate/v4/compiler/STLexer.tokens
      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/org/stringtemplate/v4/compiler $(location :org/stringtemplate/v4/compiler/STParser.g)
      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/org/stringtemplate/v4/compiler $(location :org/stringtemplate/v4/compiler/Group.g)
      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/org/stringtemplate/v4/compiler $(location :org/stringtemplate/v4/compiler/CodeGenerator.g)
      rm -f $(RULEDIR)/org/stringtemplate/v4/compiler/STLexer.tokens
    """,
    toolchains = ["@bazel_tools//tools/jdk:current_host_java_runtime"],
    tools = ["@antlr3_bootstrap//jar"],
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy