This is an automated email from the ASF dual-hosted git repository. ddekany pushed a commit to branch FREEMARKER-183 in repository https://gitbox.apache.org/repos/asf/freemarker.git
commit 423bc6957432ffec56e798a032d1fe192a243f0b Author: ddekany <[email protected]> AuthorDate: Sat Jan 13 18:11:29 2024 +0100 (Build: Some comments, and minor cleanup) --- README.md | 3 ++- build.gradle.kts | 4 ++++ buildSrc/src/main/kotlin/freemarker/build/FreemarkerRootExtension.kt | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 384c486a..ea2fb9d6 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,8 @@ have to add it yourself! You can download it To build `freemarker.jar`, just issue `./gradlew jar` in the project root directory, and it should download all dependencies automatically and build `freemarker.jar`. -To run all checks, issue `./gradlew check`. +To run all JUnit tests and some other checks, issue `./gradlew check`. (Avoid the +`test` task, as that will only run the tests of the `core` source set.) To generate documentation, issue `./gradlew javadoc` and `./gradlew manualOffline`. diff --git a/build.gradle.kts b/build.gradle.kts index 84f2c3bf..114ac085 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,6 +52,10 @@ tasks.withType<Jar>().configureEach { } freemarkerRoot { + // FreeMarker 2.x build is unusual in that instead of using a nested Gradle project for each logical module, + // it uses a source set for each. This is because FreeMarker 2.x is a single monolithic artifact for historical + // reasons. + configureSourceSet(SourceSet.MAIN_SOURCE_SET_NAME) { enableTests() } configureSourceSet("javaxServlet") { enableTests() } configureSourceSet("jython20") diff --git a/buildSrc/src/main/kotlin/freemarker/build/FreemarkerRootExtension.kt b/buildSrc/src/main/kotlin/freemarker/build/FreemarkerRootExtension.kt index ddef3a34..ff23f7ad 100644 --- a/buildSrc/src/main/kotlin/freemarker/build/FreemarkerRootExtension.kt +++ b/buildSrc/src/main/kotlin/freemarker/build/FreemarkerRootExtension.kt @@ -97,11 +97,10 @@ class FreemarkerModuleDef internal constructor( val compilerVersion: JavaLanguageVersion ) { val main = sourceSetName == SourceSet.MAIN_SOURCE_SET_NAME - val baseDirName = if (main) "core" else sourceSetName.camelCaseToDashed() val sourceSet = context.sourceSets.maybeCreate(sourceSetName) - val sourceSetRootDirName = "freemarker-${baseDirName}" + val sourceSetRootDirName = "freemarker-${if (main) "core" else sourceSetName.camelCaseToDashed()}" val sourceSetSrcPath = sourceSetRoot(context, generated, sourceSetRootDirName) fun generateJakartaSources(
