Skip to content
Permalink
Browse files
FREEMARKER-129 freemarker-generator: Merge "freemarker-cli" into "fre…
…emarker-generator" (#5)

* FREEMARKER-129 Move maven plugin into its own sub-module

* FREEMARKER-129 Move "freemarker-cli" into its submodule

* FREEMARKER-129 Extract submodule "freemarker-generator-base"

* FREEMARKER-129 Rename / move things around

* FREEMARKER-129 Rename / move things around

* FREEMARKER-129 Re-format the source code

* FREEMARKER-129 Refactor source code

* FREEMARKER-129 Move the tools into "freemarker-generator-tools"

* FREEMARKER-129 Move the tools into "freemarker-generator-tools"

* FREEMARKER-129 Cleanup source code

* FREEMARKER-129 Cleanup source code

* FREEMARKER-129 Minor refactorings

* FREEMARKER-129 Improve tests and Maven build

* Add CSV filter and transform example

* FREEMARKER-129 More refactoring and documentation updates

* FREEMARKER-129 More refactoring and documentation updates

* FREEMARKER-129 Cleanup POMs and dependency management

* FREEMARKER-129 Cleanup POMs and dependency management

* FREEMARKER-129 Use `freemarker.configuration.setting` in `freemarker-cli.properties` to configure FreeMarker

* FREEMARKER-129 Add `freemarker-generator-maven-plugin-sample`

* FREEMARKER-129 Add `freemarker-generator-maven-plugin-sample`

* FREEMARKER-129 Add `freemarker-generator-maven-plugin-sample`

* FREEMARKER-129 Make the Maven RAT plugin happy again

* FREEMARKER-129 Minor refactorings

* FREEMARKER-129 Add LICENSE and NOTICE files to each module

* FREEMARKER-129 Add Travis configuration

* FREEMARKER-129 Update documentation

* FREEMARKER-129 Refactor code

* FREEMARKER-129 Update documentation

* FREEMARKER-129 Refactor code

* FREEMARKER-129 Fix broken Travis build

* FREEMARKER-129 Improve Travis build

* FREEMARKER-129 Add OpenJDK 13 to Travis build

* FREEMARKER-129 Move the various constants into "FreeMarkerConstants" and remove "Settings" from the document model

* FREEMARKER-129 More refactoring & cleanup

* FREEMARKER-129 More refactoring & cleanup

* FREEMARKER-129 More refactoring & cleanup

* FREEMARKER-129 More refactoring & cleanup

* FREEMARKER-129 More refactoring & cleanup

* FREEMARKER-129 User-defined parameters are passed as `-Pkey=value` instead of using system properties

* FREEMARKER-129 User-defined parameters are passed as `-Pkey=value` instead of using system properties

* FREEMARKER-129 User-defined parameters are passed as `-Pkey=value` instead of using system properties

* FREEMARKER-129 More refactoring & cleanup

* FREEMARKER-129 More refactoring & cleanup

* FREEMARKER-129 Support document exclude pattern in addition to include pattern
  • Loading branch information
sgoeschl committed Feb 29, 2020
1 parent 4c7d696 commit e8bb62f1ed5a0c365dc3ae164c43428043ddceb1
Showing 230 changed files with 20,894 additions and 2,038 deletions.
@@ -15,17 +15,17 @@
# specific language governing permissions and limitations
# under the License.

/.ivy/
/.bin/
/build/
/build.properties
/archive/
/ide-dependencies/
/META-INF

/out/
/bin/
/target/
.ivy/
.bin/
build/
build.properties
archive/
ide-dependencies/
META-INF

out/
bin/
target/

.classpath
.project
@@ -0,0 +1,14 @@
language: java
jdk:
- openjdk8
- openjdk9
- openjdk10
- openjdk11
- openjdk12
- openjdk13
script:
- mvn clean install
- cd ./freemarker-generator-cli
- sh ./run-samples.sh
- cd ../freemarker-generator-maven-plugin-sample
- mvn clean package
@@ -1,15 +1,27 @@
# Changelog
# Change Log

## 1.0.0-SNAPSHOT
All notable changes to this project will be documented in this file. We try to adhere to https://github.com/olivierlacan/keep-a-changelog.

## 0.1.0-SNAPSHOT

