@@ -185,34 +185,28 @@ public Autobuilder(IBuildActions actions, AutobuildOptions options)
185
185
} ) ;
186
186
187
187
CodeQLExtractorCSharpRoot = Actions . GetEnvironmentVariable ( "CODEQL_EXTRACTOR_CSHARP_ROOT" ) ;
188
-
189
188
SemmleDist = Actions . GetEnvironmentVariable ( "SEMMLE_DIST" ) ;
190
-
191
- CodeQLJavaHome = Actions . GetEnvironmentVariable ( "CODEQL_JAVA_HOME" ) ;
192
-
193
- SemmleJavaHome = Actions . GetEnvironmentVariable ( "SEMMLE_JAVA_HOME" ) ;
194
-
195
- if ( CodeQLJavaHome is null && SemmleJavaHome is null )
196
- throw new InvalidEnvironmentException ( "The environment variables CODEQL_JAVA_HOME and SEMMLE_JAVA_HOME have not been set." ) ;
197
-
198
189
SemmlePlatformTools = Actions . GetEnvironmentVariable ( "SEMMLE_PLATFORM_TOOLS" ) ;
199
190
200
- if ( CodeQLExtractorCSharpRoot is null && SemmleDist is null )
201
- throw new InvalidEnvironmentException ( "The environment variables CODEQL_EXTRACTOR_CSHARP_ROOT and SEMMLE_DIST have not been set." ) ;
202
-
203
- var trapDir = Actions . GetEnvironmentVariable ( "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ) ?? Actions . GetEnvironmentVariable ( "TRAP_FOLDER" ) ;
204
-
205
- if ( trapDir is null )
206
- throw new InvalidEnvironmentException ( "The environment variables CODEQL_EXTRACTOR_CSHARP_TRAP_DIR and TRAP_FOLDER have not been set." ) ;
207
-
208
- TrapDir = trapDir ;
209
-
210
- var sourceArchiveDir = Actions . GetEnvironmentVariable ( "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ) ?? Actions . GetEnvironmentVariable ( "SOURCE_ARCHIVE" ) ;
211
-
212
- if ( sourceArchiveDir is null )
213
- throw new InvalidEnvironmentException ( "The environment variables CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR and SOURCE_ARCHIVE have not been set." ) ;
214
-
215
- SourceArchiveDir = sourceArchiveDir ;
191
+ JavaHome =
192
+ Actions . GetEnvironmentVariable ( "CODEQL_JAVA_HOME" ) ??
193
+ Actions . GetEnvironmentVariable ( "SEMMLE_JAVA_HOME" ) ??
194
+ throw new InvalidEnvironmentException ( "The environment variable CODEQL_JAVA_HOME or SEMMLE_JAVA_HOME has not been set." ) ;
195
+
196
+ Distribution =
197
+ CodeQLExtractorCSharpRoot ??
198
+ SemmleDist ??
199
+ throw new InvalidEnvironmentException ( "The environment variable CODEQL_EXTRACTOR_CSHARP_ROOT or SEMMLE_DIST has not been set." ) ;
200
+
201
+ TrapDir =
202
+ Actions . GetEnvironmentVariable ( "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ) ??
203
+ Actions . GetEnvironmentVariable ( "TRAP_FOLDER" ) ??
204
+ throw new InvalidEnvironmentException ( "The environment variable CODEQL_EXTRACTOR_CSHARP_TRAP_DIR or TRAP_FOLDER has not been set." ) ;
205
+
206
+ SourceArchiveDir =
207
+ Actions . GetEnvironmentVariable ( "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ) ??
208
+ Actions . GetEnvironmentVariable ( "SOURCE_ARCHIVE" ) ??
209
+ throw new InvalidEnvironmentException ( "The environment variable CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR or SOURCE_ARCHIVE has not been set." ) ;
216
210
}
217
211
218
212
private string TrapDir { get ; }
@@ -407,29 +401,19 @@ BuildScript AutobuildFailure() =>
407
401
/// </summary>
408
402
private string ? CodeQLExtractorCSharpRoot { get ; }
409
403
410
- /// <summary>
411
- /// Value of CODEQL_JAVA_HOME environment variable.
412
- /// </summary>
413
- private string ? CodeQLJavaHome { get ; }
414
-
415
404
/// <summary>
416
405
/// Value of SEMMLE_DIST environment variable.
417
406
/// </summary>
418
407
private string ? SemmleDist { get ; }
419
408
420
- public string Distribution => CodeQLExtractorCSharpRoot ?? SemmleDist ! ;
421
-
422
- public string JavaHome => CodeQLJavaHome ?? SemmleJavaHome ! ;
409
+ public string Distribution { get ; }
423
410
424
- /// <summary>
425
- /// Value of SEMMLE_JAVA_HOME environment variable.
426
- /// </summary>
427
- public string ? SemmleJavaHome { get ; private set ; }
411
+ public string JavaHome { get ; }
428
412
429
413
/// <summary>
430
414
/// Value of SEMMLE_PLATFORM_TOOLS environment variable.
431
415
/// </summary>
432
- public string ? SemmlePlatformTools { get ; private set ; }
416
+ public string ? SemmlePlatformTools { get ; }
433
417
434
418
/// <summary>
435
419
/// The absolute path of the odasa executable.
0 commit comments