From 47589a7b442c2ec4762a46ea9e79ae70c5649bd4 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 26 Mar 2017 14:38:21 -0500 Subject: [PATCH] use a sourcelink.compile file (#182) * compile for netcoreapp 1.1 fix #157 * switch to sourcelink.compile file #175 * File.OpenStream for netstandard 1.4 * back to netcoreapp1.0 #157 --- .gitignore | 5 ++++- SourceLink.Create.GitHub/CreateTask.cs | 15 +++++++++++---- build.ps1 | 2 +- dotnet-sourcelink-git/Program.cs | 17 +++++------------ 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index afcdbc6..425a816 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,7 @@ lib/*.dll .vs/ packages.config .vscode/launch.json -launchSettings.json \ No newline at end of file +launchSettings.json +launchSettings.json +/*.txt +*.user \ No newline at end of file diff --git a/SourceLink.Create.GitHub/CreateTask.cs b/SourceLink.Create.GitHub/CreateTask.cs index eefac3f..a25e39d 100644 --- a/SourceLink.Create.GitHub/CreateTask.cs +++ b/SourceLink.Create.GitHub/CreateTask.cs @@ -50,14 +50,21 @@ public override bool Execute() url = GetRepoUrl(origin); } + var compileFile = IO.Path.ChangeExtension(File, ".compile"); + using(var sw = new IO.StreamWriter(IO.File.OpenWrite(compileFile))) + { + if (Sources != null) + { + foreach (var source in Sources) + sw.WriteLine(source); + } + } + var sbArgs = new StringBuilder(); sbArgs.Append("sourcelink-git create" + gitOption); sbArgs.Append(" -u \"" + url + "\""); sbArgs.Append(" -f \"" + File + "\""); - if (Sources != null) { - foreach (var source in Sources) - sbArgs.Append(" -s \"" + source + "\""); - } + if (!string.IsNullOrEmpty(NotInGit)) { sbArgs.Append(" --notingit \"" + NotInGit + "\""); diff --git a/build.ps1 b/build.ps1 index 5ce51b5..8619ec4 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,4 +1,4 @@ -$version = '2.0.2' # the version under development, update after a release +$version = '2.1.0' # the version under development, update after a release $versionSuffix = '-a115' # manually incremented for local builds function isVersionTag($tag){ diff --git a/dotnet-sourcelink-git/Program.cs b/dotnet-sourcelink-git/Program.cs index 67853e5..b2bb86d 100644 --- a/dotnet-sourcelink-git/Program.cs +++ b/dotnet-sourcelink-git/Program.cs @@ -98,9 +98,7 @@ public static void Create(CommandLineApplication command) command.Description = "creates the Source Link JSON file"; var dirOption = command.Option("-d|--dir ", "the directory to look for the git repository", CommandOptionType.SingleValue); var fileOption = command.Option("-f|--file ", "the sourcelink.json file to write", CommandOptionType.SingleValue); - //var embedOption = command.Option("-e|--embed ", "the sourcelink.embed file to write", CommandOptionType.SingleValue); var urlOption = command.Option("-u|--url ", "URL for downloading the source files, use {0} for commit and * for path", CommandOptionType.SingleValue); - var sourceOption = command.Option("-s|--source ", "source file to verify checksum in git repository", CommandOptionType.MultipleValue); var notInGitOption = command.Option("--notingit