Repository: incubator-freemarker Updated Branches: refs/heads/3 c73dc5678 -> 1988dc0c8
FREEMARKER-54: Adding skeletal freemarker-spring module Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/dbbfe990 Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/dbbfe990 Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/dbbfe990 Branch: refs/heads/3 Commit: dbbfe99074d22fa59437a6d90499f3f3199040ba Parents: e78181a Author: Woonsan Ko <[email protected]> Authored: Wed Jun 14 21:03:35 2017 -0400 Committer: Woonsan Ko <[email protected]> Committed: Wed Jun 14 21:03:35 2017 -0400 ---------------------------------------------------------------------- freemarker-spring/build.gradle | 102 +++++++++++++++++++ .../spring/SpringConfigurationBuilder.java | 30 ++++++ settings.gradle | 1 + 3 files changed, 133 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/dbbfe990/freemarker-spring/build.gradle ---------------------------------------------------------------------- diff --git a/freemarker-spring/build.gradle b/freemarker-spring/build.gradle new file mode 100644 index 0000000..fa32eac --- /dev/null +++ b/freemarker-spring/build.gradle @@ -0,0 +1,102 @@ +/* + * 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. + */ + +title = "Apache FreeMarker Spring Framework support" +description = """\ +FreeMarker template engine, Spring Framework support. \ +This is an optional module, mostly useful in frameworks based on Spring Framework.""" + +dependencies { + compile project(":freemarker-core") + + compileOnly "javax.servlet:servlet-api:2.5" + + def springVersion = "4.3.9.RELEASE" + + compileOnly("org.springframework:spring-core:$springVersion") { + exclude group: "commons-logging", module: "commons-logging" + } + compileOnly("org.springframework:spring-beans:$springVersion") { + exclude group: "commons-logging", module: "commons-logging" + } + compileOnly("org.springframework:spring-context:$springVersion") { + exclude group: "commons-logging", module: "commons-logging" + } + compileOnly("org.springframework:spring-context-support:$springVersion") { + exclude group: "commons-logging", module: "commons-logging" + } + compileOnly("org.springframework:spring-web:$springVersion") { + exclude group: "commons-logging", module: "commons-logging" + } + compileOnly("org.springframework:spring-webmvc:$springVersion") { + exclude group: "commons-logging", module: "commons-logging" + } + + // ------------------------------------------------------------------------ + // For tests + + testCompile("org.springframework:spring-test:$springVersion") { + exclude group: "commons-logging", module: "commons-logging" + } +} + +jar { + manifest { + // This is needed for "a.class.from.another.Bundle"?new() to work. + instructionReplace 'DynamicImport-Package', '*' + + instructionReplace 'Bundle-RequiredExecutionEnvironment', 'JavaSE-1.7' + // TODO Gradle adds a "Require-Capability"... is it a problem? If not, do we need the above? + + attributes( + "Extension-name": "${project.group}:${project.name}", + "Specification-Title": project.title, + "Implementation-Title": project.title + ) + } +} + +javadoc { + title "${project.title} ${versionCanonical} API" +} + +// The identical parts of Maven "deployer" and "installer" configurations: +def mavenCommons = { callerDelegate -> + delegate = callerDelegate + + pom.project { + description project.description + } +} + +uploadArchives { + repositories { + mavenDeployer { + mavenCommons(delegate) + } + } +} + +install { + repositories { + mavenInstaller { + mavenCommons(delegate) + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/dbbfe990/freemarker-spring/src/main/java/org/apache/freemarker/spring/SpringConfigurationBuilder.java ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/main/java/org/apache/freemarker/spring/SpringConfigurationBuilder.java b/freemarker-spring/src/main/java/org/apache/freemarker/spring/SpringConfigurationBuilder.java new file mode 100644 index 0000000..ac0d963 --- /dev/null +++ b/freemarker-spring/src/main/java/org/apache/freemarker/spring/SpringConfigurationBuilder.java @@ -0,0 +1,30 @@ +/* + * 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. + */ +package org.apache.freemarker.spring; + +import org.apache.freemarker.core.Configuration.ExtendableBuilder; +import org.apache.freemarker.core.Version; + +public class SpringConfigurationBuilder extends ExtendableBuilder { + + public SpringConfigurationBuilder(Version incompatibleImprovements) { + super(incompatibleImprovements); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/dbbfe990/settings.gradle ---------------------------------------------------------------------- diff --git a/settings.gradle b/settings.gradle index 47fc644..2373331 100644 --- a/settings.gradle +++ b/settings.gradle @@ -26,4 +26,5 @@ include 'freemarker-servlet' include 'freemarker-test-utils' include 'freemarker-manual' include 'freemarker-dom' +include 'freemarker-spring'
