diff --git a/dotnet/private/rules/binary.bzl b/dotnet/private/rules/binary.bzl index 3d8c0916..e23b6522 100644 --- a/dotnet/private/rules/binary.bzl +++ b/dotnet/private/rules/binary.bzl @@ -16,17 +16,8 @@ load("@bazel_skylib//lib:paths.bzl", "paths") # DotnetContext, DotnetLibrary def create_launcher(dotnet, library, shim = None): - launch_target = shim if shim else library.result - launcher = dotnet.declare_file(dotnet, path = "launcher.bat", sibling = launch_target) - dotnet.actions.write( - output = launcher, - content = r"""@echo off -%~dp0{launch_target} %* -""".format( - launch_target = launch_target.basename)) - # DllName.runtimeconfig.json - runtimeconfig = write_runtimeconfig(dotnet._ctx, launch_target) + runtimeconfig = write_runtimeconfig(dotnet._ctx, shim) # DllName.deps.json depsjson = write_depsjson(dotnet, library) # ManifestLoader @@ -34,16 +25,16 @@ def create_launcher(dotnet, library, shim = None): dotnet.actions.symlink(output = loader, target_file = dotnet._ctx.attr.loader[DotnetLibrary].result) runfiles = dotnet._ctx.runfiles( - files = [launch_target, dotnet.runner, launcher, runtimeconfig, depsjson, loader], + files = [shim, dotnet.runner, runtimeconfig, depsjson, loader], transitive_files = depset( transitive = [library.runfiles, dotnet.host] ) ) return DefaultInfo( - files = depset([launch_target, library.result, launcher, runtimeconfig, depsjson, loader]), + files = depset([shim, library.result, runtimeconfig, depsjson, loader]), runfiles = runfiles, - executable = launcher, + executable = shim, ) # copies apphost.exe and embeds target dll path to dllname.exe