Skip to content

Commit a980a50

Browse files
committed
java 8 + nashorn
- remove rhino - set code base 1.8 - fix #626 #625 #529
1 parent 7e69449 commit a980a50

File tree

38 files changed

+542
-1106
lines changed

38 files changed

+542
-1106
lines changed

handlebars-jdk8-tests/pom.xml

Lines changed: 0 additions & 48 deletions
This file was deleted.

handlebars-jdk8-tests/src/test/java/com/github/jknack/handlebars/TypeSafeTemplateDefaultMethodTest.java

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hello=Hello!
1+
hello=Hello!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hello=Hola!
1+
hello=Hola!

handlebars-maven-plugin/pom.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>org.apache.maven</groupId>
4040
<artifactId>maven-plugin-api</artifactId>
41-
<version>3.0.4</version>
41+
<version>3.5.3</version>
4242
</dependency>
4343

4444
<dependency>
@@ -50,13 +50,13 @@
5050
<dependency>
5151
<groupId>org.apache.maven</groupId>
5252
<artifactId>maven-core</artifactId>
53-
<version>3.1.0</version>
53+
<version>3.5.3</version>
5454
</dependency>
5555

5656
<dependency>
5757
<groupId>org.apache.maven.plugin-tools</groupId>
5858
<artifactId>maven-plugin-annotations</artifactId>
59-
<version>3.2</version>
59+
<version>3.5.2</version>
6060
<scope>provided</scope>
6161
</dependency>
6262

@@ -69,9 +69,16 @@
6969
<dependency>
7070
<groupId>com.google.javascript</groupId>
7171
<artifactId>closure-compiler</artifactId>
72-
<version>v20130603</version>
72+
<version>v20180506</version>
7373
</dependency>
7474

75+
<dependency>
76+
<groupId>com.google.guava</groupId>
77+
<artifactId>guava</artifactId>
78+
<version>21.0</version>
79+
</dependency>
80+
81+
7582
<!-- Test dependencies -->
7683
<dependency>
7784
<groupId>junit</groupId>
@@ -91,7 +98,7 @@
9198
<plugin>
9299
<groupId>org.apache.maven.plugins</groupId>
93100
<artifactId>maven-plugin-plugin</artifactId>
94-
<version>3.2</version>
101+
<version>3.5.2</version>
95102
<configuration>
96103
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
97104
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>

handlebars-maven-plugin/src/main/java/com/github/jknack/handlebars/maven/HandlebarsPlugin.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ public void setProject(final MavenProject project) {
6666
public final void execute() throws MojoExecutionException, MojoFailureException {
6767
try {
6868
doExecute();
69-
} catch (MojoExecutionException ex) {
70-
throw ex;
71-
} catch (MojoFailureException ex) {
69+
} catch (MojoExecutionException | MojoFailureException ex) {
7270
throw ex;
7371
} catch (RuntimeException ex) {
7472
throw new MojoExecutionException(ex.getMessage(), ex);

handlebars-maven-plugin/src/main/java/com/github/jknack/handlebars/maven/I18nJsPlugin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.io.File;
3838
import java.net.URL;
3939
import java.net.URLClassLoader;
40+
import java.nio.charset.Charset;
4041
import java.util.ArrayList;
4142
import java.util.HashMap;
4243
import java.util.LinkedHashSet;
@@ -110,6 +111,7 @@ protected void doExecute() throws Exception {
110111
notNull(output, "The output parameter is required.");
111112

112113
Handlebars handlebars = new Handlebars();
114+
handlebars.setCharset(Charset.forName(encoding));
113115
Context context = Context.newContext(null);
114116
URL[] classpath = projectClasspath();
115117

handlebars-maven-plugin/src/main/java/com/github/jknack/handlebars/maven/PrecompilePlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import java.io.InputStream;
4141
import java.io.PrintWriter;
4242
import java.net.URL;
43+
import java.nio.charset.Charset;
4344
import java.util.ArrayList;
4445
import java.util.Arrays;
4546
import java.util.Collections;
@@ -155,6 +156,7 @@ protected void doExecute() throws Exception {
155156

156157
Handlebars handlebars = new Handlebars(new FileTemplateLoader(basedir, suffix));
157158
handlebars.handlebarsJsFile(handlebarsJsFile);
159+
handlebars.setCharset(Charset.forName(encoding));
158160

159161
final List<CharSequence> extras = new ArrayList<CharSequence>();
160162

@@ -354,7 +356,7 @@ private CharSequence registerHelper(final String name, final String body, final
354356
private void minimize(final File output) throws IOException, MojoFailureException {
355357
final CompilerOptions options = new CompilerOptions();
356358
options.setCodingConvention(new ClosureCodingConvention());
357-
options.setOutputCharset("UTF-8");
359+
options.setOutputCharset(Charset.forName(encoding));
358360
options.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);
359361
CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
360362

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=${project.version}
1+
version=${project.version}

handlebars-springmvc/src/main/java/com/github/jknack/handlebars/springmvc/HandlebarsViewResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ public HandlebarsViewResolver registerHelpers(final String filename, final Input
529529

530530
@Override
531531
public HandlebarsViewResolver registerHelpers(final String filename, final String source)
532-
throws Exception {
532+
throws IOException {
533533
registry.registerHelpers(filename, source);
534534
return this;
535535
}

0 commit comments

Comments
 (0)