kelemen commented on code in PR #79: URL: https://github.com/apache/freemarker/pull/79#discussion_r1431957728
########## osgi.bnd: ########## @@ -21,16 +21,13 @@ # imports by examining the class files, and generates the OSGi meta-info # based on that and this file. --classpath: build/classes -failok: false Review Comment: Makes sense, but in this PR, my goal is to reproduce the Ant build the best I can. So, I think it would be better to have such changes be done in a separate PR (after merging this). And I guess, then it would be better, if someone more competent in OSGI (I myself have very limited experience and knowledge) did that (I assume you are a lot more competent than me in OSGI). ########## 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: Similar to your other comment, I think this would make sense in another PR as another request. It would also be less to verify in one go. Though, `isReproducibleFileOrder = true` might be something that would go well in this PR. -- 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]
