Skip to content
New issue

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

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

Already on GitHub? # to your account

ref #9540 - fix regression in generate options #9550

Merged
merged 1 commit into from
Jul 8, 2019
Merged
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 @@ -135,7 +135,12 @@ protected void configureGeneratorProperties() {
} else {
isGenerateModels = System.getProperty(CodegenConstants.MODELS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODELS, null);
}
isGenerateSupportingFiles = System.getProperty(CodegenConstants.SUPPORTING_FILES) != null ? Boolean.valueOf(System.getProperty(CodegenConstants.SUPPORTING_FILES)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.SUPPORTING_FILES, null);
String supportingFilesProperty = System.getProperty(CodegenConstants.SUPPORTING_FILES);
if (((supportingFilesProperty != null) && supportingFilesProperty.equalsIgnoreCase("false"))) {
isGenerateSupportingFiles = false;
} else {
isGenerateSupportingFiles = supportingFilesProperty != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.SUPPORTING_FILES, null);
}

if (isGenerateApis == null && isGenerateModels == null && isGenerateSupportingFiles == null) {
// no specifics are set, generate everything
Expand Down Expand Up @@ -568,7 +573,10 @@ protected void generateSupportingFiles(List<File> files, Map<String, Object> bun
}
Set<String> supportingFilesToGenerate = null;
String supportingFiles = System.getProperty(CodegenConstants.SUPPORTING_FILES);
if (supportingFiles != null && !supportingFiles.isEmpty()) {
boolean generateAll = false;
if (supportingFiles != null && supportingFiles.equalsIgnoreCase("true")) {
generateAll = true;
} else if (supportingFiles != null && !supportingFiles.isEmpty()) {
supportingFilesToGenerate = new HashSet<String>(Arrays.asList(supportingFiles.split(",")));
}

Expand All @@ -594,7 +602,7 @@ protected void generateSupportingFiles(List<File> files, Map<String, Object> bun
templateFile = getFullTemplateFile(config, support.templateFile);
}
boolean shouldGenerate = true;
if (supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) {
if (!generateAll && supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) {
shouldGenerate = supportingFilesToGenerate.contains(support.destinationFilename);
}
if (!shouldGenerate) {
Expand Down