-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/0.2.0: (24 commits) (build) Corrected failing build in 15.3 Visual Studio (GH-76) Updated to Cake 0.21.1 (GH-18) Tabs to Spaces (maint) Update to https Add support for drag-and-drop with cake and dll files Re-target to .NET Framework 4.6 and update NuGet dependencies Update Cake dependencies/templates to 0.19.4 Adds Visual Studio 2017 support added params key word (GH-64) Update Cake to 0.17.0/1 Add support for Cake-specific language/IDE settings Add MagicChunks-powered version transform Remove diagnostic logging, fix manifest versioning Upload as single stream, not multipart Fix compilation error and rookie mistake Additional logging for MyGet upload client task-runner: Rework regex to allow whitespace Additional build scripts for CI builds/packages Added support for "smart" indentation in Cake files. Indents are added on method body open, otherwise last offset used. Update task match pattern to support symbols and numbers in task names (to fix #37) ...
- Loading branch information
Showing
65 changed files
with
1,386 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Build worker image | ||
image: Visual Studio 2017 | ||
|
||
# Build script | ||
init: | ||
- git config --global core.autocrlf true | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#addin "System.Net.Http" | ||
using System.Net.Http; | ||
|
||
public class MyGetClient : HttpClient | ||
{ | ||
|
||
public string ApiKey { get; set; } | ||
public Uri FeedUri { get; set; } | ||
private Action<string> Log { get; set; } | ||
|
||
public static MyGetClient GetClient(string uri, string key) | ||
{ | ||
return GetClient(uri, key, s => { }); | ||
} | ||
|
||
public static MyGetClient GetClient(string uri, string key, Action<string> log) { | ||
return new MyGetClient | ||
{ | ||
FeedUri = uri.TrimEnd('/').EndsWith("/upload") | ||
? new Uri(uri) | ||
: new Uri(uri.TrimEnd('/') + "/upload"), | ||
ApiKey = key, | ||
Log = log | ||
}; | ||
} | ||
|
||
public static MyGetClient GetClient(MyGetFeed feed) | ||
{ | ||
return MyGetClient.GetClient(feed.Url, feed.Key); | ||
} | ||
|
||
public HttpResponseMessage UploadVsix(IFile file) | ||
{ | ||
Log = Log ?? (s => { }); | ||
using (var content = new StreamContent(file.Open(FileMode.Open, FileAccess.Read, FileShare.Read))) | ||
{ | ||
DefaultRequestHeaders.Add("X-NuGet-ApiKey", ApiKey); | ||
Log.Invoke(string.Format("Issuing POST request to {0}", FeedUri)); | ||
using (var message = | ||
PostAsync(FeedUri, content).Result) | ||
{ | ||
return message; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public class MyGetFeed | ||
{ | ||
public string Url { get; private set; } | ||
public string Key { get; private set; } | ||
|
||
public MyGetFeed(string feedUrl, string apiKey) | ||
{ | ||
Url = feedUrl; | ||
Key = apiKey; | ||
} | ||
} | ||
|
||
public IFile GetFile(FilePath path) { | ||
return Context.FileSystem.GetFile(path); | ||
} |
Oops, something went wrong.