Skip to content
Permalink
Browse files
FREEMARKER-153 FreeMarker Generator release preparations (#21)
  • Loading branch information
sgoeschl committed Aug 23, 2020
1 parent ca9d88a commit f4e13785f4a73804e9257b50b05758f2cc53c4bb
Showing 109 changed files with 1,485 additions and 908 deletions.
@@ -6,9 +6,10 @@ jdk:
- openjdk11
- openjdk12
- openjdk13
- openjdk14
script:
- mvn clean install
- cd ./freemarker-generator-cli
- cd ./freemarker-generator-cli/target/appassembler/
- sh ./run-examples.sh
- cd ../freemarker-generator-maven-plugin-sample
- cd ../../../freemarker-generator-maven-plugin-sample
- mvn clean package
@@ -23,7 +23,7 @@ well. It can be used to generated source code, configuration files, etc.

Currently it can be invoked as a

* Command-line interface `freemarker-generator-cli`
* Command-line interface `freemarker-generator`
* Maven plug-in `freemarker-generator-maven-plugin`

Building Apache FreeMarker Generator
@@ -47,13 +47,19 @@ public static class Configuration {
private Configuration() {
}

/** Prefix to extract tools from 'freemarker-cli.properties' */
// The default config file for freemarker generator
public static final String CONFIG_FILE_NAME = "config/freemarker-generator.properties";

/** The user's optional ".freemarker-generator" directory in the user's home directory */
public static final String USER_CONFIGURATION_DIR_NAME = ".freemarker-generator";

/** Prefix to extract tools from 'freemarker-generator.properties' */
public static final String TOOLS_PREFIX = "freemarker.tools.";

/** Key for reading the configured locale from 'freemarker-cli.properties' */
/** Key for reading the configured locale from 'freemarker-generator.properties' */
public static final String LOCALE_KEY = "freemarker.configuration.setting.locale";

/** Prefix to extract FreeMarker configuration settings from 'freemarker-cli.properties' */
/** Prefix to extract FreeMarker configuration settings from 'freemarker-generator.properties' */
public static final String SETTING_PREFIX = "freemarker.configuration.setting.";
}

@@ -69,7 +75,6 @@ private Location() {
public static final String STDIN = "stdin";
public static final String SYSTEM = "system";
public static final String STRING = "string";
public static final String URL = "url";
}

public static class Model {
@@ -87,4 +92,16 @@ private Model() {
public static final String FREEMARKER_USER_SYSTEM_PROPERTIES = "freemarker.user.system.properties";
public static final String FREEMARKER_USER_PARAMETERS = "freemarker.user.parameters";
}

public static class SystemProperties {

private SystemProperties() {
}

/** Installation directory of "freemarker-generator" when invoked with shell wrapper */
public static final String APP_HOME = "app.home";

/** Home directory of the user */
public static final String USER_HOME = "user.home";
}
}
@@ -16,6 +16,7 @@
*/
package org.apache.freemarker.generator.base.template;

import org.apache.freemarker.generator.base.FreeMarkerConstants.Location;
import org.apache.freemarker.generator.base.file.RecursiveFileSupplier;
import org.apache.freemarker.generator.base.util.NonClosableWriterWrapper;
import org.apache.freemarker.generator.base.util.StringUtils;
@@ -217,7 +218,7 @@ private TemplateTransformation resolveInteractiveTemplate(File out) {
}

private List<TemplateTransformation> resolveTemplateCode(String source, File out) {
final TemplateSource templateSource = TemplateSource.fromCode("interactive", source);
final TemplateSource templateSource = TemplateSource.fromCode(Location.INTERACTIVE, source);
final TemplateOutput templateOutput = templateOutput(out);
return singletonList(new TemplateTransformation(templateSource, templateOutput));
}
@@ -1,3 +1,3 @@
# Apache FreeMarker CLI Base
# Apache FreeMarker Generator Base

This package contains infrastructure code not depending on `Apache FreeMarker` directly since `DataSources` and their creation might be useful for un-related command-line tools.
@@ -16,6 +16,7 @@
*/
package org.apache.freemarker.generator.template;

import org.apache.freemarker.generator.base.FreeMarkerConstants.Location;
import org.apache.freemarker.generator.base.template.TemplateOutput;
import org.apache.freemarker.generator.base.template.TemplateSource;
import org.apache.freemarker.generator.base.template.TemplateSource.Origin;
@@ -42,7 +43,7 @@ public class TemplateTransformationsBuilderTest {
@Test
public void shouldCreateFromInteractiveTemplate() {
final TemplateTransformations transformations = builder()
.setTemplate("interactive", "Hello World")
.setTemplate(Location.INTERACTIVE, "Hello World")
.setStdOut()
.build();

@@ -51,7 +52,7 @@ public void shouldCreateFromInteractiveTemplate() {
final TemplateSource templateSource = transformations.get(0).getTemplateSource();
final TemplateOutput templateOutput = transformations.get(0).getTemplateOutput();

assertEquals("interactive", templateSource.getName());
assertEquals(Location.INTERACTIVE, templateSource.getName());
assertEquals(Origin.CODE, templateSource.getOrigin());
assertEquals("Hello World", templateSource.getCode());
assertNull(templateSource.getPath());
@@ -64,7 +65,7 @@ public void shouldCreateFromInteractiveTemplate() {
@Test(expected = IllegalArgumentException.class)
public void shouldThrowIllegalArgumentExceptionWheMixingInteractiveTemplateWithSources() {
builder()
.setTemplate("interactive", "Hello World")
.setTemplate(Location.INTERACTIVE, "Hello World")
.addSource(ANY_TEMPLATE_FILE_NAME)
.setStdOut()
.build();
@@ -17,6 +17,9 @@ All notable changes to this project will be documented in this file. We try to a
* [FREEMARKER-129] Migrate `freemarker-cli` into `freemarker-generator` project (see [https://github.com/sgoeschl/freemarker-cli](https://github.com/sgoeschl/freemarker-cli))

### Changed
* [FREEMARKER-153] Packaged templates are now prefixed with `freemarker-generator`, e.g. `freemarker-generator/info.ftl`
* [FREEMARKER-153] Renamed `--basedir` command line option to `--template-dir`
* [FREEMARKER-153] Renamed `freemarker-cli` to `freemarker-generator`
* Removing `DataSources.first` and use `dataSources.get(0)` instead
* [FREEMARKER-146] Cleanly separate example templates and data from user-supplied content
* `DataSource` use `uri` instead of `location`
@@ -27,11 +30,15 @@ All notable changes to this project will be documented in this file. We try to a
* [FREEMARKER-129] Provide a `toString()` method for all tools
* [FREEMARKER-129] Use version "0.X.Y" to cater for API changes according to [Semantic Versioning](https://semver.org)

### Fixed
### Fixed
* [FREEMARKER-153] Configuration files are bootstrapped from "app.home" system property
* [FREEMARKER-151] Ensure that build and and examples are running on Windows
* [FREEMARKER-147] Complete Maven site documentation
* [FREEMARKER-127] Site build fails with missing "org/apache/maven/doxia/siterenderer/DocumentContent"

### Internal
* [FREEMARKER-153] FreeMarker Generator release preparations

[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
@@ -46,4 +53,5 @@ All notable changes to this project will be documented in this file. We try to a
[FREEMARKER-147]: https://issues.apache.org/jira/browse/FREEMARKER-147
[FREEMARKER-148]: https://issues.apache.org/jira/browse/FREEMARKER-148
[FREEMARKER-149]: https://issues.apache.org/jira/browse/FREEMARKER-149
[FREEMARKER-151]: https://issues.apache.org/jira/browse/FREEMARKER-151
[FREEMARKER-151]: https://issues.apache.org/jira/browse/FREEMARKER-151
[FREEMARKER-153]: https://issues.apache.org/jira/browse/FREEMARKER-151
@@ -201,23 +201,182 @@
See the License for the specific language governing permissions and
limitations under the License.

=========================================================================

The source code contains the following binaries,
which were created at the Apache FreeMarker project, and hence are
covered by the same license as the other source files of it:

src/main/misc/overloadedNumberRules/prices.ods
src/manual/en_US/docgen-originals/figures/overview.odg
src/manual/en_US/docgen-originals/figures/model2sketch_with_alpha.png
src/manual/en_US/docgen-originals/figures/tree_with_alpha.png
src/manual/en_US/favicon.png
src/manual/en_US/figures/model2sketch.png
src/manual/en_US/figures/overview.png
src/manual/en_US/figures/tree.png
src/manual/en_US/logo.png
src/manual/zh_CN/favicon.png
src/manual/zh_CN/figures/model2sketch.png
src/manual/zh_CN/figures/overview.png
src/manual/zh_CN/figures/tree.png
src/manual/zh_CN/logo.png
==============================================================================

Binary distributions of this product bundles picocli which
is available under The Apache Software License version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles freemarker-generator-tools which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles slf4j-api which
is available under MIT License.
See licences/LICENCE_MIT.txt for more information ...

==============================================================================

Binary distributions of this product bundles slf4j-nop which
is available under MIT License.
See licences/LICENCE_MIT.txt for more information ...

==============================================================================

Binary distributions of this product bundles curvesapi which
is available under BSD License.
See licences/LICENCE_curvesapi.txt for more information ...

==============================================================================

Binary distributions of this product bundles gson which
is available under Apache 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles json-path which
is available under The Apache Software License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-codec which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-io which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles dataframe which
is available under MIT License.
See licences/LICENCE_MIT.txt for more information ...

==============================================================================

Binary distributions of this product bundles java-grok which
is available under The Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles activation which
is available under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.
See licences/LICENCE_CDDL-1.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles accessors-smart which
is available under The Apache Software License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles json-smart which
is available under The Apache Software License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles antlr4-runtime which
is available under The BSD License.
See licences/LICENCE_antlr4-runtime.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-collections4 which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-compress which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-csv which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-exec which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-lang3 which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles commons-math3 which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles freemarker-generator-base which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles poi which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles poi-ooxml which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles poi-ooxml-schemas which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles xmlbeans which
is available under The Apache Software License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles freemarker which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

==============================================================================

Binary distributions of this product bundles jsoup which
is available under The MIT License.
See licences/LICENCE_MIT.txt for more information ...

==============================================================================

Binary distributions of this product bundles asm which
is available under BSD.
See licences/LICENCE_asm.txt for more information ...

==============================================================================

Binary distributions of this product bundles snakeyaml which
is available under Apache License Version 2.0.
See licencens/LICENSE_ASL-2.0.txt for more information ...

0 comments on commit f4e1378

Please sign in to comment.