blob: f3cdcbc0c108b76e6cfbb53372cafebe4071aad9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#! /usr/bin/env nix-shell
#! nix-shell -p python3 dotnet-sdk_3 -i bash
# Run this script to generate deps.nix
# ./create_deps.sh /path/to/microsoft/python/language/server/source/checkout
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ -d "$1" ]; then
CHECKOUT_PATH="$1"
else
echo "First argument must be a directory, the path to the Microsoft Python Language Server source checkout"
exit 1
fi
# Generate lockfiles in source checkout
cd $CHECKOUT_PATH/src
dotnet nuget locals all --clear
dotnet restore -v normal --no-cache PLS.sln --use-lock-file -r linux-x64
# Use the lockfiles to make a file with two columns: name and version number
# for all possible package dependencies
cd $SCRIPTDIR
echo "" > all_versions.txt
for lockfile in $(find "$CHECKOUT_PATH" -name packages.lock.json); do
echo "Processing lockfile $lockfile"
python ./process_lockfile.py "$lockfile" >> all_versions.txt
done
# Add extra manually added packages
cat ./manual_deps.txt >> all_versions.txt
cat all_versions.txt | sed '/^$/d' | sort | uniq > tmp
mv tmp all_versions.txt
# Retrieve sha256 hashes for each dependency and format fetchNuGet calls into deps.nix
./format-deps.sh all_versions.txt > deps.nix
rm all_versions.txt
|