http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 28532ff..955d490 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,13 @@ -/.ivy/ +**/build/ +/.out/ +/bin/ /.bin/ -/build/ -/build.properties +/target/ + +/gradle.properties /archive/ -/ide-dependencies/ /META-INF -/out/ -/bin/ -/target/ - .classpath .project .settings @@ -19,7 +17,7 @@ *.iws *.ipr .idea_modules/ -.out/ +/out/ *.tmp *.bak
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5d914d9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: java -install: ant download-ivy -jdk: - - oraclejdk8 -script: ant ci \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/LICENSE ---------------------------------------------------------------------- diff --git a/LICENSE b/LICENSE index 7449e24..7164877 100644 --- a/LICENSE +++ b/LICENSE @@ -201,14 +201,13 @@ See the License for the specific language governing permissions and limitations under the License. -========================================================================= +============================================================================== The Apache FreeMarker (incubating) source code contains the following -binaries, which were created at the Apache FreeMarker (incubating) -project, and hence are covered by the same license as the other source -files of it: +binaries, which were created at the Apache FreeMarker (incubating) 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 + freemarker-core/src/main/misc/overloadedNumberRules/prices.ods + freemarker-core/src/manual/en_US/docgen-originals/figures/overview.odg -========================================================================= +============================================================================== http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/README-gradle.md ---------------------------------------------------------------------- diff --git a/README-gradle.md b/README-gradle.md deleted file mode 100644 index 8b0fe67..0000000 --- a/README-gradle.md +++ /dev/null @@ -1,13 +0,0 @@ -The current gradle build is work in progress, so use the Ant build, as -described in README.md! - -To build the project, go to the project home directory, and issue: - - ./gradlew jar test - -On Windows this won't work if you are using an Apache source release (as -opposed to checking the project out from Git), as due to Apache policy -restricton `gradle\wrapper\gradle-wrapper.jar` is missing from that. So you -have to download that very common artifact from somewhere manually. On -UN*X-like systems (and from under Cygwin shell) you don't need that jar, as -our custom `gradlew` shell script does everything itself. http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 6393f28..7168740 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ If you are using Maven, just add this dependency: ```xml <dependency> - <groupId>org.apache</groupId> - <artifactId>freemarker</artifactId> + <groupId>org.apache.freemarker</groupId> + <artifactId>freemarker-core</artifactId> <version>{version}</version> </dependency> ``` @@ -101,25 +101,30 @@ If you haven't yet, download the source release, or checkout FreeMarker from the source code repository. See repository locations here: http://freemarker.org/sourcecode.html -You need JDK 8, Apache Ant (tested with 1.8.1) and Ivy (tested with 2.4.0) to -be installed. To install Ivy (but be sure it's not already installed), issue -`ant download-ivy`; it will copy Ivy under `~/.ant/lib`. (Alternatively, you -can copy `ivy-<version>.jar` into the Ant home `lib` subfolder manually.) +You need JDK 8 to be installed. -It's recommended to copy `build.properties.sample` into `build.properties`, -and edit its content to fit your system. (Although basic jar building should -succeeds without the build.properties file too.) +You must copy `gradle.properties.sample` into `gradle.properties`, and edit its +content to fit your system. -To build `freemarker.jar`, just issue `ant` in the project root directory, and -it should download all dependencies automatically and build `freemarker.jar`. +To build `freemarker.jar`, just issue `./gradlew jar` in the project root +directory (Windows users see the note below though), and it should download +all dependencies (including Gradle itself) automatically and build the jar-s. +You can found them in the build/libs subdirectory of each module +(freemarker-core, freemarker-servlet, etc.). You can also install the jar-s +into your local Maven repository with `./gradlew install`. -If later you change the dependencies in `ivy.xml`, or otherwise want to -re-download some of them, it will not happen automatically anymore, and you -must issue `ant update-deps`. +Note for Windows users: If you are using an Apache source release (as opposed +to checking the project out from the Git repository), ./gradlew will fail as +`gradle\wrapper\gradle-wrapper.jar` is missing. Due to Apache policy restricton +we can't include that file in distributions, so you have to download that very +common artifact from somewhere manually (like from out Git repository). (On +UN*X-like systems you don't need that jar, as our custom `gradlew` shell script +does everything itself.) -To test your build, issue `ant test`. +To test your build, issue `./gradlew test`. -To generate documentation, issue `ant javadoc` and `ant manualOffline`. +To generate documentation, issue `./gradlew javadoc` and +`./gradlew manualOffline` (TODO: the last doesn't yet work). Eclipse and other IDE setup @@ -129,10 +134,6 @@ Below you find the step-by-step setup for Eclipse Neon.1. If you are using a different version or an entierly different IDE, still read this, and try to apply it to your development environment: -- Install Ant and Ivy, if you haven't yet; see earlier. -- From the command line, run `ant clean jar ide-dependencies` - (Note that now the folders `ide-dependencies`, `build/generated-sources` and - `META-INF` were created.) - Start Eclipse - You may prefer to start a new workspace (File -> "Switch workspace"), but it's optional. @@ -156,8 +157,8 @@ apply it to your development environment: Number of imports required for .*: 99 Number of static imports needed for .*: 1 - Java -> Installed JRE-s: - Ensure that you have JDK 8 installed, and that it was added to Eclipse. - Note that it's not JRE, but JDK. + Ensure that you have JDK 7 and JDK 8 installed, and that it was added to + Eclipse. Note that it's not JRE, but JDK. - Java -> Compiler -> Javadoc: "Malformed Javadoc comments": Error "Only consider members as visible": Private @@ -165,28 +166,14 @@ apply it to your development environment: "Missing tag descriptions": Validate @return tags "Missing Javadoc tags": Ignore "Missing Javadoc comments": Ignore -- Create new "Java Project" in Eclipse: - - In the first window popping up: - - Change the "location" to the directory of the FreeMarker project - - Press "Next" - - In the next window, you see the build path settings: - - On "Source" tab, ensure that exactly these are marked as source - directories (be careful, Eclipse doesn't auto-detect these well): - build/generated-sources/java - src/main/java - src/main/resources - src/test/java - src/test/resources - - On the "Libraries" tab: - - Delete everyhing from there, except the "JRE System Library [...]" - - Edit "JRE System Library [...]" to "Execution Environment" "JavaSE 1.8" - - Add all jar-s that are directly under the "ide-dependencies" directory - (use the "Add JARs..." and select all those files). - - On the "Order and Export" tab find dom4j-*.jar, and send it to the - bottom of the list (becase, an old org.jaxen is included inside - dom4j-*.jar, which casues compilation errors if it wins over - jaxen-*.jar). - - Press "Finish" +- TODO: How to import the Gradle project into Eclipse + On IntelliJ: + - Import the whole FreeMarker project as a Gradle project. There are things that you + will have to set manually, but first, build the project with Gradle if you haven't + (see earlier how). + - Open Project Structure (Alt+Ctrl+Shift+S), and in the "Dependencies" tab of each + module, set "Module SDK" to "1.7", except for freemarker-core-java8, where it should + be "1.8". [TODO: Check if now it happens automatically] - Project -> Properties -> Java Compiler -> Errors/Warnings: Check in "Enable project specific settings", then set "Forbidden reference (access rules)" from "Error" to "Warning". @@ -198,7 +185,7 @@ apply it to your development environment: last should contain "Add missing @Override annotations", "Add missing @Override annotations to implementations of interface methods", "Add missing @Deprecated annotations", and "Remove unnecessary cast"). -- Right click on the project -> Run As -> JUnit Test +- Right click on the root project -> Run As -> JUnit Test [TODO: Try this] It should run without problems (all green). - It's highly recommened to use the Eclipse FindBugs plugin. - Install it from Eclipse Marketplace (3.0.1 as of this writing) http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 1a86c94..d47fa9e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,131 +1,279 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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 + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ -plugins { - id "ca.coglinc.javacc" version "2.4.0" +// TODO: Versions should come form src/main/resource/o/a/f/c/version.properties +ext.versionCanonical = "3.0.0-nightly-incubating" +ext.versionForMaven = "3.0.0-SNAPSHOT" +ext.versionForOSGi = "3.0.0.nightly-incubating" +ext.versionForMf = "2.97.0" + +allprojects { + group = "org.apache.freemarker" + version = "${versionCanonical}" } -apply plugin: "java" +// Libraries that are referred from multiple places: +ext.libraries = [ + findbugs: "com.google.code.findbugs:annotations:3.0.0" +] +ext.slf4jVersion = "1.7.25" -version = "3.0.0-nightly" +// Unwanted transitive dependencies that often get in accidentally: +ext.bannedLibraries = [ + // Note that the version must be omitted in these entres! + // We're using SLF4J + Logback Classic, and xxx-over-slf4j to mimic other logger libraries. + "org.slf4j:slf4j-log4j12", + "org.slf4j:slf4j-jdk14", + "log4j:log4j", + "commons-logging:commons-logging" +] as Set -repositories { - // mavenLocal() - mavenCentral() -} - -configurations.all { - // We use SLF4J with Logback binding, so exclude any other SLF4J bindings: - exclude group: "org.slf4j", module: "slf4j-log4j12" - exclude group: "org.slf4j", module: "slf4j-jdk14" - - // We use xxx-over-slf4j to substitute logging libraries, so exclude them: - exclude group: "log4j", module: "log4j" - exclude group: "commons-logging", module: "commons-logging" - - // xml-apis is part of the Java SE version for a good while; prevent old libraries pulling it in: - exclude group: "xml-apis", module: "xml-apis" -} - -configurations.testCompile { - // Jetty pulls in its own version of Servlet/JSP classes, so don't inherit these from the "compile" configuration: - exclude group: "javax.servlet.jsp", module: "jsp-api" - exclude group: "javax.servlet.jsp", module: "servlet-api" +['bootClasspathJava7', 'bootClasspathJava8'].each { + if (!project.hasProperty(it)) { + throw new org.gradle.api.GradleScriptException("The ${it} property " + + "must be set. Maybe you have missed this step: Copy gradle.properties.sample into gradle.properties, and " + + "edit it to describe your environment. Alternatively, pass the properties to gradle with " + + "-P${it}=\"...\".", + null); + } } -dependencies { - def jettyVersion = "7.6.16.v20140903" - def slf4jVersion = "1.7.22" - def springVersion = "2.5.6.SEC03" - - compile "com.google.guava:guava:20.0" - - compile "jaxen:jaxen:1.0-FCS" - compile "saxpath:saxpath:1.0-FCS" - compile "xalan:xalan:2.7.0" - - compile "org.slf4j:slf4j-api:$slf4jVersion" - - compile "org.zeroturnaround:javarebel-sdk:1.2.2" - - // TODO @SuppressFBWarnings-s should be removed before build, then this dependency is only needed for the IDE - compile "com.google.code.findbugs:annotations:3.0.0" - - // TODO These will be moved to the freemarker-serlvet module: - compile "javax.servlet.jsp:jsp-api:2.1" - compile "javax.servlet:servlet-api:2.5" - - // Test: - - testCompile "junit:junit:4.12" - testCompile "org.hamcrest:hamcrest-library:1.3" +subprojects { + apply plugin: "java" + apply plugin: "maven" + apply plugin: "osgi" + apply plugin: "idea" - testCompile "ch.qos.logback:logback-classic:1.1.8" - testCompile "org.slf4j:jcl-over-slf4j:$slf4jVersion" + // Default java compiler configuration (might be overridden in subprojects): + sourceCompatibility = "1.7" + targetCompatibility = "1.7" + [compileJava, compileTestJava]*.options*.encoding = "UTF-8" + [compileJava, compileTestJava]*.options*.bootClasspath = bootClasspathJava7 + // TODO Remove SuppressFBWarning-s from compileJava output somehow + // TODO Ensure that JUnit tests run on Java 7, except for the modules that were made for later versions. - testCompile "commons-io:commons-io:2.2" - testCompile "com.google.guava:guava-jdk5:17.0" - - testCompile "org.eclipse.jetty:jetty-server:$jettyVersion" - testCompile "org.eclipse.jetty:jetty-webapp:$jettyVersion" - testCompile "org.eclipse.jetty:jetty-jsp:$jettyVersion" - testCompile "org.eclipse.jetty:jetty-util:$jettyVersion" - - testCompile("displaytag:displaytag:1.2") { - exclude group: "com.lowagie", module: "itext" + repositories { + // mavenLocal() + mavenCentral() + } + + // Dependencies used in all subprojects: + dependencies { + // All subprojects have access to SLF4J (regardless if they actually use it at the moment): + compile "org.slf4j:slf4j-api:$slf4jVersion" + // All subprojects might use Findbugs annotations: + compileOnly libraries.findbugs + + // Test libraries and utilities might come handy during testing: + testCompile project(":freemarker-test-utils") } - testCompile "org.springframework:spring-core:$springVersion" - testCompile "org.springframework:spring-test:$springVersion" -} - -compileJava { - // TODO This will be 1.7 when freemarker-core-java8 is separated - sourceCompatibility = "1.8" - targetCompatibility = "1.8" - - options.encoding = "UTF-8" -} + // Like Maven's Enforcer plugin, make the build fail if certain libraries get in. (The problem with the + // customary `configurations.all { exclude ... }` soltion is that it bloats the genereated Maven POM-s a lot.) + test.doFirst { + configurations.testRuntime.getResolvedConfiguration().getResolvedArtifacts().each { + def artifactId = it.getModuleVersion().getId() + String artifactIdStr = "${artifactId.group}:${artifactId.name}" + if (artifactIdStr in bannedLibraries) { + throw new GradleScriptException( + "Banned library in the dependency graph: ${artifactIdStr}. " + + "Use `gradlew ${project.path}:dependencies` to find who pulls it in then exclude it there.", + null); + } + } + } -compileTestJava { - sourceCompatibility = "1.8" - targetCompatibility = "1.8" + jar { + manifest { // org.gradle.api.plugins.osgi.OsgiManifest + version versionForOSGi + license "Apache License, Version 2.0" // TODO has no effect; bug? + vendor "Apache Software Foundation" + // TODO The autogenerated Bundle-SymbolicName is weird, esp. for freemarker-core-java8. How should it look? + + attributes( + "Bundle-License": "Apache License, Version 2.0", // because `license "..."` above didn't work + "Specification-Version": versionForMf, + "Specification-Vendor": "Apache Software Foundation", + "Implementation-Version": versionForMf, + "Implementation-Vendor": "Apache Software Foundation" + ) + } + } - options.encoding = "UTF-8" -} + // The identical parts of Maven "deployer" and "installer" configuration: + def mavenCommons = { callerDelegate -> + delegate = callerDelegate + + pom.version = versionForMaven + pom.project { + organization { + name "Apache Software Foundation" + url "http://apache.org" + } + licenses { + license { + name "Apache License, Version 2.0" + url "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution "repo" + } + } + scm { + connection "scm:git:https://git-wip-us.apache.org/repos/asf/incubator-freemarker.git" + developerConnection "scm:git:https://git-wip-us.apache.org/repos/asf/incubator-freemarker.git" + url "https://git-wip-us.apache.org/repos/asf?p=incubator-freemarker.git" + if (versionForOSGi.contains('.stable')) { + tag "v${version}" + } + } + issueManagement { + system "jira" + url "https://issues.apache.org/jira/browse/FREEMARKER/" + } + mailingLists { + mailingList { + name "FreeMarker developer list" + post "[email protected]" + subscribe "[email protected]" + unsubscribe "[email protected]" + archive "http://mail-archives.apache.org/mod_mbox/incubator-freemarker-dev/" + } + mailingList { + name "FreeMarker commit and Jira notifications list" + post "[email protected]" + subscribe "[email protected]" + unsubscribe "[email protected]" + archive "http://mail-archives.apache.org/mod_mbox/incubator-freemarker-notifications/" + } + mailingList { + name "FreeMarker management private" + post "[email protected]" + } + } + } + } // end mavenCommons -compileJavacc { - arguments = [ grammar_encoding: "UTF-8" ] - doLast { - // TODO Some filtering is needed on the output - see in the original Ant build + uploadArchives { + repositories { + // TODO We must deploy source and javadoc artifact as well; see old Ant build.xml + mavenDeployer { + mavenCommons(delegate) + repository( + // URL-s copy-pasted from the org.apacha:apache parent POM + url: versionForMaven.contains('-SNAPSHOT') + ? "https://repository.apache.org/content/repositories/snapshots/" + : "https://repository.apache.org/service/local/staging/deploy/maven2" + ) + // TODO Password authentication needed (can it use ~/.m2/settings.xml, like the real Maven?) + // TODO We must sign all artifacts with GPG; see old Ant build.xml + } + } + } - // Note: The Gradle JavaCC plugin automatically removes generated java files that are already in - // src/main/java, so we don't need to get rid of ParseException.java and TokenMgrError.java (unlike in Ant) + install { + // TODO We must deploy source and javadoc artifact as well; see old Ant build.xml + repositories { + mavenInstaller { + mavenCommons(delegate) + } + } } -} + + // Post-process fully generated POM-s to remove test scope dependencies, just for the sake of aesthetics. + [install.repositories.mavenInstaller, uploadArchives.repositories.mavenDeployer]*.pom*.whenConfigured { pom -> + pom.dependencies = pom.dependencies.findAll { dep -> dep.scope != "test" } + } + + javadoc { + exclude "**/_*.java" + options.use = true + options.encoding = "UTF-8" + options.docEncoding = "UTF-8" + options.charSet = "UTF-8" + options.locale = "en_US" + options.links = [ "http://docs.oracle.com/javase/8/docs/api/" ] + doLast { + // We will fix low quality typography of JDK 8 Javadoc here. Bascially we make it look like JDK 7. + + File cssFile = new File(outputDirectory, "stylesheet.css") + assert cssFile.exists() + + // Tell that it's modified: + ant.replaceregexp( + file: cssFile, flags: "gs", encoding: "utf-8", + match: $//\* (Javadoc style sheet) \*//$, replace: $//\* \1 - JDK 8 usability fix regexp substitutions applied \*//$ + ) -jar { - // TODO Use bnd - see in the Ant build - manifest { - attributes( - // TODO There were more here in the Ant build - "Implementation-Title": "Apache FreeMarker", - "Implementation-Version": project.version) + // Remove broken link: + ant.replaceregexp( + file: cssFile, flags: "gs", encoding: "utf-8", + match: $/@import url\('resources/fonts/dejavu.css'\);\s*/$, replace: "" + ) + + // Font family fixes: + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/['"]DejaVu Sans['"]/$, replace: "Arial" + ) + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/['"]DejaVu Sans Mono['"]/$, replace: "'Courier New'" + ) + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/['"]DejaVu Serif['"]/$, replace: "Arial" + ) + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/(?<=[\s,:])serif\b/$, replace: "sans-serif" + ) + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/(?<=[\s,:])Georgia,\s*/$, replace: "" + ) + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/['"]Times New Roman['"],\s*/$, replace: "" + ) + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/(?<=[\s,:])Times,\s*/$, replace: "" + ) + ant.replaceregexp( + file: cssFile, flags: "gsi", encoding: "utf-8", + match: $/(?<=[\s,:])Arial\s*,\s*Arial\b/$, replace: "Arial" + ) + + // "Parameters:", "Returns:", "Throws:", "Since:", "See also:" etc. fixes: + String ddSelectorStart = $/(?:\.contentContainer\s+\.(?:details|description)|\.serializedFormContainer)\s+dl\s+dd\b.*?\{[^\}]*\b/$ + String ddPropertyEnd = $/\b.+?;/$ + // - Put back description (dd) indentation: + ant.replaceregexp( + file: cssFile, flags: "gs", encoding: "utf-8", + match: $/(${ddSelectorStart})margin${ddPropertyEnd}/$, replace: $/\1margin: 5px 0 10px 20px;/$ + ) + // - No monospace font for the description (dd) part: + ant.replaceregexp( + file: cssFile, flags: "gs", encoding: "utf-8", + match: $/(${ddSelectorStart})font-family${ddPropertyEnd}/$, replace: $/\1/$ + ) + + } } -} + +} // end subprojects \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/build.properties.sample ---------------------------------------------------------------------- diff --git a/build.properties.sample b/build.properties.sample deleted file mode 100644 index 51d253a..0000000 --- a/build.properties.sample +++ /dev/null @@ -1,23 +0,0 @@ -# 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. - -# Copy this file to "build.properties" before editing! -# These propeties should point to the rt.jar-s of the respective J2SE versions: -boot.classpath.j2se1.7=C:/Program Files/Java/jdk1.7.0_25/jre/lib/rt.jar -boot.classpath.j2se1.8=C:/Program Files/Java/jdk1.8.0_66/jre/lib/rt.jar -mvnCommand=C:/Program Files (x86)/maven3/bin/mvn.cmd -gpgCommand=C:/Program Files (x86)/GNU/GnuPG/pub/gpg.exe \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml deleted file mode 100644 index 3270ff9..0000000 --- a/build.xml +++ /dev/null @@ -1,1093 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. ---> - -<project basedir="." default="jar" name="freemarker" - xmlns:ivy="antlib:org.apache.ivy.ant" - xmlns:javacc="http://javacc.dev.java.net/" - xmlns:docgen="http://freemarker.org/docgen" - xmlns:bnd="http://www.aqute.biz/bnd" - xmlns:rat="antlib:org.apache.rat.anttasks" - xmlns:u="http://freemarker.org/util" -> - - <!-- ================================================================== --> - <!-- Properties --> - <!-- ================================================================== --> - - <!-- Maven project coordinates: --> - <property name="mavenGroupId" value="org.apache.freemarker" /> - <property name="mavenArtifactId" value="freemarker" /> - <!-- Ivy project coordinates: --> - <property name="moduleOrg" value="org.freemarker" /> - <property name="moduleName" value="freemarker" /> - <property name="moduleBranch" value="3" /> - - <!-- Will be overidden on the Continous Integration server: --> - <property name="server.ivy.repo.root" value="${basedir}/build/dummy-server-ivy-repo" /> - - <property file="build.properties"/> - <condition property="has.explicit.boot.classpath.j2se1.7"> - <isset property="boot.classpath.j2se1.7"/> - </condition> - <condition property="has.explicit.boot.classpath.j2se1.8"> - <isset property="boot.classpath.j2se1.8"/> - </condition> - <condition property="has.all.explicit.boot.classpaths"> - <and> - <isset property="has.explicit.boot.classpath.j2se1.7"/> - <isset property="has.explicit.boot.classpath.j2se1.8"/> - </and> - </condition> - <available property="atLeastJDK8" classname="java.util.function.Predicate"/> - - <!-- When boot.classpath.j2se* is missing, these will be the defaults: --> - <!-- Note: Target "dist" doesn't allow using these. --> - <property name="boot.classpath.j2se1.7" value="${sun.boot.class.path}" /> - <property name="boot.classpath.j2se1.8" value="${sun.boot.class.path}" /> - - <!-- For checking the correctness of the boot.classpath.j2se* --> - <available classpath="${boot.classpath.j2se1.7}" - classname="java.util.Objects" ignoresystemclasses="true" - property="boot.classpath.j2se1.7.correct" - /> - <available classpath="${boot.classpath.j2se1.8}" - classname="java.time.Instant" ignoresystemclasses="true" - property="boot.classpath.j2se1.8.correct" - /> - - <!-- Set up version/timestamp filters and the version property: --> - <tstamp> - <format property="timestampNice" pattern="yyyy-MM-dd'T'HH:mm:ss'Z'" - timezone="UTC" /> - <format property="timestampInVersion" pattern="yyyyMMdd'T'HHmmss'Z'" - timezone="UTC" /> - </tstamp> - <filter token="timestampInVersion" value="${timestampInVersion}" /> - <filter token="timestampNice" value="${timestampNice}" /> - <mkdir dir="build"/> - <!-- Copying is needed to substitute the timestamps. --> - <copy - file="src/main/resources/org/apache/freemarker/core/version.properties" - tofile="build/version.properties.tmp" - filtering="true" - overwrite="true" - /> - <property file="build/version.properties.tmp" /> - <delete file="build/version.properties.tmp" /> - <filter token="version" value="${version}" /> - - <property name="dist.dir" value="build/dist" /> - <property name="dist.archiveBaseName" value="apache-${mavenArtifactId}-${version}" /> - <property name="dist.bin.dir" value="${dist.dir}/bin/${dist.archiveBaseName}-bin" /> - <property name="dist.src.dir" value="${dist.dir}/src/${dist.archiveBaseName}-src" /> - - <!-- ================================================================== --> - <!-- Initialization --> - <!-- ================================================================== --> - - - <target name="clean" description="get rid of all generated files"> - <delete dir="build" /> - <delete dir="META-INF" /> - </target> - - <target name="clean-classes" description="get rid of compiled classes"> - <delete dir="build/classes" /> - <delete dir="build/test-classes" /> - <delete dir="build/coverage/classes" /> - </target> - - <condition property="deps.available"> - <available file=".ivy" /> - </condition> - - <target name="init" depends="_autoget-deps" - description="Fetch dependencies if any are missing and create the build directory if necessary" - > - <mkdir dir="build"/> - </target> - - <property name="ivy.install.version" value="2.4.0" /> - <property name="ivy.home" value="${user.home}/.ant" /> - <property name="ivy.jar.dir" value="${ivy.home}/lib" /> - <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" /> - - <target name="download-ivy"> - <mkdir dir="${ivy.jar.dir}"/> - <get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" - dest="${ivy.jar.file}" usetimestamp="true"/> - </target> - - <!-- ================================================================= --> - <!-- Compilation --> - <!-- ================================================================= --> - - <target name="javacc" depends="init" unless="parser.uptodate" - description="Build the parser from its grammar file" - > - <ivy:cachepath conf="parser" pathid="ivy.dep" /> - <taskdef name="generate" classname="org.apache.tools.ant.taskdefs.optional.javacc.JavaCC" - uri="http://javacc.dev.java.net/" - classpathref="ivy.dep" - /> - - <property name="_javaccOutputDir" - value="build/generated-sources/java/org/apache/freemarker/core" - /> - - <mkdir dir="${_javaccOutputDir}" /> - <ivy:retrieve conf="parser" pattern="build/javacc-home.tmp/[artifact].[ext]" /> - <javacc:generate - target="src/main/javacc/FTL.jj" - outputdirectory="${_javaccOutputDir}" - javacchome="build/javacc-home.tmp" - /> - <delete dir="build/javacc-home.tmp" /> - - <replace - file="${_javaccOutputDir}/FMParser.java" - token="private final LookaheadSuccess" - value="private static final LookaheadSuccess" - /> - <replace - file="${_javaccOutputDir}/FMParserConstants.java" - token="public interface FMParserConstants" - value="interface FMParserConstants" - /> - <replace - file="${_javaccOutputDir}/FMParserTokenManager.java" - token="public class FMParserTokenManager" - value="class FMParserTokenManager" - /> - <replace - file="${_javaccOutputDir}/Token.java" - token="public class Token" - value="class Token" - /> - <replace - file="${_javaccOutputDir}/SimpleCharStream.java" - token="public final class SimpleCharStream" - value="final class SimpleCharStream" - /> - <replace - file="${_javaccOutputDir}/FMParser.java" - token="enum" - value="ENUM" - /> - - <!-- As we have a modified version in src/main/java: --> - <move - file="${_javaccOutputDir}/ParseException.java" - tofile="${_javaccOutputDir}/ParseException.java.ignore" - /> - <move - file="${_javaccOutputDir}/TokenMgrError.java" - tofile="${_javaccOutputDir}/TokenMgrError.java.ignore" - /> - </target> - - <target name="compile" depends="javacc"> - <fail unless="boot.classpath.j2se1.7.correct"><!-- - -->The "boot.classpath.j2se1.7" property value (${boot.classpath.j2se1.7}) <!-- - -->seems to be an incorrect boot classpath. Please fix it in <!-- - -->the <projectDir>/build.properties file, or wherever you <!-- - -->set it.<!-- - --></fail> - <fail unless="boot.classpath.j2se1.8.correct"><!-- - -->The "boot.classpath.j2se1.8" property value (${boot.classpath.j2se1.8}) <!-- - -->seems to be an incorrect boot classpath. Please fix it in <!-- - -->the <projectDir>/build.properties file, or wherever you <!-- - -->set it.<!-- - --></fail> - <echo level="info"><!-- - -->Using boot classpaths:<!-- - -->Java 7: ${boot.classpath.j2se1.7}; <!-- - -->Java 8: ${boot.classpath.j2se1.8}; <!-- - --></echo> - - <!-- Comment out @SuppressFBWarnings, as it causes compilation warnings in dependent Gradle projects --> - <delete dir="build/src-main-java-filtered" /> - <mkdir dir="build/src-main-java-filtered" /> - <copy toDir="build/src-main-java-filtered"> - <fileset dir="src/main/java" /> - </copy> - <replaceregexp - flags="gs" encoding="utf-8" - match='(@SuppressFBWarnings\(.+?"\s*\))' replace="/*\1*/" - > - <fileset dir="build/src-main-java-filtered" includes="**/*.java" /> - </replaceregexp> - <replaceregexp - flags="gs" encoding="utf-8" - match='(import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;)' replace="// \1" - > - <fileset dir="build/src-main-java-filtered" includes="**/*.java" /> - </replaceregexp> - - <mkdir dir="build/classes" /> - - <!-- Note: the "build.base" conf doesn't include optional FreeMarker dependencies. --> - <ivy:cachepath conf="build.base" pathid="ivy.dep" /> - <javac destdir="build/classes" deprecation="off" - debug="on" optimize="off" target="1.7" source="1.7" encoding="utf-8" - includeantruntime="false" - classpathref="ivy.dep" - bootclasspath="${boot.classpath.j2se1.7}" - excludes=" - org/apache/freemarker/core/_Java?*Impl.java, - org/apache/freemarker/servlet/**" - > - <src> - <pathelement location="build/src-main-java-filtered" /> - <pathelement location="build/generated-sources" /> - </src> - </javac> - - <ivy:cachepath conf="build.base" pathid="ivy.dep" /> - <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" - debug="on" optimize="off" target="1.8" source="1.8" encoding="utf-8" - includeantruntime="false" - classpathref="ivy.dep" - bootclasspath="${boot.classpath.j2se1.8}" - includes="org/apache/freemarker/core/_Java8Impl.java" - /> - - <rmic - base="build/classes" includes="org/apache/freemarker/core/debug/impl/Rmi*Impl.class" - classpathref="ivy.dep" - verify="yes" stubversion="1.2" - /> - - <ivy:cachepath conf="build.jsp2.1" pathid="ivy.dep.jsp2.1" /> - <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" - debug="on" optimize="off" target="1.7" source="1.7" encoding="utf-8" - includeantruntime="false" - classpathref="ivy.dep.jsp2.1" - bootclasspath="${boot.classpath.j2se1.7}" - includes=" - org/apache/freemarker/servlet/**" - /> - - <rmic base="build/classes" classpathref="ivy.dep" - includes="build/src-main-java-filtered/org/apache/freemarker/core/debug/Rmi*Impl.class" - verify="yes" stubversion="1.2" - /> - - <copy toDir="build/classes"> - <fileset dir="src/main/resources" - excludes=" - org/apache/freemarker/core/version.properties" - /> - </copy> - <copy toDir="build/classes" filtering="true" overwrite="true"> - <fileset dir="src/main/resources" - includes=" - org/apache/freemarker/core/version.properties" - /> - </copy> - <copy toDir="build/classes/META-INF"> - <fileset dir="." includes="DISCLAIMER" /> - </copy> - <copy toDir="build/classes/META-INF"> - <fileset dir="src/dist/jar/META-INF" includes="*" /> - </copy> - - <delete dir="build/src-main-java-filtered" /> - </target> - - <target name="compileTest" depends="compile"> - <mkdir dir="build/test-classes" /> - - <ivy:cachepath conf="build.test" pathid="ivy.dep.build.test" /> - <javac srcdir="src/test/java" destdir="build/test-classes" deprecation="off" - debug="on" optimize="off" target="1.8" source="1.8" encoding="utf-8" - includeantruntime="false" - classpath="build/classes" - classpathref="ivy.dep.build.test" - bootclasspath="${boot.classpath.j2se1.8}" - /> - <copy toDir="build/test-classes"> - <fileset dir="src/test/resources" - excludes="" - /> - </copy> - </target> - - <target name="jar" depends="compile"> - <ivy:cachepath pathid="ivy.dep" conf="bnd" /> - <taskdef resource="aQute/bnd/ant/taskdef.properties" - uri="http://www.aqute.biz/bnd" - classpathref="ivy.dep" - /> - - <bnd:bnd - files="osgi.bnd" eclipse="false" - output="build/freemarker.jar" - /> - </target> - - <!-- ================================================================= --> - <!-- Testing --> - <!-- ================================================================= --> - - <target name="test" depends="compileTest" description="Run test cases"> - <mkdir dir="build/junit-reports" /> - <ivy:cachepath conf="run.test" pathid="ivy.dep.run.test" /> - <junit haltonfailure="on" fork="true" forkmode="once"> - <classpath> - <pathelement path="build/test-classes" /> - <pathelement path="build/classes" /> - <path refid="ivy.dep.run.test" /> - </classpath> - <formatter type="plain" /> - <formatter type="xml" /> - <batchtest todir="build/junit-reports"> - <fileset dir="src/test/java"> - <include name="**/*Test.java" /> - <include name="**/*TestSuite.java" /> - <exclude name="**/Abstract*.java" /> - </fileset> - </batchtest> - </junit> - </target> - - <!-- ================================================================= --> - <!-- Generate docs --> - <!-- ================================================================= --> - - <target name="_rawJavadoc" depends="compile"> - <mkdir dir="build/api" /> - <delete includeEmptyDirs="yes"> - <fileset dir="build/api" includes="**/*" /> - </delete> - <!-- javadoc with <fileset> has bugs, so we invoke a filtered copy: --> - <copy todir="build/javadoc-sources"> - <fileset dir="src/main/java"> - <exclude name="**/_*.java" /> - <exclude name="**/SunInternalXalanXPathSupport.java" /> - <!-- Remove classes that are, I suppose, only accidentally public: --> - <exclude name="**/core/LocalContext.java" /> - <exclude name="**/core/CollectionAndSequence.java" /> - <exclude name="**/core/Comment.java" /> - <exclude name="**/core/DebugBreak.java" /> - <exclude name="**/core/Expression.java" /> - <exclude name="**/core/LibraryLoad.java" /> - <exclude name="**/core/Macro.java" /> - <exclude name="**/core/ReturnInstruction.java" /> - <exclude name="**/core/StringArraySequence.java" /> - <exclude name="**/core/TemplateElement.java" /> - <exclude name="**/core/TemplateObject.java" /> - <exclude name="**/core/TextBlock.java" /> - <exclude name="**/core/ReturnInstruction.java" /> - <exclude name="**/core/TokenMgrError.java" /> - <exclude name="**/template/EmptyMap.java" /> - <exclude name="**/log/SLF4JLoggerFactory.java" /> - <exclude name="**/log/CommonsLoggingLoggerFactory.java" /> - </fileset> - </copy> - - <!-- conf="IDE": as that has to contain all depedencies --> - <ivy:cachepath conf="IDE" pathid="ivy.dep" /> - <javadoc - sourcepath="build/javadoc-sources" - destdir="build/api" - doctitle="FreeMarker ${version}" - use="true" - version="true" - author="true" - windowtitle="FreeMarker ${version} API" - classpath="build/classes" - classpathref="ivy.dep" - failonerror="true" - charset="UTF-8" - docencoding="UTF-8" - locale="en_US" - > - <link href="http://docs.oracle.com/javase/8/docs/api/"/> - </javadoc> - <delete dir="build/javadoc-sources" /> - </target> - - <target name="javadoc" depends="_rawJavadoc, _fixJDK8JavadocCSS" description="Build the JavaDocs" /> - - <target name="_fixJDK8JavadocCSS" depends="_rawJavadoc" if="atLeastJDK8"> - <property name="file" value="build/api/stylesheet.css" /> - - <available file="${file}" property="stylesheet.available"/> - <fail unless="stylesheet.available">CSS file not found: ${file}</fail> - <echo>Fixing JDK 8 CSS in ${file}</echo> - - <!-- Tell that it's modified: --> - <replaceregexp - file="${file}" flags="gs" encoding="utf-8" - match="/\* (Javadoc style sheet) \*/" replace="/\* \1 - JDK 8 usability fix regexp substitutions applied \*/" - /> - - <!-- Remove broken link: --> - <replaceregexp - file="${file}" flags="gs" encoding="utf-8" - match="@import url\('resources/fonts/dejavu.css'\);\s*" replace="" - /> - - <!-- Font family fixes: --> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="['"]DejaVu Sans['"]" replace="Arial" - /> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="['"]DejaVu Sans Mono['"]" replace="'Courier New'" - /> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="['"]DejaVu Serif['"]" replace="Arial" - /> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="(?<=[\s,:])serif\b" replace="sans-serif" - /> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="(?<=[\s,:])Georgia,\s*" replace="" - /> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="['"]Times New Roman['"],\s*" replace="" - /> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="(?<=[\s,:])Times,\s*" replace="" - /> - <replaceregexp - file="${file}" flags="gsi" encoding="utf-8" - match="(?<=[\s,:])Arial\s*,\s*Arial\b" replace="Arial" - /> - - <!-- "Parameters:", "Returns:", "Throws:", "Since:", "See also:" etc. fixes: --> - <property name="ddSelectorStart" value="(?:\.contentContainer\s+\.(?:details|description)|\.serializedFormContainer)\s+dl\s+dd\b.*?\{[^\}]*\b" /> - <property name="ddPropertyEnd" value="\b.+?;" /> - <!-- - Put back description (dd) indentation: --> - <replaceregexp - file="${file}" flags="gs" encoding="utf-8" - match="(${ddSelectorStart})margin${ddPropertyEnd}" replace="\1margin: 5px 0 10px 20px;" - /> - <!-- - No monospace font for the description (dd) part: --> - <replaceregexp - file="${file}" flags="gs" encoding="utf-8" - match="(${ddSelectorStart})font-family${ddPropertyEnd}" replace="\1" - /> - </target> - - <!-- ====================== --> - <!-- Manual --> - <!-- ====================== --> - - <macrodef name="manual" uri="http://freemarker.org/util"> - <attribute name="offline" /> - <attribute name="locale" /> - <sequential> - <ivy:cachepath conf="manual" pathid="ivy.dep" /> - <taskdef resource="org/freemarker/docgen/antlib.properties" - uri="http://freemarker.org/docgen" - classpathref="ivy.dep" - /> - - <docgen:transform - srcdir="src/manual/@{locale}" destdir="build/manual/@{locale}" - offline="@{offline}" - /> - </sequential> - </macrodef> - - <target name="manualOffline" depends="init" description="Build the Manual for offline use" > - <u:manual offline="true" locale="en_US" /> - </target> - - <target name="manualFreemarkerOrg" depends="init" description="Build the Manual to be upload to freemarker.org" > - <u:manual offline="false" locale="en_US" /> - </target> - - <target name="manualOffline_zh_CN" depends="init" description="Build the Manual for offline use" > - <u:manual offline="true" locale="zh_CN" /> - </target> - - <target name="manualFreemarkerOrg_zh_CN" depends="init" description="Build the Manual to be upload to freemarker.org"> - <u:manual offline="false" locale="zh_CN" /> - </target> - - - <!-- ====================== --> - <!-- Distributuion building --> - <!-- ====================== --> - - <target name="dist" - description="Build the FreeMarker distribution files" - > - <fail - unless="has.all.explicit.boot.classpaths" - message="All boot.classpath properties must be set in build.properties for dist!" - /> - <fail unless="atLeastJDK8" message="The release should be built with JDK 8+ (you may need to set JAVA_HOME)" /> - <antcall target="clean" /> <!-- To improve the reliability --> - <antcall target="_dist" /> - </target> - - <target name="_dist" - depends="jar, test, javadoc, manualOffline" - > - <delete dir="${dist.dir}" /> - - <!-- ..................................... --> - <!-- Binary distribution --> - <!-- ..................................... --> - - <mkdir dir="${dist.bin.dir}" /> - - <!-- Copy txt-s --> - <copy todir="${dist.bin.dir}" includeEmptyDirs="no"> - <fileset dir="." defaultexcludes="no"> - <include name="README.md" /> - <!-- LICENSE is binary-distribution-specific, and is copied later. --> - <include name="NOTICE" /> - <include name="DISCLAIMER" /> - <include name="RELEASE-NOTES" /> - </fileset> - </copy> - <replace - file="${dist.bin.dir}/README.md" - token="{version}" - value="${version}" - /> - <!-- Copy binary-distribution-specific files: --> - <copy todir="${dist.bin.dir}/"> - <fileset dir="src/dist/bin/" /> - </copy> - - <!-- Copy binary --> - <copy file="build/freemarker.jar" tofile="${dist.bin.dir}/freemarker.jar" /> - - <!-- Copy documentation --> - <mkdir dir="${dist.bin.dir}/documentation" /> - - <!-- - The US English Manual is the source of any translations and thus it's the - only one that is guaranteed to be up to date when doing the release, so we - only pack that into it. - --> - <copy todir="${dist.bin.dir}/documentation/_html" includeEmptyDirs="no"> - <fileset dir="build/manual/en_US" /> - </copy> - <copy todir="${dist.bin.dir}/documentation/_html/api" includeEmptyDirs="no"> - <fileset dir="build/api" /> - </copy> - - <u:packageAndSignDist - srcDir="${dist.bin.dir}/.." - archiveNameWithoutExt="${dist.archiveBaseName}-bin" - /> - - <!-- ..................................... --> - <!-- Source distribution --> - <!-- ..................................... --> - - <mkdir dir="${dist.src.dir}" /> - - <!-- Copy extensionless files: --> - <copy todir="${dist.src.dir}" includeEmptyDirs="no"> - <fileset dir="." defaultexcludes="no"> - <include name="README.md" /> - <include name="LICENSE" /> - <include name="NOTICE" /> - <include name="DISCLAIMER" /> - <include name="RELEASE-NOTES" /> - </fileset> - </copy> - <replace - file="${dist.src.dir}/README.md" - token="{version}" - value="${version}" - /> - - <copy todir="${dist.src.dir}" includeEmptyDirs="no"> - <fileset dir="." defaultexcludes="no"> - <exclude name="**/*.bak" /> - <exclude name="**/*.~*" /> - <exclude name="**/*.*~" /> - <include name="src/**" /> - <include name="*.xml" /> - <include name="*.sample" /> - <include name="*.txt" /> - <include name="osgi.bnd" /> - <include name=".git*" /> - </fileset> - </copy> - - <u:packageAndSignDist - srcDir="${dist.src.dir}/.." - archiveNameWithoutExt="${dist.archiveBaseName}-src" - /> - </target> - - <macrodef name="packageAndSignDist" uri="http://freemarker.org/util"> - <attribute name="srcDir" /> - <attribute name="archiveNameWithoutExt" /> - <sequential> - <local name="archive.tar"/> - <property name="archive.tar" value="build/dist/@{archiveNameWithoutExt}.tar" /> - <local name="archive.gzip"/> - <property name="archive.gzip" value="${archive.tar}.gz" /> - <delete file="${archive.tar}" /> - <tar tarfile="${archive.tar}" basedir="@{srcDir}" /> - <delete file="${archive.gzip}" /> - <gzip zipfile="${archive.gzip}" src="${archive.tar}" /> - <delete file="${archive.tar}" /> - - <echo>Signing "${archive.gzip}"...</echo> - <!-- gpg may hang if it exists: --> - <delete file="${archive.gzip}.asc" /> - <exec executable="${gpgCommand}" failonerror="true"> - <arg value="--armor" /> - <arg value="--output" /> - <arg value="${archive.gzip}.asc" /> - <arg value="--detach-sig" /> - <arg value="${archive.gzip}" /> - </exec> - - <echo>*** Signature verification: ***</echo> - <exec executable="${gpgCommand}" failonerror="true"> - <arg value="--verify" /> - <arg value="${archive.gzip}.asc" /> - <arg value="${archive.gzip}" /> - </exec> - <local name="signatureGood" /> - <local name="signatureGood.y" /> - <input - validargs="y,n" - addproperty="signatureGood" - >Is the above signer the intended one for Apache releases?</input> - <condition property="signatureGood.y"> - <equals arg1="y" arg2="${signatureGood}"/> - </condition> - <fail unless="signatureGood.y" message="Task aborted by user." /> - - <echo>Creating checksum files for "${archive.gzip}"...</echo> - <checksum file="${archive.gzip}" fileext=".md5" algorithm="MD5" forceOverwrite="yes" /> - <checksum file="${archive.gzip}" fileext=".sha512" algorithm="SHA-512" forceOverwrite="yes" /> - </sequential> - </macrodef> - - <target name="maven-pom"> - <echo file="build/pom.xml"><![CDATA[<?xml version="1.0" encoding="utf-8"?> -<!-- - 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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache</groupId> - <artifactId>apache</artifactId> - <version>17</version> - </parent> - - <groupId>${mavenGroupId}</groupId> - <artifactId>${mavenArtifactId}</artifactId> - <version>${mavenVersion}</version> - - <packaging>jar</packaging> - - <name>Apache FreeMarker</name> - <description> - FreeMarker is a "template engine"; a generic tool to generate text output based on templates. - </description> - <url>http://freemarker.org/</url> - <organization> - <name>Apache Software Foundation</name> - <url>http://apache.org</url> - </organization> - - <licenses> - <license> - <name>Apache License, Version 2.0</name> - <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> - <distribution>repo</distribution> - </license> - </licenses> - - <scm> - <connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-freemarker.git</connection> - <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-freemarker.git</developerConnection> - <url>https://git-wip-us.apache.org/repos/asf?p=incubator-freemarker.git</url> - <tag>v${version}</tag> - </scm> - - <issueManagement> - <system>jira</system> - <url>https://issues.apache.org/jira/browse/FREEMARKER/</url> - </issueManagement> - - <mailingLists> - <mailingList> - <name>FreeMarker developer list</name> - <post>[email protected]</post> - <subscribe>[email protected]</subscribe> - <unsubscribe>[email protected]</unsubscribe> - <archive>http://mail-archives.apache.org/mod_mbox/incubator-freemarker-dev/</archive> - </mailingList> - <mailingList> - <name>FreeMarker commit and Jira notifications list</name> - <post>[email protected]</post> - <subscribe>[email protected]</subscribe> - <unsubscribe>[email protected]</unsubscribe> - <archive>http://mail-archives.apache.org/mod_mbox/incubator-freemarker-notifications/</archive> - </mailingList> - <mailingList> - <name>FreeMarker management private</name> - <post>[email protected]</post> - </mailingList> - </mailingLists> - - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.22</version> - </dependency> - </dependencies> -</project> -]]></echo> - </target> - - <!-- - Uploads the freemarker.jar that is in the current DISTRIBUTION DIRECTORY - to a Maven repository (snapshot or central). - Use this after "dist" (without interleaving "clean"). - --> - <target name="maven-dist" depends="maven-pom" - description="Releases the already built distro to a Maven repository"> - <jar destfile="build/maven-source-attachment.jar"> - <fileset dir="${dist.src.dir}/src/main/java" /> - <fileset dir="${dist.src.dir}/src/main/resources" /> - <fileset dir="${dist.src.dir}/src/main/javacc/" /> - <fileset dir="build/generated-sources/java/" includes="**/*.java" /> - <metainf dir="${dist.src.dir}" includes="LICENSE, NOTICE, DISCLAIMER" /> - </jar> - - <mkdir dir="build/javadoc-attachment-metainf"/> - <copy todir="build/javadoc-attachment-metainf"> - <fileset dir="${dist.bin.dir}" includes="DISCLAIMER, NOTICE" /> - </copy> - <copy todir="build/javadoc-attachment-metainf"> - <fileset dir="src/dist/javadoc/META-INF/" /> - </copy> - <jar destfile="build/maven-javadoc-attachment.jar"> - <fileset dir="${dist.bin.dir}/documentation/_html/api" /> - <metainf dir="build/javadoc-attachment-metainf" includes="**/*" /> - </jar> - <delete dir="build/javadoc-attachment-metainf" /> - - <!-- These were copy-pasted from the org.apacha:apache parent POM: --> - <property name="maven-server-id" value="apache.releases.https" /> - <condition property="maven-repository-url" - value="https://repository.apache.org/content/repositories/snapshots/" - else="https://repository.apache.org/service/local/staging/deploy/maven2"> - <matches pattern="-SNAPSHOT$" string="${mavenVersion}" /> - </condition> - <!-- Snapshot repo: https://repository.apache.org/content/repositories/snapshots/ --> - <input - validargs="y,n" - addproperty="mavenUpload.answer" - > -You are about uploading -${dist.bin.dir}/freemarker.jar -and its attachments with Maven coordinates -${mavenGroupId}:${mavenArtifactId}:${mavenVersion} -to this Maven repository: -${maven-repository-url} - -Note that it's assumed that you have run `ant dist` just before this. -Proceed? </input> - <condition property="mavenUpload.yes"> - <equals arg1="y" arg2="${mavenUpload.answer}"/> - </condition> - <fail unless="mavenUpload.yes" message="Task aborted by user." /> - - <!-- Sign and deploy the main artifact --> - <exec executable="${mvnCommand}" failonerror="true"> - <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> - <!-- - As we use the gpg plugin instead of a normal Maven "deploy", sadly we can't just - inherit the repo URL and repositoryId from the parent POM. - --> - <arg value="-Durl=${maven-repository-url}" /> - <arg value="-DrepositoryId=${maven-server-id}" /> - <arg value="-DpomFile=build/pom.xml" /> - <arg value="-Dfile=${dist.bin.dir}/freemarker.jar" /> - <arg value="-Pgpg" /> - </exec> - - <!-- Sign and deploy the sources artifact --> - <exec executable="${mvnCommand}" failonerror="true"> - <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> - <arg value="-Durl=${maven-repository-url}" /> - <arg value="-DrepositoryId=${maven-server-id}" /> - <arg value="-DpomFile=build/pom.xml" /> - <arg value="-Dfile=build/maven-source-attachment.jar" /> - <arg value="-Dclassifier=sources" /> - <arg value="-Pgpg" /> - </exec> - - <!-- Sign and deploy the javadoc artifact --> - <exec executable="${mvnCommand}" failonerror="true"> - <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> - <arg value="-Durl=${maven-repository-url}" /> - <arg value="-DrepositoryId=${maven-server-id}" /> - <arg value="-DpomFile=build/pom.xml" /> - <arg value="-Dfile=build/maven-javadoc-attachment.jar" /> - <arg value="-Dclassifier=javadoc" /> - <arg value="-Pgpg" /> - </exec> - - <echo>*****************************************************************</echo> - <echo>Check the above lines for any Maven errors!</echo> - <echo>Now you need to close and maybe release the staged repo on</echo> - <echo>http://repository.apache.org.</echo> - <echo>Note that before releasing, voting is needed!</echo> - <echo>*****************************************************************</echo> - </target> - - <!-- ================================================================= --> - <!-- CI (like Travis)....................... --> - <!-- ================================================================= --> - - <target name="ci" - depends="clean, update-deps, jar, test, javadoc" - description="CI should invoke this task" - /> - - <!-- ================================================================== --> - <!-- Dependency management (keep it exactly identical for all projects) --> - <!-- ================================================================== --> - - <target name="_autoget-deps" unless="deps.available"> - <antcall target="update-deps" /> - </target> - - <target name="update-deps" - description="Gets the latest version of the dependencies from the Web" - > - <echo>Getting dependencies...</echo> - <echo>-------------------------------------------------------</echo> - <ivy:settings id="remote" url="http://freemarker.org/repos/ivy/ivysettings-remote.xml" /> - <!-- Build an own repository that will serve us even offline: --> - <ivy:retrieve settingsRef="remote" sync="true" - ivypattern=".ivy.part/repo/[organisation]/[module]/ivy-[revision].xml" - pattern=".ivy.part/repo/[organisation]/[module]/[artifact]-[revision].[ext]" - /> - <echo>-------------------------------------------------------</echo> - <echo>*** Successfully acquired dependencies from the Web ***</echo> - <echo>Eclipse users: Now right-click on ivy.xml and Resolve! </echo> - <echo>-------------------------------------------------------</echo> - <!-- Only now that we got all the dependencies will we delete anything. --> - <!-- Thus a net or repo outage doesn't left us without the dependencies. --> - - <!-- Save the resolution cache from the soon coming <delete>: --> - <move todir=".ivy.part/update-deps-reso-cache"> - <fileset dir=".ivy/update-deps-reso-cache" /> - </move> - <!-- Drop all the old stuff: --> - <delete dir=".ivy" /> - <!-- And use the new stuff instead: --> - <move todir=".ivy"> - <fileset dir=".ivy.part" /> - </move> - </target> - - <!-- Do NOT call this from 'clean'; offline guys would stuck after that. --> - <target name="clean-deps" - description="Deletes all dependencies" - > - <delete dir=".ivy" /> - </target> - - <target name="publish-override" depends="jar" - description="Ivy-publishes THIS project locally as an override" - > - <ivy:resolve /> - <ivy:publish - pubrevision="${moduleBranch}-branch-head" - artifactspattern="build/[artifact].[ext]" - overwrite="true" forcedeliver="true" - resolver="freemarker-devel-local-override" - > - <artifact name="freemarker" type="jar" ext="jar" /> - </ivy:publish> - <delete file="build/ivy.xml" /> <!-- ivy:publish makes this --> - <echo>-------------------------------------------------------</echo> - <echo>*** Don't forget to `ant unpublish-override` later! ***</echo> - </target> - - <target name="unpublish-override" - description="Undoes publish-override (made in THIS project)" - > - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override/${moduleOrg}/${moduleName}" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache/${moduleOrg}/${moduleName}" /> - </target> - - <target name="unpublish-override-all" - description="Undoes publish-override-s made in ALL projects" - > - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache" /> - </target> - - <target name="uninstall" - description="Deletes external files created by FreeMarker developement" - > - <delete dir="${user.home}/.ivy2/freemarker-devel-cache" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override" /> - <delete dir="${user.home}/.ivy2/freemarker-devel-local-override-cache " /> - </target> - - <target name="report-deps" - description="Creates a HTML document that summarizes the dependencies." - > - <mkdir dir="build/deps-report" /> - <ivy:resolve /> - <ivy:report todir="build/deps-report" /> - </target> - - <target name="report-ide-deps" - description="Creates a HTML document that summarizes the dependencies." - > - <mkdir dir="build/ide-deps-report" /> - <ivy:resolve conf="IDE" /> - <ivy:report todir="build/ide-deps-report" /> - </target> - - <target name="ide-dependencies" depends="jar" - description="If your IDE has no Ivy support, this generates ide-lib/*.jar for it"> - <mkdir dir="ide-dependencies" /> - <delete includeEmptyDirs="true"> - <fileset dir="ide-dependencies"> - <include name="*/**" /> - </fileset> - </delete> - <ivy:retrieve conf="IDE" pattern="ide-dependencies/[artifact]-[revision].[ext]" /> - - <!-- - Extract META-INF/MANITSET.MF from freemarker.jar and put it into the project directory for Eclipse (this is - needed if you want to reference freemarker source code in the context of OSGI development with Eclipse) - --> - <unzip src="build/freemarker.jar" dest="."> - <patternset> - <include name="META-INF/*"/> - <exclude name="META-INF/LICENSE"/> - <exclude name="META-INF/DISCLAIMER"/> - <exclude name="META-INF/NOTICE"/> - </patternset> - </unzip> - <echo file="META-INF/DO-NOT-EDIT.txt"><!-- - -->Do not edit the files in this directory! They are extracted from freemarker.jar as part of
<!-- - -->the ide-dependencies Ant task, because Eclipse OSGi support expects them to be here.<!-- - --></echo> - </target> - - <!-- - This meant to be called on the Continuous Integration server, so the - integration builds appear in the freemarker.org public Ivy repository. - The artifacts must be already built. - --> - <target name="server-publish-last-build" - description="(For the Continuous Integration server only)" - > - <delete dir="build/dummy-server-ivy-repo" /> - <ivy:resolve /> - <ivy:publish - pubrevision="${moduleBranch}-branch-head" - artifactspattern="build/[artifact].[ext]" - overwrite="true" forcedeliver="true" - resolver="server-publishing-target" - > - <artifact name="freemarker" type="jar" ext="jar" /> - </ivy:publish> - <delete file="build/ivy.xml" /> <!-- ivy:publish makes this --> - </target> - - <target name="rat" description="Generates Apache RAT report"> - <ivy:cachepath conf="rat" pathid="ivy.dep" /> - <taskdef - uri="antlib:org.apache.rat.anttasks" - resource="org/apache/rat/anttasks/antlib.xml" - classpathref="ivy.dep" - /> - - <rat:report reportFile="build/rat-report-src.txt"> - <fileset dir="src"/> - </rat:report> - <rat:report reportFile="build/rat-report-dist-src.txt"> - <fileset dir="build/dist/src"/> - </rat:report> - <rat:report reportFile="build/rat-report-dist-bin.txt"> - <fileset dir="build/dist/bin"/> - </rat:report> - <echo level="info"><!-- - -->Rat reports were written into build/rat-report-*.txt<!-- - --></echo> - </target> - - <target name="archive" depends="" - description='Archives project with Git repo into the "archive" directory.' - > - <mkdir dir="archive" /> - <tstamp> - <format property="tstamp" pattern="yyyyMMdd-HHmm" /> - </tstamp> - <delete file="archive/freemarker-git-${tstamp}.tar" /> - <delete file="archive/freemarker-git-${tstamp}.tar.bz2" /> - <tar tarfile="archive/freemarker-git-${tstamp}.tar" - basedir="." - longfile="gnu" - excludes="build/** .build/** .bin/** .ivy/** archive/**" - /> - <bzip2 src="archive/freemarker-git-${tstamp}.tar" - zipfile="archive/freemarker-git-${tstamp}.tar.bz2" /> - <delete file="archive/freemarker-git-${tstamp}.tar" /> - </target> - -</project> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/freemarker-core-java8-test/build.gradle ---------------------------------------------------------------------- diff --git a/freemarker-core-java8-test/build.gradle b/freemarker-core-java8-test/build.gradle new file mode 100644 index 0000000..ad08d33 --- /dev/null +++ b/freemarker-core-java8-test/build.gradle @@ -0,0 +1,19 @@ +// Override inherited default Java version: +sourceCompatibility = "1.8" +targetCompatibility = "1.8" +[compileJava, compileTestJava]*.options*.bootClasspath = bootClasspathJava8 + +dependencies { + compile project(":freemarker-core") +} + +// We have nothing to put into the jar, as we have test classes only +jar.enabled = false + +javadoc.enabled = false + +// Must not be deployed to a public Maven repository +uploadArchives.enabled = false + +// Doesn't make sense to Maven "install" this, as the artifact won't contain test classes +install.enabled = false http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/freemarker-core-java8-test/src/main/resources/META-INF/DISCLAIMER ---------------------------------------------------------------------- diff --git a/freemarker-core-java8-test/src/main/resources/META-INF/DISCLAIMER b/freemarker-core-java8-test/src/main/resources/META-INF/DISCLAIMER new file mode 100644 index 0000000..569ba05 --- /dev/null +++ b/freemarker-core-java8-test/src/main/resources/META-INF/DISCLAIMER @@ -0,0 +1,8 @@ +Apache FreeMarker is an effort undergoing incubation at The Apache Software +Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of +all newly accepted projects until a further review indicates that the +infrastructure, communications, and decision making process have stabilized in +a manner consistent with other successful ASF projects. While incubation +status is not necessarily a reflection of the completeness or stability of the +code, it does indicate that the project has yet to be fully endorsed by the +ASF. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/freemarker-core-java8-test/src/main/resources/META-INF/LICENSE ---------------------------------------------------------------------- diff --git a/freemarker-core-java8-test/src/main/resources/META-INF/LICENSE b/freemarker-core-java8-test/src/main/resources/META-INF/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/freemarker-core-java8-test/src/main/resources/META-INF/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBean.java ---------------------------------------------------------------------- diff --git a/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBean.java b/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBean.java new file mode 100644 index 0000000..2c9d4e9 --- /dev/null +++ b/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBean.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.core.model.impl; + +public class BridgeMethodsBean extends BridgeMethodsBeanBase<String> { + + static final String M1_RETURN_VALUE = "m1ReturnValue"; + + @Override + public String m1() { + return M1_RETURN_VALUE; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3fd56062/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBeanBase.java ---------------------------------------------------------------------- diff --git a/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBeanBase.java b/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBeanBase.java new file mode 100644 index 0000000..4ecec7c --- /dev/null +++ b/freemarker-core-java8-test/src/test/java/org/apache/freemarker/core/model/impl/BridgeMethodsBeanBase.java @@ -0,0 +1,29 @@ +/* + * 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.core.model.impl; + +public abstract class BridgeMethodsBeanBase<T> { + + public abstract T m1(); + + public T m2() { + return null; + } + +}
