Skip to content

Commit

Permalink
update to scala 3.5.2 (#1)
Browse files Browse the repository at this point in the history
* update to scala 3.5.2

Signed-off-by: Prabhu Subramanian <[email protected]>

* update protobuf and protoc

Signed-off-by: Prabhu Subramanian <[email protected]>

---------

Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Nov 17, 2024
1 parent c055fcd commit 0f3dcef
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.sbt
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Clone submodules
run: git submodule update --init --recursive
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
Expand All @@ -32,3 +32,15 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate SBOM with cdxgen
run: |
npm install -g @cyclonedx/cdxgen
cdxgen -t sbt -o bom.json . -p --no-recurse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
bom.json
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name := "cpg2"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "1.0.0"
ThisBuild / scalaVersion := "3.3.1"
ThisBuild / version := "1.0.1"
ThisBuild / scalaVersion := "3.5.2"

// parsed by project/Versions.scala
val overflowdbVersion = "1.0.0"
val overflowdbVersion = "1.0.1"
val overflowdbCodegenVersion = "2.103"

ThisBuild / Test / fork := true
Expand Down
2 changes: 1 addition & 1 deletion codepropertygraph/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependsOn(Projects.protoBindings, Projects.domainClasses)
libraryDependencies ++= Seq(
"io.appthreat" %% "odb2-traversal" % Versions.overflowdb,
"io.appthreat" %% "odb2-formats" % Versions.overflowdb,
"com.github.scopt" %% "scopt" % "4.0.1",
"com.github.scopt" %% "scopt" % "4.1.0",
"com.github.pathikrit" %% "better-files" % "3.9.2",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class SerializedCpg extends AutoCloseable:

/** We allow creating a dummy serialized CPG that does not do anything.
*/
private[this] var zipFileSystem: FileSystem = null
private[this] var counter = 0
private var zipFileSystem: FileSystem = null
private var counter = 0

/** Create Serialized CPG from existing file. If the file does not exist, an empty Serialized
* CPG is created.
Expand All @@ -25,7 +25,7 @@ class SerializedCpg extends AutoCloseable:

@throws[URISyntaxException]
@throws[IOException]
private[this] def initZipFilesystem(filename: String): Unit =
private def initZipFilesystem(filename: String): Unit =
val env = new util.HashMap[String, AnyRef]
// This ensures that the file is created if it does not exist
env.put("create", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import overflowdb.Config
*/
class CpgLoaderTests extends AnyWordSpec with Matchers with BeforeAndAfterAll {

var zipFile: better.files.File = _
var zipFile: better.files.File = scala.compiletime.uninitialized

override def beforeAll(): Unit = {
zipFile = TestProtoCpg.createTestProtoCpg
Expand Down
6 changes: 6 additions & 0 deletions domainClasses/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ generatedSrcDir := (Compile/sourceDirectory).value / "generated"
Compile/unmanagedSourceDirectories += generatedSrcDir.value
Compile/compile := (Compile/compile).dependsOn(Projects.schema/Compile/generateDomainClasses).value

ThisBuild / scalacOptions ++= Seq(
"-rewrite",
"-source",
"3.4-migration"
)

/* generated sources occasionally have some warnings..
* we're trying to minimise them on a best effort basis, but don't want
* to fail the build because of them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import overflowdb.*
import scala.jdk.CollectionConverters.*

object PropertyErrorRegister:
private var errorMap = Set[(Class[_], String)]()
private var errorMap = Set[(Class[?], String)]()
private val logger = org.slf4j.LoggerFactory.getLogger(getClass)

def logPropertyErrorIfFirst(clazz: Class[?], propertyName: String): Unit =
Expand All @@ -13,7 +13,7 @@ object PropertyErrorRegister:
errorMap += ((clazz, propertyName))

object Factories:
lazy val all: Seq[EdgeFactory[_]] = Seq(
lazy val all: Seq[EdgeFactory[?]] = Seq(
AliasOf.factory,
Argument.factory,
Ast.factory,
Expand All @@ -39,5 +39,5 @@ object Factories:
SourceFile.factory,
TaggedBy.factory
)
lazy val allAsJava: java.util.List[EdgeFactory[_]] = all.asJava
lazy val allAsJava: java.util.List[EdgeFactory[?]] = all.asJava
end Factories
Loading

0 comments on commit 0f3dcef

Please sign in to comment.