-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate 3rdparty for scala_proto & scalafmt (#46)
* generate deps for scalafmt * generate deps for scalafmt * generate deps for scala_proto * extra dependencies removed from 3rdparty --------- Co-authored-by: anna-skrodzka <annaskrod@h=gmail.com>
- Loading branch information
1 parent
2f5461a
commit 7cc5b41
Showing
27 changed files
with
502 additions
and
45 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,21 +1,10 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
|
||
scala_import( | ||
name = "scala3_library", | ||
visibility = [ | ||
"//3rdparty/jvm:__subpackages__", | ||
], | ||
exports = [ | ||
"@scala3_library//jar", | ||
"@scala3_library//jar" | ||
], | ||
) | ||
|
||
scala_import( | ||
name = "scala_library", | ||
visibility = [ | ||
"//3rdparty/jvm:__subpackages__", | ||
], | ||
exports = [ | ||
"@scala_library_2_13//jar", | ||
], | ||
) | ||
"//3rdparty/jvm:__subpackages__" | ||
] | ||
) |
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
Empty file.
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
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
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 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
scala_import( | ||
name = "scala3_library", | ||
exports = [ | ||
"@scala3_library//jar" | ||
], | ||
visibility = [ | ||
"//rules/scala_proto/3rdparty/jvm:__subpackages__" | ||
] | ||
) | ||
|
||
scala_import( | ||
name = "scala_library", | ||
exports = [ | ||
"@scala_library_2_13//jar" | ||
], | ||
visibility = [ | ||
"//rules/scala_proto/3rdparty/jvm:__subpackages__" | ||
] | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Do not edit. rules_scala3 autogenerates this file | ||
def _jar_artifact_impl(ctx): | ||
jar_name = "%s.jar" % ctx.name | ||
ctx.download( | ||
output = ctx.path("jar/%s" % jar_name), | ||
url = ctx.attr.urls, | ||
executable = False, | ||
) | ||
build_file_contents = """ | ||
package(default_visibility = ['//visibility:public']) | ||
filegroup( | ||
name = 'jar', | ||
srcs = ['{jar_name}'], | ||
visibility = ['//visibility:public'], | ||
) | ||
alias( | ||
name = "file", | ||
actual = ":jar", | ||
visibility = ["//visibility:public"], | ||
)\n""".format(artifact = ctx.attr.artifact, jar_name = jar_name) | ||
ctx.file(ctx.path("jar/BUILD"), build_file_contents, False) | ||
return None | ||
|
||
jar_artifact = repository_rule( | ||
attrs = { | ||
"artifact": attr.string(mandatory = True), | ||
"urls": attr.string_list(mandatory = True), | ||
}, | ||
implementation = _jar_artifact_impl, | ||
) | ||
|
||
def jar_artifact_callback(hash): | ||
jar_artifact( | ||
artifact = hash["artifact"], | ||
name = hash["name"], | ||
urls = [hash["url"]], | ||
) | ||
native.bind(name = hash["bind"], actual = hash["actual"]) | ||
|
||
|
||
def list_dependencies(): | ||
return [ | ||
{"artifact":"com.google.protobuf:protobuf-java:4.28.2","url":"https://oss.sonatype.org/service/local/repositories/releases/content/com/google/protobuf/protobuf-java/4.28.2/protobuf-java-4.28.2.jar","name":"com_google_protobuf_protobuf_java","actual":"@com_google_protobuf_protobuf_java//jar","bind": "jar/com/google/protobuf/protobuf_java"}, | ||
{"artifact":"com.thesamet.scalapb:compilerplugin_3:1.0.0-alpha.1","url":"https://oss.sonatype.org/service/local/repositories/releases/content/com/thesamet/scalapb/compilerplugin_3/1.0.0-alpha.1/compilerplugin_3-1.0.0-alpha.1.jar","name":"com_thesamet_scalapb_compilerplugin_3","actual":"@com_thesamet_scalapb_compilerplugin_3//jar","bind": "jar/com/thesamet/scalapb/compilerplugin_3"}, | ||
{"artifact":"com.thesamet.scalapb.grpcweb:scalapb-grpcweb-code-gen_3:0.7.0","url":"https://oss.sonatype.org/service/local/repositories/releases/content/com/thesamet/scalapb/grpcweb/scalapb-grpcweb-code-gen_3/0.7.0/scalapb-grpcweb-code-gen_3-0.7.0.jar","name":"com_thesamet_scalapb_grpcweb_scalapb_grpcweb_code_gen_3","actual":"@com_thesamet_scalapb_grpcweb_scalapb_grpcweb_code_gen_3//jar","bind": "jar/com/thesamet/scalapb/grpcweb/scalapb_grpcweb_code_gen_3"}, | ||
{"artifact":"com.thesamet.scalapb:protoc-bridge_2.13:0.9.7","url":"https://oss.sonatype.org/service/local/repositories/releases/content/com/thesamet/scalapb/protoc-bridge_2.13/0.9.7/protoc-bridge_2.13-0.9.7.jar","name":"com_thesamet_scalapb_protoc_bridge_2_13","actual":"@com_thesamet_scalapb_protoc_bridge_2_13//jar","bind": "jar/com/thesamet/scalapb/protoc_bridge_2_13"}, | ||
{"artifact":"com.thesamet.scalapb:protoc-gen_2.13:0.9.7","url":"https://oss.sonatype.org/service/local/repositories/releases/content/com/thesamet/scalapb/protoc-gen_2.13/0.9.7/protoc-gen_2.13-0.9.7.jar","name":"com_thesamet_scalapb_protoc_gen_2_13","actual":"@com_thesamet_scalapb_protoc_gen_2_13//jar","bind": "jar/com/thesamet/scalapb/protoc_gen_2_13"}, | ||
{"artifact":"dev.dirs:directories:26","url":"https://oss.sonatype.org/service/local/repositories/releases/content/dev/dirs/directories/26/directories-26.jar","name":"dev_dirs_directories","actual":"@dev_dirs_directories//jar","bind": "jar/dev/dirs/directories"}, | ||
{"artifact":"org.scala-lang.modules:scala-collection-compat_3:2.12.0","url":"https://oss.sonatype.org/service/local/repositories/releases/content/org/scala-lang/modules/scala-collection-compat_3/2.12.0/scala-collection-compat_3-2.12.0.jar","name":"org_scala_lang_modules_scala_collection_compat_3","actual":"@org_scala_lang_modules_scala_collection_compat_3//jar","bind": "jar/org/scala_lang/modules/scala_collection_compat_3"}, | ||
] | ||
|
||
def maven_dependencies(callback = jar_artifact_callback): | ||
for hash in list_dependencies(): | ||
callback(hash) |
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
Empty file.
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,49 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
|
||
scala_import( | ||
name = "metaconfig_core", | ||
jars = [ | ||
"//external:jar/com/geirsson/metaconfig_core_2_13", | ||
], | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
runtime_deps = [ | ||
":metaconfig_pprint", | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_library", | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_reflect", | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", | ||
"//rules/scalafmt/3rdparty/jvm/org/typelevel:paiges_core", | ||
], | ||
) | ||
|
||
scala_import( | ||
name = "metaconfig_pprint", | ||
jars = [ | ||
"//external:jar/com/geirsson/metaconfig_pprint_2_13", | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__", | ||
], | ||
runtime_deps = [ | ||
"//rules/scalafmt/3rdparty/jvm/com/lihaoyi:fansi", | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_compiler", | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_library", | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_reflect", | ||
], | ||
) | ||
|
||
scala_import( | ||
name = "metaconfig_typesafe_config", | ||
jars = [ | ||
"//external:jar/com/geirsson/metaconfig_typesafe_config_2_13", | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__", | ||
], | ||
runtime_deps = [ | ||
":metaconfig_core", | ||
"//rules/scalafmt/3rdparty/jvm/com/typesafe:config", | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_library", | ||
], | ||
) |
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,27 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
scala_import( | ||
name = "fansi", | ||
jars = [ | ||
"//external:jar/com/lihaoyi/fansi_2_13" | ||
], | ||
runtime_deps = [ | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_library", | ||
":sourcecode" | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__" | ||
] | ||
) | ||
|
||
scala_import( | ||
name = "sourcecode", | ||
jars = [ | ||
"//external:jar/com/lihaoyi/sourcecode_2_13" | ||
], | ||
runtime_deps = [ | ||
"//rules/scalafmt/3rdparty/jvm/org/scala_lang:scala_library" | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__" | ||
] | ||
) |
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,10 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
java_import( | ||
name = "config", | ||
jars = [ | ||
"//external:jar/com/typesafe/config" | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__" | ||
] | ||
) |
10 changes: 10 additions & 0 deletions
10
rules/scalafmt/3rdparty/jvm/io/github/java_diff_utils/BUILD
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,10 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
java_import( | ||
name = "java_diff_utils", | ||
jars = [ | ||
"//external:jar/io/github/java_diff_utils/java_diff_utils" | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__" | ||
] | ||
) |
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,10 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
java_import( | ||
name = "jna", | ||
jars = [ | ||
"//external:jar/net/java/dev/jna/jna" | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__" | ||
] | ||
) |
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,10 @@ | ||
load("@rules_scala3//rules:scala.bzl", "scala_import") | ||
java_import( | ||
name = "jline", | ||
jars = [ | ||
"//external:jar/org/jline/jline" | ||
], | ||
visibility = [ | ||
"//rules/scalafmt/3rdparty/jvm:__subpackages__" | ||
] | ||
) |
Oops, something went wrong.