@@ -136,9 +136,23 @@ private String getScheme() {
136
136
private void configureGeneratorProperties () {
137
137
// allows generating only models by specifying a CSV of models to generate, or empty for all
138
138
// NOTE: Boolean.TRUE is required below rather than `true` because of JVM boxing constraints and type inference.
139
- generateApis = System .getProperty (CodegenConstants .APIS ) != null ? Boolean .TRUE : getGeneratorPropertyDefaultSwitch (CodegenConstants .APIS , null );
140
- generateModels = System .getProperty (CodegenConstants .MODELS ) != null ? Boolean .TRUE : getGeneratorPropertyDefaultSwitch (CodegenConstants .MODELS , null );
141
- generateSupportingFiles = System .getProperty (CodegenConstants .SUPPORTING_FILES ) != null ? Boolean .TRUE : getGeneratorPropertyDefaultSwitch (CodegenConstants .SUPPORTING_FILES , null );
139
+
140
+ if (System .getProperty (CodegenConstants .GENERATE_APIS ) != null ) {
141
+ generateApis = Boolean .valueOf (System .getProperty (CodegenConstants .GENERATE_APIS ));
142
+ } else {
143
+ generateApis = System .getProperty (CodegenConstants .APIS ) != null ? Boolean .TRUE : getGeneratorPropertyDefaultSwitch (CodegenConstants .APIS , null );
144
+ }
145
+ if (System .getProperty (CodegenConstants .GENERATE_MODELS ) != null ) {
146
+ generateModels = Boolean .valueOf (System .getProperty (CodegenConstants .GENERATE_MODELS ));
147
+ } else {
148
+ generateModels = System .getProperty (CodegenConstants .MODELS ) != null ? Boolean .TRUE : getGeneratorPropertyDefaultSwitch (CodegenConstants .MODELS , null );
149
+ }
150
+ String supportingFilesProperty = System .getProperty (CodegenConstants .SUPPORTING_FILES );
151
+ if (((supportingFilesProperty != null ) && supportingFilesProperty .equalsIgnoreCase ("false" ))) {
152
+ generateSupportingFiles = false ;
153
+ } else {
154
+ generateSupportingFiles = supportingFilesProperty != null ? Boolean .TRUE : getGeneratorPropertyDefaultSwitch (CodegenConstants .SUPPORTING_FILES , null );
155
+ }
142
156
143
157
if (generateApis == null && generateModels == null && generateSupportingFiles == null ) {
144
158
// no specifics are set, generate everything
@@ -568,7 +582,10 @@ private void generateSupportingFiles(List<File> files, Map<String, Object> bundl
568
582
}
569
583
Set <String > supportingFilesToGenerate = null ;
570
584
String supportingFiles = System .getProperty (CodegenConstants .SUPPORTING_FILES );
571
- if (supportingFiles != null && !supportingFiles .isEmpty ()) {
585
+ boolean generateAll = false ;
586
+ if (supportingFiles != null && supportingFiles .equalsIgnoreCase ("true" )) {
587
+ generateAll = true ;
588
+ } else if (supportingFiles != null && !supportingFiles .isEmpty ()) {
572
589
supportingFilesToGenerate = new HashSet <>(Arrays .asList (supportingFiles .split ("," )));
573
590
}
574
591
@@ -595,7 +612,7 @@ private void generateSupportingFiles(List<File> files, Map<String, Object> bundl
595
612
}
596
613
597
614
boolean shouldGenerate = true ;
598
- if (supportingFilesToGenerate != null && !supportingFilesToGenerate .isEmpty ()) {
615
+ if (! generateAll && supportingFilesToGenerate != null && !supportingFilesToGenerate .isEmpty ()) {
599
616
shouldGenerate = supportingFilesToGenerate .contains (support .destinationFilename );
600
617
}
601
618
if (!shouldGenerate ){
0 commit comments