-
Notifications
You must be signed in to change notification settings - Fork 4k
/
crossgen.sh
52 lines (35 loc) · 1.69 KB
/
crossgen.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
# USAGE: crossgen.sh directory-containing-roslyn
set -e
BIN_DIR="$( cd "$1" && pwd )"
CONTAINING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
UNAME="$(uname)"
if [ -z "$RID" ]; then
if [ "$UNAME" == "Darwin" ]; then
RID=osx-x64
elif [ "$UNAME" == "Linux" ]; then
RID=linux-x64
else
echo "Unknown OS: $UNAME" 1>&2
exit 1
fi
fi
DEPENDENCIES="$CONTAINING_DIR"/../Targets/Dependencies.props
CORECLR_VERSION="$(grep -o '<MicrosoftNETCoreRuntimeCoreCLRVersion>.*</MicrosoftNETCoreRuntimeCoreCLRVersion>' "$DEPENDENCIES" | sed 's/ *<\/*MicrosoftNETCoreRuntimeCoreCLRVersion> *//g')"
CROSSGEN_UTIL=~/.nuget/packages/runtime."$RID".Microsoft.NETCore.Runtime.CoreCLR/"$CORECLR_VERSION"/tools/crossgen
cd "$BIN_DIR"
# Crossgen currently requires itself to be next to mscorlib
cp "$CROSSGEN_UTIL" "$BIN_DIR"
chmod +x crossgen
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" mscorlib.dll
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" System.Collections.Immutable.dll
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" System.Reflection.Metadata.dll
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" Microsoft.CodeAnalysis.dll
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" Microsoft.CodeAnalysis.CSharp.dll
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" Microsoft.CodeAnalysis.VisualBasic.dll
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" csc.exe
./crossgen -nologo -platform_assemblies_paths "$BIN_DIR" vbc.exe