{
public class BuildFolder
{
+ private static string[] s_runtimeExecutables =
+ {
+ "corerun"
+ };
+
+ private static string[] s_runtimeLibraries =
+ {
+ "coreclr",
+ "clrjit",
+ "mscorrc",
+ "mscorrc.debug",
+ "mscordaccore",
+ "mscordbi",
+ };
+
private List<string> _compilationInputFiles;
private List<string> _mainExecutables;
return null;
}
+ if (options.Composite)
+ {
+ // In composite mode we copy the native runtime to the app folder and pretend that is CORE_ROOT,
+ // otherwise CoreRun picks up the original MSIL versions of framework assemblies from CORE_ROOT
+ // instead of the rewritten ones next to the app.
+ foreach (string exe in s_runtimeExecutables)
+ {
+ passThroughFiles.Add(Path.Combine(options.CoreRootDirectory.FullName, exe.AppendOSExeSuffix()));
+ }
+ foreach (string lib in s_runtimeLibraries)
+ {
+ passThroughFiles.Add(Path.Combine(options.CoreRootDirectory.FullName, lib.AppendOSDllSuffix()));
+ }
+ }
+
foreach (CompilerRunner runner in compilerRunners)
{
string runnerOutputPath = runner.GetOutputPath(outputRoot);
public string CoreRunPath(CompilerIndex index, bool isFramework)
{
string coreRunDir = CoreRootOutputPath(index, isFramework);
- string coreRunExe = "corerun".OSExeSuffix();
+ string coreRunExe = "corerun".AppendOSExeSuffix();
string coreRunPath = Path.Combine(coreRunDir, coreRunExe);
if (!File.Exists(coreRunPath))
{
processParameters.Arguments = "-c " + scriptToRun;
}
+ string coreRootDir;
+ if (_options.Composite)
+ {
+ coreRootDir = GetOutputPath(outputRoot);
+ }
+ else
+ {
+ coreRootDir = _options.CoreRootOutputPath(Index, isFramework: false);
+ }
+
processParameters.InputFileNames = new string[] { scriptToRun };
processParameters.OutputFileName = scriptToRun;
processParameters.LogPath = scriptToRun + ".log";
- processParameters.EnvironmentOverrides["CORE_ROOT"] = _options.CoreRootOutputPath(Index, isFramework: false);
+ processParameters.EnvironmentOverrides["CORE_ROOT"] = coreRootDir;
+
return processParameters;
}
protected override string CompilerRelativePath => "crossgen2";
- protected override string CompilerFileName => "crossgen2".OSExeSuffix();
+ protected override string CompilerFileName => "crossgen2".AppendOSExeSuffix();
private List<string> _resolvedReferences;
protected override string CompilerRelativePath => ".";
- protected override string CompilerFileName => "crossgen".OSExeSuffix();
+ protected override string CompilerFileName => "crossgen".AppendOSExeSuffix();
protected override string CompilerPath
{
/// </summary>
const int DirectoryDeletionBackoffMilliseconds = 500;
- internal static string OSExeSuffix(this string path) => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? path + ".exe" : path);
+ internal static string AppendOSExeSuffix(this string path) => (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? path + ".exe" : path);
+
+ internal static string AppendOSDllSuffix(this string path) => path +
+ (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".dll" : RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? ".dylib" : ".so");
internal static string ToAbsolutePath(this string argValue) => Path.GetFullPath(argValue);