### Added
* [FREEMARKER-129] Support document exclude pattern in addition to include pattern
* [FREEMARKER-129] User-defined parameters are passed as `-Pkey=value` instead of using system properties
* [FREEMARKER-129] Add `freemarker-generator-maven-plugin-sample`
* [FREEMARKER-129] Migrate `freemarker-cli` into `freemarker-generator` project (see [https://github.com/sgoeschl/freemarker-cli](https://github.com/sgoeschl/freemarker-cli))

### Changed
* [FREEMARKER-129] Use `freemarker.configuration.setting` in `freemarker-cli.properties` to configure FreeMarker
* [FREEMARKER-129] Provide a `toString()` metheod for all tools
* [FREEMARKER-129] Use version "0.X.Y" to cater for API changes according to [Semantic Versioning](https://semver.org)
* [FREEMARKER-129] Change artifact `freemarker-maven-plugin` to `freemarker-generator-maven-plugin`
* [FREEMARKER-128] Update `freemarker-maven-plugin` to Apache FreeMarker 2.3.29

### Fixed

[FREEMARKER-127] Site build fails with missing "org/apache/maven/doxia/siterenderer/DocumentContent"
### Deleted

### Removed
### Fixed
* [FREEMARKER-127] Site build fails with missing "org/apache/maven/doxia/siterenderer/DocumentContent"

[FREEMARKER-127]: https://issues.apache.org/jira/browse/FREEMARKER-127
[FREEMARKER-128]: https://issues.apache.org/jira/browse/FREEMARKER-128
[FREEMARKER-129]: https://issues.apache.org/jira/browse/FREEMARKER-129
446 LICENSE

Large diffs are not rendered by default.

10 NOTICE
@@ -1,5 +1,5 @@
Apache FreeMarker
Copyright 2015-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Apache FreeMarker Site
Copyright 2020 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
221 README.md
@@ -1,184 +1,37 @@
Apache FreeMarker Generator
===========================

For documentation or to report bugs visit:
https://freemarker.apache.org/generator.html


Regarding pull requests on Github
---------------------------------

By sending a pull request you grant the Apache Software Foundation
sufficient rights to use and release the submitted work under the
Apache license. You grant the same rights (copyright license, patent
license, etc.) to the Apache Software Foundation as if you have signed
a [Contributor License Agreement](https://www.apache.org/dev/new-committers-guide.html#cla).
For contributions that are judged to be non-trivial, you will be asked
to actually signing a Contributor License Agreement.


What is Apache FreeMarker Generator?
------------------------------------

FreeMarker Generator is a tool that generates files based on FreeMarker
templates and data that's typically provided in files (such as JSON files) as
well. It can be used to generated source code, configuration files, etc.

Currently it can be invoked as a Maven plug-in, but in the future it might
will be callable on other ways (say, from Gradle, or as a standalone command
line tool).

freemarker-generator-maven-plugin
---------------------------------
## Table of contents

- [Background](#background)
- [Install](#install)
- [Usage](#usage)
- [FreeMarker Template Files](#freemarker-template-files)
- [JSON Generator Files](#json-generator-files)
- [Using POM Properties During Generation](#using-pom-properties-during-generation)
- [FreeMarker Configuration](#freemarker-configuration)
- [Incremental Builds](#incremental-builds)
- [Code Coverage](#code-coverage)
- [Contributing](#contributing)
- [License](#license)

## Background
This plugin generates source files from FreeMarker templates with a flexible process that includes the ability to:

- Generate multiple source files from a single template,
- Generate source files during multiple steps in the build process such as testing, and
- Specify distinct locations for the templates and data models for different stages of the build.

## Install
### pom.xml

Add the following snippet within the `<plugins>` tag of your pom.xml:

```xml
<plugin>
<groupId>com.oath</groupId>
<artifactId>freemarker-maven-plugin</artifactId>
<version>${freemarker-maven-plugin.version}</version>
<configuration>
<!-- Required. Specifies the compatibility version for template processing -->
<freeMarkerVersion>2.3.23</freeMarkerVersion>
</configuration>
<executions>
<!-- If you want to generate files during other phases, just add more execution
tags and specify appropriate phase, sourceDirectory and outputDirectory values.
-->
<execution>
<id>freemarker</id>
<!-- Optional, defaults to generate-sources -->
<phase>generate-sources</phase>
<goals>
<!-- Required, must be generate -->
<goal>generate</goal>
</goals>
<configuration>
<!-- Optional, defaults to src/main/freemarker/generator -->
<sourceDirectory>src/main/freemarker</sourceDirectory>
<!-- Optional, defaults to src/main/freemarker/generator/template -->
<templateDirectory>src/main/freemarker/template</templateDirectory>
<!-- Optional, defaults to src/main/freemarker/generator -->
<generatorDirectory>src/main/freemarker/generator/generator</generatorDirectory>
<!-- Optional, defaults to target/generated-sources/freemarker -->
<outputDirectory>target/generated-sources/freemarker/generator</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
```

## Usage

### FreeMarker Template Files