Skip to content

Option to overwrite only changed files#2451

Merged
wing328 merged 21 commits intoOpenAPITools:masterfrom
wheezil:1391-jel
Mar 20, 2019
Merged

Option to overwrite only changed files#2451
wing328 merged 21 commits intoOpenAPITools:masterfrom
wheezil:1391-jel

Conversation

@wheezil
Copy link
Copy Markdown
Contributor

@wheezil wheezil commented Mar 19, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • [NA] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Add option --minimal-overwrite which will cause output files to be written to a temp file, compared to any existing file, and if different renamed. On build systems (such as MSBuild) that was weak dependency rules, this can help to prevent triggering of massive recompile on every build.

This resolves conflicts with changes from other authors in which new File() was replaced by Paths.get(), I kept the Paths.get() updates where applicable.

Related PRs: #1397, #1391

john lilley and others added 20 commits October 25, 2018 09:27
Bring my fork up to date with base
* Add blank comment lines to satisfy PR feedback

* Remove tabs
# Conflicts:
#	modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/AbstractGenerator.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java
#	modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java
@wing328
Copy link
Copy Markdown
Member

wing328 commented Mar 20, 2019

cc @OpenAPITools/generator-core-team

@wing328 wing328 changed the title 1391 jel minimal overwrite option Option to overwrite only changed files Mar 20, 2019
@wing328 wing328 added this to the 4.0.0 milestone Mar 20, 2019
@wing328 wing328 merged commit dc78405 into OpenAPITools:master Mar 20, 2019
@wing328
Copy link
Copy Markdown
Member

wing328 commented Mar 20, 2019

@wheezil thanks for the contribution. Can you please also add this option to the maven plugin and gradle plugin?

@wheezil
Copy link
Copy Markdown
Contributor Author

wheezil commented Mar 20, 2019

W00T! My second PR :-)
@wing328 is there some RTFM for these plugins? I've never touched them. As in... someone who's already touched these things and knows what to do?

@wing328
Copy link
Copy Markdown
Member

wing328 commented Mar 20, 2019

It's not difficult. Just search for another option "generateAliasAsModel" in the plugins and you will know where to add the code for your new option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants