@@ -82,9 +82,12 @@ def run_di_model_generation(configuration, cmdline):
82
82
will drive generation.
83
83
"""
84
84
85
+ if not cmdline .di_generation :
86
+ print ("DI generation disabled. Skipping." , file = sys .stderr )
87
+ return None
88
+
85
89
# If we don't have anything vaguely looking like a spring library being used, just skip generation.
86
- if not next ((lib for lib in cmdline .libraries if re .search ("spring-[a-zA-Z]*-[0-9]*\.[0-9]*" , lib )), None ) \
87
- or cmdline .skip_di_generation :
90
+ if not any ((re .search ("spring-[a-zA-Z]*-[0-9]*\.[0-9]*" , lib ) for lib in cmdline .libraries )):
88
91
print ("No Spring Framework libraries passed in, cannot generate any DI-related code." , file = sys .stderr )
89
92
return None
90
93
@@ -114,9 +117,7 @@ def run_di_model_generation(configuration, cmdline):
114
117
if additional_spring_files :
115
118
di_generation_commandline .extend (["--input-file" ] + additional_spring_files )
116
119
117
- di_generation_result = utility .call (di_generation_commandline , "DI model generator" , cmdline .verbosity , stderr = subprocess .STDOUT )
118
- if di_generation_result != 0 :
119
- return None
120
+ utility .check_call (di_generation_commandline , "DI model generator" , cmdline .verbosity , stderr = subprocess .STDOUT )
120
121
121
122
# Quick check to see if we have any output files.
122
123
if not next ((file for root , dirs , files in os .walk (generated_source_file_path ) for file in files ), None ):
@@ -159,10 +160,7 @@ def run_di_model_generation(configuration, cmdline):
159
160
with open (ant_build_path , 'x' ) as ant_xml_file :
160
161
ant_xml_file .write (ant_build_statement )
161
162
162
- javac_result = utility .call (["ant" , "-file" , ant_build_path ], "Java Compiler for DI model overlays" , cmdline .verbosity , stderr = subprocess .STDOUT )
163
- if javac_result != 0 :
164
- print ("Java compilation of DI-generated source failed." )
165
- return None
163
+ utility .check_call (["ant" , "-file" , ant_build_path ], "Java Compiler for DI model overlays" , cmdline .verbosity , stderr = subprocess .STDOUT )
166
164
167
165
return generated_jar_path
168
166
0 commit comments