コード例 #1
0
ファイル: ProjectContextExtensions.cs プロジェクト: dsyme/cli
        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));
            }
        }
コード例 #2
0
ファイル: Executable.cs プロジェクト: wtgodbe/cli
        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);
            }
        }