From d66d7d8a3a10d49b0e254279820f2a386e79ae2b Mon Sep 17 00:00:00 2001 From: Cornelius Riemenschneider Date: Thu, 30 May 2024 10:54:37 +0200 Subject: [PATCH] C#: Move to new packaging rules. --- csharp/BUILD.bazel | 15 ++++----------- misc/bazel/csharp.bzl | 9 ++++----- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel index b8a58c268e4..fbe4213ab9e 100644 --- a/csharp/BUILD.bazel +++ b/csharp/BUILD.bazel @@ -1,6 +1,5 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files") -load("@semmle_code//:dist.bzl", "dist") -load("//misc/bazel:pkg.bzl", "codeql_pkg_files_overlay") +load("//misc/bazel:pkg.bzl", "codeql_pack", "codeql_pkg_files_overlay") package(default_visibility = ["//visibility:public"]) @@ -59,22 +58,16 @@ codeql_pkg_files_overlay( ], ) -dist( - name = "extractor-arch", - srcs = [":extractor-arch-overlay"], -) - -dist( - name = "extractor-generic", +codeql_pack( + name = "csharp", srcs = [ ":dbscheme-group", ":extra-files", + ":extractor-arch-overlay", ":extractor-asp", "//csharp/downgrades", "//csharp/tools", ], - prefix = "csharp", - visibility = ["//visibility:public"], ) test_suite( diff --git a/misc/bazel/csharp.bzl b/misc/bazel/csharp.bzl index fa1a954c752..0ae4f39d6d7 100644 --- a/misc/bazel/csharp.bzl +++ b/misc/bazel/csharp.bzl @@ -1,7 +1,6 @@ load("@rules_dotnet//dotnet:defs.bzl", "csharp_binary", "csharp_library", "csharp_test", "publish_binary") load("@rules_pkg//pkg:mappings.bzl", "strip_prefix") -load("@semmle_code//:dist.bzl", "pack_zip") -load("//:defs.bzl", "codeql_platform") +load("//misc/bazel:pkg.bzl", "codeql_pkg_files") TARGET_FRAMEWORK = "net8.0" @@ -60,10 +59,10 @@ def codeql_csharp_binary(name, **kwargs): ), ) - pack_zip( + codeql_pkg_files( name = name, - srcs = [publish_binary_target], - prefix = language_prefix + "/tools/" + codeql_platform, + exes = [publish_binary_target], + prefix = "tools/{CODEQL_PLATFORM}", strip_prefix = strip_prefix.files_only(), visibility = visibility, )