-
Notifications
You must be signed in to change notification settings - Fork 21
Description
The current sbt-boilerplate skips the code generation if it thinks that the step can be skipped.
The problem is that the file dates may not be trustworthy. The ASF requires that we support source releases (basically a tarball) and release reproducibility is sending us down the route where the files are added to the tarball with 1970-01-01 file dates. This confuses the sbt-boilerplate check and the code generation is skipped.
| mapping foreach { | |
| case (templateFile, target) => | |
| if (templateFile.lastModified > target.lastModified) { | |
| streams.log.info("Generating '%s'" format target.getName) | |
| val template = IO.read(templateFile) | |
| IO.write(target, | |
| signature + Generator.generateFromTemplate(template, 22)) | |
| } else | |
| streams.log.debug("Template '%s' older than target. Ignoring." format templateFile.getName) | |
| } |
Would it be possible to consider supporting some mechanism for optionally forcing the code gen and skipping the modified time checks? A System property perhaps.
Or changing the check to see if the target file even existed - in my testing, the generated files don't exist so skipping the creation because somehow we think that we don't need to generate them means that we get no file generated at all.