Skip to content

Commit

Permalink
Remove @Annex (#47)
Browse files Browse the repository at this point in the history
* delete annex_proto

* delete annex_scalafmt

* BUILD files edited

* AnxAnalysisStoreSpec.scala & ZincRunner.scala modified

* Dependencies.scala updated

* Printer.scala added

* some test fixed

* annex_install.json deleted

* annex_install.json deleted

---------

Co-authored-by: anna-skrodzka <annaskrod@h=gmail.com>
  • Loading branch information
anna-skrodzka and anna-skrodzka authored Oct 25, 2024
1 parent fa3502f commit 79bb971
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 3,081 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ http_archive(

load("@rules_scala3//rules/scala:workspace.bzl", "scala_register_toolchains", "scala_repositories")
scala_repositories()
load("@annex//:defs.bzl", annex_pinned_maven_install = "pinned_maven_install")
annex_pinned_maven_install()
scala_register_toolchains()

load("@rules_scala3//rules/scalafmt:config.bzl", "scalafmt_default_config")
Expand Down
4 changes: 0 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ load("//rules/scala:init.bzl", "rules_scala3_init")

rules_scala3_init()

load("@annex//:defs.bzl", annex_pinned_maven_install = "pinned_maven_install")

annex_pinned_maven_install()

scala_register_toolchains(default_compiler = "bootstrap")

load("//3rdparty:workspace.bzl", "maven_dependencies")
Expand Down
3,029 changes: 0 additions & 3,029 deletions annex_install.json

This file was deleted.

3 changes: 0 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ deps-update:
rg -l 'maven_install_json' --glob '*.bzl' --glob 'WORKSPACE' | xargs sed -i -E 's/[^#]maven_install_json/#maven_install_json/g'

bazel run @annex_deps//:pin
bazel run @annex//:pin
cd tests && bazel run @annex_test//:pin

rg -l '#maven_install_json' --glob '*.bzl' --glob 'WORKSPACE' | xargs sed -i 's/#maven_install_json/maven_install_json/g'

REPIN=1 bazel run @unpinned_annex_deps//:pin
REPIN=1 bazel run @unpinned_annex//:pin
cd tests && REPIN=1 bazel run @unpinned_annex_test//:pin

deps-outdated:
bazel run @annex//:outdated
bazel run @annex_deps//:outdated
cd tests && bazel run @annex_test//:outdated

Expand Down
21 changes: 0 additions & 21 deletions rules/scala/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,7 @@ repositories = [
sbt_version = "2.0.0-M2"
zinc_version = "2.0.0-alpha14"

def scala_artifacts():
return [
"com.github.scopt:scopt_3:4.1.0",
"org.jacoco:org.jacoco.core:0.8.10",
"org.jline:jline-reader:3.24.1",
"org.scala-lang.modules:scala-xml_3:2.3.0",
"org.scala-sbt:test-interface:1.0",
"org.scala-sbt:util-interface:" + sbt_version,
"org.scala-sbt:util-logging_3:" + sbt_version,
"org.scala-sbt:zinc_3:" + zinc_version,
"org.scalameta:munit_3:1.0.2",
]

def scala_repositories():
maven_install(
name = "annex",
artifacts = scala_artifacts(),
repositories = repositories,
fetch_sources = True,
maven_install_json = "@rules_scala3//:annex_install.json",
)

http_archive(
name = "compiler_bridge_2_13",
build_file_content = _SRC_FILEGROUP_BUILD_FILE_CONTENT,
Expand Down
2 changes: 1 addition & 1 deletion scala/3rdparty/jvm/org/scala_sbt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ scala_import(
"//external:jar/org/scala_sbt/util_relation_3",
],
visibility = [
"//scala/3rdparty/jvm:__subpackages__",
"//visibility:public",
],
runtime_deps = [
"//scala/3rdparty/jvm/org/scala_lang:scala3_library",
Expand Down
8 changes: 5 additions & 3 deletions scala/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ object Dependencies:
"org.scala-sbt" % "test-interface" % "1.0",
"org.scala-sbt" % "compiler-interface" % zincVersion,
"org.scala-sbt" % "util-interface" % sbtVersion,
"org.scala-sbt" %% "util-logging_3" % sbtVersion,
"org.scala-sbt" %% "zinc_3" % zincVersion,
"org.scala-sbt" %% "util-logging" % sbtVersion,
"org.scala-sbt" %% "util-relation" % sbtVersion,
"org.scala-sbt" %% "zinc" % zincVersion,
"org.scala-sbt" %% "zinc-core" % zincVersion,
"org.scala-sbt" %% "zinc-classpath" % zincVersion,
"org.scala-sbt" %% "zinc-compile-core" % zincVersion,
"org.scala-sbt" %% "zinc-persist" % zincVersion,
"org.scala-sbt" % "zinc-persist-core-assembly" % zincVersion,
"org.scala-sbt" %% "zinc-apiinfo" % zincVersion,
"org.scalameta" %% "munit_3" % "1.0.2",
"org.scalameta" %% "munit" % "1.0.2",
)
11 changes: 6 additions & 5 deletions scala/workers/zinc/compile/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ worker_scala_binary(
"//3rdparty/jvm/com/github/scopt",
"//scala/3rdparty/jvm/org/scala_sbt:compiler_interface",
"//scala/3rdparty/jvm/org/scala_sbt:util_interface",
"//scala/3rdparty/jvm/org/scala_sbt:util_relation",
"//scala/3rdparty/jvm/org/scala_sbt:zinc",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_classpath",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_compile_core",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_core",
# "//scala/3rdparty/jvm/org/scala_sbt:zinc_persist",
"@annex//:org_scala_sbt_zinc_persist_3",
# "//scala/3rdparty/jvm/org/scala_sbt:zinc_persist_core_assembly",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_persist",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_persist_core_assembly",
"@rules_scala3//rules/third_party/jarhelper",
"@rules_scala3//scala/common/worker",
"@rules_scala3//scala/workers/common",
Expand All @@ -47,13 +47,13 @@ scala_library(
"//3rdparty/jvm/com/github/scopt",
"//scala/3rdparty/jvm/org/scala_sbt:compiler_interface",
"//scala/3rdparty/jvm/org/scala_sbt:util_interface",
"//scala/3rdparty/jvm/org/scala_sbt:util_relation",
"//scala/3rdparty/jvm/org/scala_sbt:zinc",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_classpath",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_compile_core",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_core",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_persist",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_persist_core_assembly",
# "//scala/3rdparty/jvm/org/scala_sbt:zinc_persist",
"@annex//:org_scala_sbt_zinc_persist_3",
"@rules_scala3//rules/third_party/jarhelper",
"@rules_scala3//scala/common/worker",
"@rules_scala3//scala/workers/common",
Expand All @@ -66,6 +66,7 @@ scala_test(
scala = "@//:zinc_3",
deps = [
":lib",
"//scala/3rdparty/jvm/org/scala_sbt:util_relation",
"//scala/3rdparty/jvm/org/scalameta:munit",
"@rules_scala3//scala/workers/common",
],
Expand Down
2 changes: 2 additions & 0 deletions scala/workers/zinc/compile/main/ZincRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ object AnalysisArgument:
* Bazel worker management cycles out Scala compiler versions. Currently, this runner follows strategy A.
*/
object ZincRunner extends WorkerMain[ZincRunner.Arguments]:
val utilRelation: Class[sbt.internal.util.Relation[?, ?]] = classOf[sbt.internal.util.Relation[?, ?]]

override def init(args: collection.Seq[String]): Arguments =
Arguments(args).getOrElse(throw IllegalArgumentException(s"init args is invalid: ${args.mkString(" ")}"))

Expand Down
2 changes: 2 additions & 0 deletions scala/workers/zinc/compile/test/AnxAnalysisStoreSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import munit.FunSuite
import workers.common.{AnnexLogger, LogLevel}

final class AnxAnalysisStoreSpec extends FunSuite:
val utilRelation: Class[sbt.internal.util.Relation[?, ?]] = classOf[sbt.internal.util.Relation[?, ?]]

given AnnexLogger = AnnexLogger(LogLevel.Debug)
given ZincContext = ZincContext(Paths.get("/tmp"), Paths.get("/tmp"), depsCache = null)

Expand Down
19 changes: 19 additions & 0 deletions scala/workers/zinc/compile/test/Printer.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package munit.diff

trait Printer {
def print(value: _root_.scala.Any, out: _root_.scala.StringBuilder, indent: _root_.scala.Int): _root_.scala.Boolean

def height: _root_.scala.Int

def isMultiline(string: _root_.scala.Predef.String): _root_.scala.Boolean

def orElse(other: _root_.munit.diff.Printer): _root_.munit.diff.Printer
}

object Printer {
val defaultHeight: _root_.scala.Int = ???

def apply(height: _root_.scala.Int)(partialPrint: _root_.scala.PartialFunction[_root_.scala.Any, _root_.scala.Predef.String]): _root_.munit.diff.Printer = ???

def apply(partialPrint: _root_.scala.PartialFunction[_root_.scala.Any, _root_.scala.Predef.String]): _root_.munit.diff.Printer = ???
}
12 changes: 6 additions & 6 deletions scala/workers/zinc/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ scala_library(
srcs = glob(["**/*.scala"]),
visibility = ["//visibility:public"],
deps = [
"//scala/common/sbt-testing:common",
"//scala/workers/common",
"//scala/3rdparty/jvm/org/scala_sbt:test_interface",
"//scala/3rdparty/jvm/org/scala_sbt:compiler_interface",
"//3rdparty/jvm/com/github/scopt",
"//scala/3rdparty/jvm/org/scala_sbt:compiler_interface",
"//scala/3rdparty/jvm/org/scala_sbt:test_interface",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_apiinfo",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_core",
"@annex//:org_scala_sbt_zinc_persist_3",
# "//scala/3rdparty/jvm/org/scala_sbt:zinc_persist_core_assembly",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_persist",
"//scala/3rdparty/jvm/org/scala_sbt:zinc_persist_core_assembly",
"//scala/common/sbt-testing:common",
"//scala/workers/common",
],
)

Expand Down
4 changes: 0 additions & 4 deletions tests/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ load("@rules_scala3//rules/scala:init.bzl", "rules_scala3_init")

rules_scala3_init()

load("@annex//:defs.bzl", annex_pinned_maven_install = "pinned_maven_install")

annex_pinned_maven_install()

scala_register_toolchains()

# load("@rules_scala3//3rdparty:workspace.bzl", "maven_dependencies")
Expand Down
6 changes: 3 additions & 3 deletions tests/test-frameworks/mixed/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ scala_test(
shard_count = 2,
tags = ["manual"],
runtime_deps = [
"@hamcrest_core//jar",
"@junit_interface//jar",
"//3rdparty/jvm/org/hamcrest:hamcrest_core",
"//3rdparty/jvm/org/scalameta:junit_interface",
],
deps = [
"//3rdparty/jvm/junit",
"//3rdparty/jvm/org/scalacheck",
"@junit//jar",
],
)

0 comments on commit 79bb971

Please sign in to comment.