Skip to content

Commit

Permalink
Fix native support for Apache FreeMarker #278 (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 authored Jan 11, 2025
1 parent 74daf3b commit 607ea1d
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fix native support for Apache FreeMarker <https://github.com/fugerit-org/fj-doc/issues/278>
- subfolder for native embedded configuration file <https://github.com/fugerit-org/fj-doc/issues/276>
- freemarker-version 2.3.34
- quarkus-version set to 3.17.6 across al the modules

## [8.11.8] - 2025-01-10

### Changed
Expand Down
9 changes: 8 additions & 1 deletion fj-doc-freemarker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
</licenses>

<properties>
<freemarker-version>2.3.34</freemarker-version>
<freemarker-version>2.3.34</freemarker-version>
<freemarker-native-version>1.0.0</freemarker-native-version>
</properties>

<build>
Expand Down Expand Up @@ -79,6 +80,12 @@
<version>${freemarker-version}</version>
</dependency>

<dependency>
<groupId>org.fugerit.java</groupId>
<artifactId>freemarker-native</artifactId>
<version>${freemarker-native-version}</version>
</dependency>

<dependency>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ public String getResourcePathFmConfigXml() {
return VenusContext.toResourcePathFmConfigXml( this.getArtifactId() );
}

public boolean isFreeMarkerNativeAvailable() {
return VersionCheck.isMajorThan( this.getVersion(), VenusContext.VERSION_NA_FREEMARKER_NATIVE );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public static String toResourcePathFmConfigXml( String artifactId ) {

public static final String VERSION_NA_FULL_PROCESS = "8.6.2";

public static final String VERSION_NA_FREEMARKER_NATIVE = "8.11.8";

@Getter
private File projectDir;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<quarkus.platform.version>${context.flavourVersion}</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.3.1</surefire-plugin.version>
<quarkus-freemarker-version>1.1.0</quarkus-freemarker-version>
<freemarker-native-version>1.0.0</freemarker-native-version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -52,12 +52,14 @@
<artifactId>quarkus-arc</artifactId>
</dependency>
<#if context.modules?seq_contains("fj-doc-freemarker")>
<#if !context.freeMarkerNativeAvailable >
<dependency>
<groupId>io.quarkiverse.freemarker</groupId>
<artifactId>quarkus-freemarker</artifactId>
<version>${r"${quarkus-freemarker-version}"}</version>
<groupId>io.fugerit.java</groupId>
<artifactId>freemarker-natice</artifactId>
<version>${r"${freemarker-native-version}"}</version>
</dependency>
</#if>
</#if>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.fugerit.java.doc.project.facade.FlavourContext;
import org.fugerit.java.doc.project.facade.FlavourFacade;
import org.fugerit.java.doc.project.facade.ModuleFacade;
import org.fugerit.java.doc.project.facade.VenusContext;
import org.junit.Assert;
import org.junit.Test;

Expand All @@ -18,6 +19,8 @@
@Slf4j
public class TestInit {

private static final String FREEMARKER_NATIVE_AVAILABLE = "8.11.9";

private String getVersion() {
return "8.10.5";
}
Expand Down Expand Up @@ -81,6 +84,10 @@ public void testFlavourContext() {
context.setFlavourVersion( "test" );
FlavourFacade.checkFlavourVersion( context, FlavourFacade.FLAVOUR_QUARKUS_2 );
Assert.assertEquals( "test", context.getFlavourVersion() );
context.setVersion( VenusContext.VERSION_NA_FREEMARKER_NATIVE );
Assert.assertFalse( context.isFreeMarkerNativeAvailable() );
context.setVersion( FREEMARKER_NATIVE_AVAILABLE );
Assert.assertTrue( context.isFreeMarkerNativeAvailable() );
}

}
2 changes: 1 addition & 1 deletion fj-doc-mod-opencsv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<name>fj-doc-mod-opencsv</name>
<description>Renderer for CSV using OpenCSV</description>
<description>Fugerit Venus Doc Module. Contains doc handler for CSV format (based on com.opencsv:opencsv).</description>

<licenses>
<license>
Expand Down
6 changes: 0 additions & 6 deletions fj-doc-native-quarkus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<properties>
<maven.compiler.release>17</maven.compiler.release>
<surefire-plugin.version>3.5.2</surefire-plugin.version>
<quarkus-freemarker-version>1.1.0</quarkus-freemarker-version>
<quarkus.platform.version>${quarkus-version}</quarkus.platform.version>
<skipITs>true</skipITs>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -55,11 +54,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.freemarker</groupId>
<artifactId>quarkus-freemarker</artifactId>
<version>${quarkus-freemarker-version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down

0 comments on commit 607ea1d

Please sign in to comment.