Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mapper provider imports when there are no mappers; Update gwt-jackson. #393

Merged
merged 3 commits into from
Jan 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ protected TypeOracle getTypeOracle() {
return typeOracle;
}

protected void mergeTemplate(PrintWriter printWriter, String velocityTemplate, String implName) throws Exception {
protected void mergeTemplate(PrintWriter printWriter, String velocityTemplate, String implName)
throws UnableToCompleteException {
VelocityContext velocityContext = velocityContextProvider.get();
velocityContext.put("lf", "\n");
velocityContext.put("implName", implName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ public void generate() throws UnableToCompleteException {
String implName = JacksonMapperProvider.class.getSimpleName() + SUFFIX;
PrintWriter printWriter = getGeneratorUtil().tryCreatePrintWriter(getPackage(), implName);
if (printWriter != null) {
try {
mergeTemplate(printWriter, TEMPLATE, implName);
} catch (Exception e) {
getLogger().die(e.getMessage());
}
mergeTemplate(printWriter, TEMPLATE, implName);
} else {
getLogger().debug("Jackson Mapper Provider already generated. Returning.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import javax.inject.Inject;
import javax.inject.Provider;

import com.google.inject.TypeLiteral;
#if (!$types.isEmpty())
import com.gwtplatform.dispatch.rest.client.serialization.mappers.*;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there are no mappers generated, this package doesn't exist, so it fails to compile.

#end

public class $implName extends AbstractJacksonMapperProvider {
#set ($entries = $types.entrySet())
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
<gwt.version>2.5.1</gwt.version>
<gin.version>2.0.0</gin.version>
<gwtquery.version>1.3.2</gwtquery.version>
<gwt-jackson.version>0.2.0</gwt-jackson.version>
<gwt-jackson.version>0.3.0</gwt-jackson.version>

<!-- Server -->
<jax-rs.version>1.1.1</jax-rs.version>
Expand Down