omnisharp-roslyn: migrate lockfile generation to fetch-deps

This commit is contained in:
Ivar Scholten 2022-08-19 00:42:56 +02:00
parent 12b912258e
commit f5ede4745b
No known key found for this signature in database
GPG key ID: E22887AD87C33E3C
2 changed files with 2 additions and 47 deletions

View file

@ -75,7 +75,6 @@ buildDotnetModule rec {
meta = with lib; {
description = "OmniSharp based on roslyn workspaces";
homepage = "https://github.com/OmniSharp/omnisharp-roslyn";
platforms = platforms.unix;
sourceProvenance = with sourceTypes; [
fromSource
binaryNativeCode # dependencies

View file

@ -1,19 +1,8 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p curl jq common-updater-scripts nuget-to-nix
#! nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts
# shellcheck shell=bash
# WARNING: you need BOTH .NET 7 and 6 to run this script (and they must be on your path
# using dotnetCorePackages.combinePackages).
set -euo pipefail
SDK7_VERSION=$(dotnet --version)
replaceInPlace(){
local contents
contents=$(cat "$1")
contents=${contents//$2/$3}
echo "$contents">"$1"
}
cd "$(dirname "${BASH_SOURCE[0]}")"
@ -29,38 +18,5 @@ fi
cd ../../../..
update-source-version omnisharp-roslyn "${new_version//v}"
store_src="$(nix-build . -A omnisharp-roslyn.src --no-out-link)"
src="$(mktemp -d /tmp/omnisharp-roslyn-src.XXX)"
cp -rT "$store_src" "$src"
chmod -R +w "$src"
trap 'rm -r "$src"' EXIT
pushd "$src"
export DOTNET_NOLOGO=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
mkdir ./nuget_pkgs
replaceInPlace global.json '7.0.100-preview.4.22252.9' "$SDK7_VERSION"
# This is only needed for restore as we'll build for the runtime that is compiling the code in the nix build.
for project in src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj; do
replaceInPlace $project \
'<RuntimeIdentifiers>win7-x64;win7-x86;win10-arm64</RuntimeIdentifiers>' \
'<RuntimeIdentifiers>linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>'
done
for project in src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj; do
dotnet restore "$project" \
--packages ./nuget_pkgs \
-property:PackageVersion="${new_version//v}" \
-property:AssemblyVersion="${new_version//v}".0 \
-property:FileVersion="${new_version//v}".0 \
-property:InformationalVersion="${new_version//v}" \
-property:RuntimeFrameworkVersion=6.0.0-preview.7.21317.1 \
-property:RollForward=LatestMajor
done
nuget-to-nix ./nuget_pkgs > "$deps_file"
$(nix-build -A omnisharp-roslyn.fetch-deps --no-out-link) "$deps_file"