Exemplo n.º 1
0
        public static void MakeCompilationOutputRunnable(this ProjectContext context, string outputPath, string configuration)
        {
            context
            .ProjectFile
            .Files
            .GetContentFiles()
            .StructuredCopyTo(context.ProjectDirectory, outputPath)
            .RemoveAttribute(FileAttributes.ReadOnly);

            var exporter = context.CreateExporter(configuration);

            if (context.TargetFramework.IsDesktop())
            {
                exporter
                .GetDependencies()
                .SelectMany(e => e.RuntimeAssets())
                .CopyTo(outputPath);

                GenerateBindingRedirects(context, exporter, outputPath);
            }
            else
            {
                exporter
                .GetDependencies(LibraryType.Package)
                .WriteDepsTo(Path.Combine(outputPath, context.ProjectFile.Name + FileNameSuffixes.Deps));

                exporter.GetDependencies(LibraryType.Project)
                .SelectMany(e => e.RuntimeAssets())
                .CopyTo(outputPath);

                CoreHost.CopyTo(Path.Combine(outputPath, context.ProjectFile.Name + Constants.ExeSuffix));
            }
        }
Exemplo n.º 2
0
        private void MakeCompilationOutputRunnableForCoreCLR()
        {
            WriteDepsFileAndCopyProjectDependencies(_exporter);

            var isRunnable = _compilerOptions.EmitEntryPoint ?? false;

            if (isRunnable && !_context.IsPortable)
            {
                // TODO: Pick a host based on the RID
                VerifyCoreClrPresenceInPackageGraph();
                CoreHost.CopyTo(_runtimeOutputPath, _compilerOptions.OutputName + Constants.ExeSuffix);
            }
        }