Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ maven.install(
"com.google.protobuf:protobuf-java:4.34.1",
"com.lihaoyi:ujson_3:4.4.3",
"com.lihaoyi:os-lib_3:0.11.4",
"com.github.pathikrit:better-files_3:3.9.2",
],
excluded_artifacts = [
# Exclude any scala libraries which might come in transitively.
Expand Down
1 change: 0 additions & 1 deletion codepropertygraph/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ scala_test(
":tests_java",
"//schema:domainClassesNeverLinked",
"//schema:java_proto",
"@maven//:com_github_pathikrit_better_files_3",
"@maven//:io_joern_flatgraph_core_3",
"@maven//:io_joern_flatgraph_help_3",
],
Expand Down
1 change: 0 additions & 1 deletion codepropertygraph/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ libraryDependencies ++= Seq(
"io.joern" %% "flatgraph-help" % Versions.flatgraph,
"io.joern" %% "flatgraph-odb-convert" % Versions.flatgraph,
"com.github.scopt" %% "scopt" % "4.0.1",
"com.github.pathikrit" %% "better-files" % "3.9.2",
"org.slf4j" % "slf4j-api" % "2.0.6",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
)
Original file line number Diff line number Diff line change
@@ -1,46 +1,58 @@
package io.shiftleft.codepropertygraph.cpgloading

import better.files.File
import io.shiftleft.proto.cpg.Cpg
import io.shiftleft.proto.cpg.Cpg.CpgStruct

import java.io.FileOutputStream
import java.nio.file.{Files, Path}
import java.util.zip.{ZipEntry, ZipOutputStream}

object TestProtoCpg {

def createTestProtoCpg: Path = {
val outDir = better.files.File.newTemporaryDirectory("cpgloadertests")
val outStream = new FileOutputStream((outDir / "1.proto").pathAsString)
CpgStruct
.newBuilder()
.addNode(
CpgStruct.Node
.newBuilder()
.setKey(1)
.setType(CpgStruct.Node.NodeType.valueOf("METHOD"))
.addProperty(
CpgStruct.Node.Property
.newBuilder()
.setName(Cpg.NodePropertyName.valueOf("FULL_NAME"))
.setValue(
Cpg.PropertyValue
.newBuilder()
.setStringValue("foo")
.build()
)
.build
)
.build()
)
.build()
.writeTo(outStream)
outStream.close()
val outDir = Files.createTempDirectory("cpgloadertests")
val protoFile = outDir.resolve("1.proto")
val outStream = Files.newOutputStream(protoFile)
try {
CpgStruct
.newBuilder()
.addNode(
CpgStruct.Node
.newBuilder()
.setKey(1)
.setType(CpgStruct.Node.NodeType.valueOf("METHOD"))
.addProperty(
CpgStruct.Node.Property
.newBuilder()
.setName(Cpg.NodePropertyName.valueOf("FULL_NAME"))
.setValue(
Cpg.PropertyValue
.newBuilder()
.setStringValue("foo")
.build()
)
.build
)
.build()
)
.build()
.writeTo(outStream)
} finally {
outStream.close()
}

val zipFile = better.files.File.newTemporaryFile("cpgloadertests", ".bin.zip")
outDir.zipTo(zipFile)
outDir.delete()
zipFile.path
val zipFile = Files.createTempFile("cpgloadertests", ".bin.zip")
val zipStream = new ZipOutputStream(Files.newOutputStream(zipFile))
try {
zipStream.putNextEntry(new ZipEntry("1.proto"))
Files.copy(protoFile, zipStream)
zipStream.closeEntry()
} finally {
zipStream.close()
}

Files.delete(protoFile)
Files.delete(outDir)
zipFile
}

}
15 changes: 0 additions & 15 deletions maven_install.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": {
"com.github.pathikrit:better-files_3": 2078137804,
"com.google.code.findbugs:jsr305": 495355163,
"com.google.code.gson:gson": 597770368,
"com.google.errorprone:error_prone_annotations": -1035138750,
Expand All @@ -23,8 +22,6 @@
"__RESOLVED_ARTIFACTS_HASH": {
"com.github.luben:zstd-jni": 1886873774,
"com.github.luben:zstd-jni:jar:sources": -1190847340,
"com.github.pathikrit:better-files_3": -730147472,
"com.github.pathikrit:better-files_3:jar:sources": -1753499885,
"com.github.scopt:scopt_3": 148843063,
"com.github.scopt:scopt_3:jar:sources": 776003799,
"com.google.code.findbugs:jsr305": 870839855,
Expand Down Expand Up @@ -100,13 +97,6 @@
},
"version": "1.5.7-11"
},
"com.github.pathikrit:better-files_3": {
"shasums": {
"jar": "136c1770a63aa33b2710745bf7f8441cbbe0eeef0cab6b832bd0a46804158989",
"sources": "5a3d4cc0c63605353b1c528abfdc180ae4d74b6c50d6693eee4389dcec923e61"
},
"version": "3.9.2"
},
"com.github.scopt:scopt_3": {
"shasums": {
"jar": "7cfb80743b761b3df8630a818265eb91fd93cd77b32ed5ebd6fba1bb7cff6a3f",
Expand Down Expand Up @@ -395,9 +385,6 @@
"com.github.luben.zstd",
"com.github.luben.zstd.util"
],
"com.github.pathikrit:better-files_3": [
"better.files"
],
"com.github.scopt:scopt_3": [
"scopt"
],
Expand Down Expand Up @@ -773,8 +760,6 @@
"https://repo1.maven.org/maven2/": [
"com.github.luben:zstd-jni",
"com.github.luben:zstd-jni:jar:sources",
"com.github.pathikrit:better-files_3",
"com.github.pathikrit:better-files_3:jar:sources",
"com.github.scopt:scopt_3",
"com.github.scopt:scopt_3:jar:sources",
"com.google.code.findbugs:jsr305",
Expand Down
1 change: 0 additions & 1 deletion proto-bindings/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ lazy val installProtoc =
installProtoc := {
import sys.process._
import java.nio.file.Files
// import better.files.FileExtensions
val protocVersion = (ProtobufConfig / version).value
val protocBinary = new File(protocBinaryPath)
val isAlreadyInstalled = protocBinary.exists && s"$protocBinaryPath --version".!!.contains(protocVersion)
Expand Down
Loading