-
Notifications
You must be signed in to change notification settings - Fork 2
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 incremental build Java generation. #16
Conversation
@Test | ||
void convertsToJava() throws IOException { | ||
var dir = new File("examples/java"); | ||
// N.B. Theis path is set in DafnyPlugin.java, then Dafny adds "-java" suffix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// N.B. Theis path is set in DafnyPlugin.java, then Dafny adds "-java" suffix | |
// N.B. This path is set in DafnyPlugin.java, then Dafny adds "-java" suffix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a couple of nits
examples/java/src/main/dafny/Foo.dfy
Outdated
@@ -0,0 +1,5 @@ | |||
module Foo { | |||
datatype Bar = create(baz: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datatype Bar = create(baz: string) { | |
datatype Bar = Create(baz: string) { |
nit: Dafny style guide says to use PascalCase for Datatype
Translate task is requested to put generated source into a target directory "main", however dafny actually places it into a directory callled "main-java" and the translate task performs a rename at the end to compensate. The problem is this rename can fail, for example on an incremental build, when the target directory already exists. Instead keep "main-java" as target and pass this modified target onto subsequent gradle tasks as new source to be compiled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Translate task is requested to put generated source into a target directory "main", however dafny actually places it into a directory callled "main-java" and the translate task performs a rename at the end to compensate. The problem is this rename can fail, for example on an incremental build, when the target directory already exists.
Instead keep "main-java" as target and pass this modified target onto subsequent gradle tasks as new source to be compiled.