You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description ="File with analysis configuration in JSON format"
209
-
).required()
210
-
val cacheDirPath by parser.option(
211
-
ArgType.String,
212
-
fullName ="cachedir",
213
-
shortName ="c",
214
-
description ="Directory with caches for analysis. All parent directories will be created if not exists. Directory will be created if not exists. Directory must be empty."
215
-
).required()
216
-
val startClasses by parser.option(
217
-
ArgType.String,
218
-
fullName ="start",
219
-
shortName ="s",
220
-
description ="classes from which to start the analysis"
221
-
).required()
222
-
val outputPath by parser.option(
223
-
ArgType.String,
224
-
fullName ="output",
225
-
shortName ="o",
226
-
description ="File where analysis report will be written. All parent directories will be created if not exists. File will be created if not exists. Existing file will be overwritten."
227
-
).default("report.txt") // TODO: create SARIF here
228
-
val graphFactory by parser.option(
229
-
factoryChoice<GraphFactory>(),
230
-
fullName ="graph-type",
231
-
shortName ="g",
232
-
description ="Type of code graph to be used by analysis."
233
-
).default(JcSimplifiedGraphFactory())
234
-
val points2Factory by parser.option(
235
-
factoryChoice<Points2EngineFactory>(),
236
-
fullName ="points2",
237
-
shortName ="p2",
238
-
description ="Type of points-to engine."
239
-
).default(JcNaivePoints2EngineFactory())
240
-
val classpath by parser.option(
241
-
ArgType.String,
242
-
fullName ="classpath",
243
-
shortName ="cp",
244
-
description ="Classpath for analysis. Used by JacoDB."
245
-
).default(System.getProperty("java.class.path"))
246
-
247
-
parser.parse(args)
248
-
249
-
val outputFile =File(outputPath)
250
-
251
-
if (outputFile.exists() && outputFile.isDirectory) {
252
-
throwIllegalArgumentException("Provided path for output file is directory, please provide correct path")
253
-
} elseif (outputFile.exists()) {
254
-
logger.info { "Output file $outputFile already exists, results will be overwritten" }
255
-
}
256
-
257
-
val cacheDir =File(cacheDirPath)
258
-
259
-
if (!cacheDir.exists()) {
260
-
cacheDir.mkdirs()
261
-
}
262
-
263
-
if (!cacheDir.isDirectory) {
264
-
throwIllegalArgumentException("Provided path to cache directory is not directory")
0 commit comments