-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
[console] add csharpsrc (#5163)
- v4.0.276
- v4.0.275
- v4.0.274
- v4.0.273
- v4.0.272
- v4.0.271
- v4.0.270
- v4.0.269
- v4.0.268
- v4.0.267
- v4.0.266
- v4.0.265
- v4.0.264
- v4.0.263
- v4.0.262
- v4.0.261
- v4.0.260
- v4.0.259
- v4.0.258
- v4.0.257
- v4.0.256
- v4.0.255
- v4.0.254
- v4.0.253
- v4.0.252
- v4.0.251
- v4.0.250
- v4.0.249
- v4.0.248
- v4.0.247
- v4.0.246
- v4.0.245
- v4.0.244
- v4.0.243
- v4.0.242
- v4.0.241
- v4.0.240
- v4.0.239
- v4.0.238
- v4.0.237
- v4.0.236
- v4.0.235
- v4.0.234
- v4.0.233
- v4.0.232
- v4.0.231
- v4.0.230
- v4.0.229
- v4.0.228
- v4.0.227
- v4.0.226
- v4.0.225
- v4.0.224
- v4.0.223
- v4.0.222
- v4.0.221
- v4.0.220
- v4.0.219
- v4.0.218
- v4.0.217
- v4.0.216
- v4.0.215
- v4.0.214
- v4.0.213
- v4.0.212
- v4.0.211
- v4.0.210
- v4.0.209
- v4.0.208
- v4.0.207
- v4.0.206
- v4.0.205
- v4.0.204
- v4.0.203
- v4.0.202
- v4.0.201
- v4.0.200
- v4.0.199
- v4.0.198
- v4.0.197
- v4.0.196
- v4.0.195
- v4.0.194
- v4.0.193
- v4.0.192
- v4.0.191
- v4.0.190
- v4.0.189
- v4.0.188
- v4.0.187
- v4.0.186
- v4.0.185
- v4.0.184
- v4.0.183
- v4.0.182
- v4.0.181
- v4.0.180
- v4.0.179
- v4.0.178
- v4.0.177
- v4.0.176
- v4.0.175
- v4.0.174
1 parent
b239663
commit 90c3300
Showing
3 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
console/src/main/scala/io/joern/console/cpgcreation/CSharpSrcCpgGenerator.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.joern.console.cpgcreation | ||
|
||
import io.joern.console.FrontendConfig | ||
import java.nio.file.Path | ||
import scala.util.Try | ||
|
||
case class CSharpSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends CpgGenerator { | ||
private lazy val command: Path = | ||
if (isWin) rootPath.resolve("csharpsrc2cpg.bat") else rootPath.resolve("csharpsrc2cpg") | ||
private lazy val cmdLineArgs = config.cmdLineParams.toSeq | ||
|
||
override def generate(inputPath: String, outputPath: String = "cpg.bin"): Try[String] = { | ||
val arguments = cmdLineArgs ++ Seq(inputPath, "--output", outputPath) | ||
runShellCommand(command.toString, arguments).map(_ => outputPath) | ||
} | ||
|
||
override def isAvailable: Boolean = command.toFile.exists | ||
|
||
override def isJvmBased: Boolean = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters