Esempio n. 1
0
 public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter)
 {
     _context = context;
     _outputPaths = outputPaths;
     _runtimeOutputPath = outputPaths.RuntimeOutputPath;
     _intermediateOutputPath = outputPaths.IntermediateOutputDirectoryPath;
     _exporter = exporter;
 }
Esempio n. 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);
 }
Esempio n. 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);
     }
 }
Esempio n. 4
0
 public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter)
 {
     _context = context;
     _outputPaths = outputPaths;
     _exporter = exporter;
 }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 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;
        }
Esempio n. 7
0
 public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter, string configuration)
     : this(context, outputPaths, outputPaths.RuntimeOutputPath, outputPaths.IntermediateOutputDirectoryPath, exporter, configuration) { }