chrisrueger commented on code in PR #79:
URL: https://github.com/apache/freemarker/pull/79#discussion_r1431985055


##########
build.gradle.kts:
##########
@@ -0,0 +1,572 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.nio.charset.StandardCharsets
+import java.nio.file.Files
+import java.util.stream.Collectors
+
+plugins {
+    `freemarker-root`
+    `maven-publish`
+    signing
+    id("biz.aQute.bnd.builder") version "6.1.0"
+    id("eclipse")
+}
+
+group = "org.freemarker"
+
+val fmExt = freemarkerRoot
+
+tasks.withType<JavaCompile>().configureEach {
+    options.encoding = "UTF-8"
+}
+
+freemarkerRoot {
+    configureTestUtils("16")
+
+    configureSourceSet(SourceSet.MAIN_SOURCE_SET_NAME, "8") { enableTests() }
+    configureSourceSet("jsp20", "8")
+    configureSourceSet("jsp21", "8") { enableTests() }
+    configureSourceSet("jython20", "8")
+    configureSourceSet("jython22", "8")
+    configureSourceSet("jython25", "8") { enableTests() }
+    configureSourceSet("core16", "16")
+}
+
+val compileJavacc = 
tasks.register<freemarker.build.CompileJavaccTask>("compileJavacc") {
+    sourceDirectory.set(file("freemarker-core/src/main/javacc"))
+    destinationDirectory.set(project.layout.buildDirectory.map { 
it.dir("generated").dir("javacc") })
+    javaccVersion.set("7.0.12")
+
+    fileNameOverrides.addAll(
+        "ParseException.java",
+        "TokenMgrError.java"
+    )
+
+    val basePath = "freemarker/core"
+
+    replacePattern(
+        "${basePath}/FMParser.java",
+        "enum",
+        "ENUM"
+    )
+    replacePattern(
+        "${basePath}/FMParserConstants.java",
+        "public interface FMParserConstants",
+        "interface FMParserConstants"
+    )
+    replacePattern(
+        "${basePath}/Token.java",
+        "public class Token",
+        "class Token"
+    )
+    // FIXME: This does nothing at the moment.
+    replacePattern(
+        "${basePath}/SimpleCharStream.java",
+        "public final class SimpleCharStream",
+        "final class SimpleCharStream"
+    )
+}
+sourceSets.main.get().java.srcDir(compileJavacc)
+
+tasks.sourcesJar.configure {
+    from(compileJavacc.flatMap { it.sourceDirectory })
+
+    from(files("LICENSE", "NOTICE")) {
+        into("META-INF")
+    }
+}
+
+tasks.javadocJar.configure {
+    from(files("src/dist/javadoc"))
+    from(files("NOTICE")) {
+        into("META-INF")
+    }
+}
+

Review Comment:
   @kelemen Sure, no problem,  it can go in another PR. Just wanted to add my 
thoughts as it came to mind when reading this here and I thought it might be an 
idea "while you are on it" :)  But sure there is already a lot in this PR, so 
feel free to do whenever you see fit. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to