예제 #1
0
파일: Executable.cs 프로젝트: cdmihai/cli
 public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter)
 {
     _context = context;
     _outputPaths = outputPaths;
     _runtimeOutputPath = outputPaths.RuntimeOutputPath;
     _intermediateOutputPath = outputPaths.IntermediateOutputDirectoryPath;
     _exporter = exporter;
 }
예제 #2
0
 public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter, string configuration)
 {
     _context = context;
     _outputPaths = outputPaths;
     _runtimeOutputPath = outputPaths.RuntimeOutputPath;
     _intermediateOutputPath = outputPaths.IntermediateOutputDirectoryPath;
     _exporter = exporter;
     _compilerOptions = _context.ProjectFile.GetCompilerOptions(_context.TargetFramework, configuration);
 }
예제 #3
0
 private void CopyCompilationOutput(OutputPaths outputPaths)
 {
     var dest = outputPaths.RuntimeOutputPath;
     var source = outputPaths.CompilationOutputPath;
     foreach (var file in outputPaths.CompilationFiles.All())
     {
         var destFileName = file.Replace(source, dest);
         var directoryName = Path.GetDirectoryName(destFileName);
         if (!Directory.Exists(directoryName))
         {
             Directory.CreateDirectory(directoryName);
         }
         File.Copy(file, destFileName, true);
     }
 }
예제 #4
0
파일: Executable.cs 프로젝트: noahfalk/cli
 public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter)
 {
     _context = context;
     _outputPaths = outputPaths;
     _exporter = exporter;
 }
예제 #5
0
파일: CompileContext.cs 프로젝트: krwq/cli
        private void CopyCompilationOutput(OutputPaths outputPaths)
        {
            var dest = outputPaths.RuntimeOutputPath;
            var source = outputPaths.CompilationOutputPath;

            // No need to copy if dest and source are the same
            if(string.Equals(dest, source, StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            foreach (var file in outputPaths.CompilationFiles.All())
            {
                var destFileName = file.Replace(source, dest);
                var directoryName = Path.GetDirectoryName(destFileName);
                if (!Directory.Exists(directoryName))
                {
                    Directory.CreateDirectory(directoryName);
                }
                File.Copy(file, destFileName, true);
            }
        }
예제 #6
0
        /// <summary>
        /// Filters which export's RuntimeAssets should get copied to the output path.
        /// </summary>
        /// <returns>
        /// True if the asset should be copied to the output path; otherwise, false.
        /// </returns>
        private static bool ShouldCopyExportRuntimeAsset(ProjectContext context, OutputPaths buildOutputPaths, LibraryExport export, LibraryAsset asset)
        {
            // The current project has the host .exe in its runtime assets, but it shouldn't be copied
            // to the output path during publish. The host will come from the export that has the real host in it.

            if (context.RootProject.Identity == export.Library.Identity)
            {
                if (asset.ResolvedPath == buildOutputPaths.RuntimeFiles.Executable)
                {
                    return false;
                }
            }

            return true;
        }
예제 #7
0
 public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter, string configuration)
     : this(context, outputPaths, outputPaths.RuntimeOutputPath, outputPaths.IntermediateOutputDirectoryPath, exporter, configuration) { }