@@ -42,6 +42,11 @@ bool CsharpParser::parse()
4242 bool success = true ;
4343
4444 std::vector<std::string> paths = _ctx.options [" input" ].as <std::vector<std::string>>();
45+ if (paths.empty ())
46+ {
47+ LOG (error) << " No input path specified for C# parser!" ;
48+ return false ;
49+ }
4550 std::string buildPath = _ctx.options [" build-dir" ].as <std::string>();
4651
4752 if (acceptProjectBuildPath (buildPath))
@@ -86,14 +91,11 @@ bool CsharpParser::parseProjectBuildPath(
8691 command.append (" ' " );
8792 command.append (std::to_string (_ctx.options [" jobs" ].as <int >()));
8893
89- for (auto p : paths_)
94+ for (const auto & inputPath : paths_)
9095 {
91- if (fs::is_directory (p))
92- {
93- command.append (" '" );
94- command.append (p);
95- command.append (" ' " );
96- }
96+ command.append (" '" );
97+ command.append (inputPath);
98+ command.append (" '" );
9799 }
98100
99101 LOG (debug) << " CSharpParser command: " << command;
@@ -113,7 +115,7 @@ bool CsharpParser::parseProjectBuildPath(
113115
114116 while (std::getline (log_str, line, ' \n ' ))
115117 {
116- if (line[0 ] == ' +' || line[0 ] == ' -' )
118+ if (! line. empty () && (line [0 ] == ' +' || line[0 ] == ' -' ) )
117119 {
118120 addSource (line.substr (1 ), line[0 ] == ' -' );
119121 if (line[0 ] == ' +' )
@@ -125,6 +127,10 @@ bool CsharpParser::parseProjectBuildPath(
125127 countPart++;
126128 }
127129 }
130+ else if (!line.empty ())
131+ {
132+ LOG (debug) << " [CSharpParser] " << line;
133+ }
128134 }
129135
130136 ch::steady_clock::time_point after = ch::steady_clock::now ();
0 commit comments