2015-11-02 10:53:16 -08:00
#!/usr/bin/env bash
2015-11-16 11:21:57 -08:00
#
# 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.
#
2015-11-02 10:53:16 -08:00
set -e
BIN_DIR = " $( cd $1 && pwd ) "
UNAME = ` uname`
2015-12-18 16:39:43 -08:00
# Always recalculate the RID because the package always uses a specific RID, regardless of OS X version or Linux distro.
2016-01-12 08:46:33 -08:00
if [ " $OSNAME " = = "osx" ] ; then
2015-12-18 16:39:43 -08:00
RID = osx.10.10-x64
2016-01-12 08:46:33 -08:00
elif [ " $OSNAME " = = "ubuntu" ] ; then
2015-12-18 16:39:43 -08:00
RID = ubuntu.14.04-x64
2016-01-12 08:46:33 -08:00
elif [ " $OSNAME " = = "centos" ] ; then
RID = centos.7.1-x64
2015-12-18 16:39:43 -08:00
else
2016-01-12 08:46:33 -08:00
echo " Unknown OS: $OSNAME " 1>& 2
2015-12-18 16:39:43 -08:00
exit 1
2015-11-02 10:53:16 -08:00
fi
# Replace with a robust method for finding the right crossgen.exe
2016-01-12 16:36:31 -08:00
CROSSGEN_UTIL = $NUGET_PACKAGES /runtime.$RID .Microsoft.NETCore.Runtime.CoreCLR/1.0.1-rc2-23704/tools/crossgen
2015-11-02 10:53:16 -08:00
2015-11-10 17:30:01 -08:00
cd $BIN_DIR
2015-11-02 10:53:16 -08:00
# Crossgen currently requires itself to be next to mscorlib
cp $CROSSGEN_UTIL $BIN_DIR
chmod +x crossgen
2015-11-10 17:30:01 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR mscorlib.dll
2015-11-02 10:53:16 -08:00
2015-11-10 17:30:01 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR System.Collections.Immutable.dll
2015-11-02 10:53:16 -08:00
2015-11-10 17:30:01 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR System.Reflection.Metadata.dll
2015-11-02 10:53:16 -08:00
2015-11-10 17:30:01 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR Microsoft.CodeAnalysis.dll
2015-11-02 10:53:16 -08:00
2015-11-10 17:30:01 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR Microsoft.CodeAnalysis.CSharp.dll
2015-11-02 10:53:16 -08:00
2015-11-10 17:30:01 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR Microsoft.CodeAnalysis.VisualBasic.dll
2015-11-02 10:53:16 -08:00
2015-11-17 23:37:39 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR csc.dll
2015-11-10 17:30:01 -08:00
[ -e csc.ni.exe ] && [ ! -e csc.ni.dll ] && mv csc.ni.exe csc.ni.dll
2015-11-02 10:53:16 -08:00
2015-11-17 23:37:39 -08:00
./crossgen -nologo -platform_assemblies_paths $BIN_DIR vbc.dll
2015-11-10 17:30:01 -08:00
[ -e vbc.ni.exe ] && [ ! -e vbc.ni.dll ] && mv vbc.ni.exe vbc.ni.dll