From afde63b105406f96f1dd6b785fd782dde69f0888 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 10:47:50 +0200 Subject: [PATCH 01/68] (GH-2) Added gitattributes config file --- .gitattributes | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..69cc00f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,30 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text eol=lf + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +*.cs diff=csharp + +*.ps1 text eol=crlf +*.sh text eol=lf + +*.sln text eol=crlf +*.csproj text eol=crlf +task.json text eol=crlf + +# +# Exclude files from exporting +# + +.gitattributes export-ignore +.gitignore export-ignore + +# Markdown files need special handling for git diff +*.md text whitespace=-trailing-space From e92165d543d0ae5f640546e73bd13de09065afd6 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 12:10:41 +0200 Subject: [PATCH 02/68] (GH-2) Added gitignore config file --- .gitignore | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01529bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,57 @@ +# Ignore everything in vscode folder +# except what we want users to +# contribute if there is any +# improvement +.vscode/* +!.vscode/extensions.json +!.vscode/tasks.json + +# User-specific files in Visual Studio +*.suo +*.user +*.userosscache +*.sln.docstates +.vs/ + +# GhostDoc plugin settings file +*.GhostDoc.xml + +# Ignore cake tools directory, except packages.config +tools/* +!tools/packages.config + +# Ignore build artifacts +BuildArtifacts/ +[Oo]bj/ +[Bb]in/ + +# OS Specific files +*~ +.DS_Store +.AppleDouble +.LSOverride + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Windows shortcuts +*.lnk + +# Thumbnails +._* + +# Cake.Graph related +docs/input/tasks/* + +# Wyam related +docs/config.wyam.dll +docs/config.wyam.hash + + +# Project specific ignore list +warp/ From 55e78ace761765c2b2dc6d36664bef85ed664283 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 10:13:00 +0200 Subject: [PATCH 03/68] (GH-2) Added editorcofig configuration --- .editorconfig | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9e48097 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,27 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{sln,csproj}] +end_of_line = crlf + +[*.md] +trim_trailing_whitespace = false + +[*.ps1] +charset = utf-8-bom +end_of_line = crlf + +[*.{yml,yaml}] +indent_size = 2 +indent_style = tab + +# Files that need to be crlf eol to work +[tasks.json] +end_of_line = crlf From 86775aa07e02e9a269705fe3c6cf966f58533a28 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 08:59:26 +0200 Subject: [PATCH 04/68] (GH-2) Added configuration for codecov --- .codecov.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..ffd6126 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,12 @@ +codecov: + ci: # Ignore builds on travis, until it is supported in codecov-exe + - !travis-ci + +coverage: + range: "85...100" + + status: + changes: yes + +comment: + require_changes: yes From 83d3e5551b18fd487adae0ffe2861bfd65740799 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 09:06:54 +0200 Subject: [PATCH 05/68] (GH-2) Added GitVersion configuration file --- GitVersion.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 GitVersion.yml diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..940fc72 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,6 @@ +mode: ContinuousDelivery +branches: + dev(elop)?(ment)?$: + tag: alpha +ignore: + sha: [] From 705820eabdea4368175f29baaa4b646807eb37cd Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 09:24:36 +0200 Subject: [PATCH 06/68] (GH-2) Added configuration for GitReleaseManager --- GitReleaseManager.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 GitReleaseManager.yaml diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml new file mode 100644 index 0000000..bcd152f --- /dev/null +++ b/GitReleaseManager.yaml @@ -0,0 +1,29 @@ +create: + include-footer: true + footer-heading: Where to get it + footer-content: > + You can download this release from + [nuget](https://nuget.org/packages/Cake.Warp/{milestone}, + or you can just reference it in a cake build script + with `#addin nuget:?package?Cake.Warp&version={milestone}`. + footer-includes-milestone: true + milestone-replace-text: '{milestone}' +export: + include-created-date-in-title: true + created-date-string-format: yyyy-MM-dd + perform-regex-removal: true + regex-text: '### Where to get it(\r?\n)*You can .*\)' + multiline-regex: true +issue-labels-include: + - Breaking Change + - Bug + - Enhancement + - Feature + - Documentation + +issue-labels-exclude: + - Build +issue-labels-alias: + - name: Documentation + header: Documentation + plural: Documentation From 051d4061b3937bf40e4f35a509d34a959c412f31 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 09:43:57 +0200 Subject: [PATCH 07/68] (GH-2) Added vscode configuration files the tasks used uses currently expected paths --- .vscode/extensions.json | 9 +++++++++ .vscode/settings.json | 10 ++++++++++ .vscode/tasks.json | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..7af793c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,9 @@ +{ + "recommendations": [ + "ms-vscode.csharp", + "jchannon.csharpextensions", + "cake-build.cake-vscode", + "editorconfig.editorconfig", + "davidanson.vscode-markdownlint" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1105a85 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "files.encoding": "utf8", + "[powershell]": { + "files.encoding": "utf8bom" + }, + "editor.rulers": [80], + "[markdown]": { + "editor.rulers": [120] + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..ddb59b8 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/src/Cake.Warp.sln" + ], + "problemMatcher": "$tsc", + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/src/Cake.Warp/Cake.Warp.csproj" + ], + "problemMatcher": "$tsc" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "--project", + "${workspaceFolder}/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj", + "test" + ], + "problemMatcher": "$tsc" + } + ] +} From bc9deadafdf02517690f17c2242caf0e5874dbb9 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 11:51:44 +0200 Subject: [PATCH 08/68] (doc) Fixed formatting in CONTRIBUTING guidelines --- CONTRIBUTING.md | 103 ++++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 39 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a439335..d849853 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,105 +2,130 @@ First and foremost, thank you! We appreciate that you want to contribute to Cake.Warp, your time is valuable, and your contributions mean a lot to us. - -## Important! +## Important By contributing to this project, you: -* Agree that you have authored 100% of the content -* Agree that you have the necessary rights to the content -* Agree that you have received the necessary permissions from your employer to make the contributions (if applicable) -* Agree that the content you contribute may be provided under the Project license(s) -* Agree that, if you did not author 100% of the content, the appropriate licenses and copyrights have been added along with any other necessary attribution. - +- Agree that you have authored 100% of the content +- Agree that you have the necessary rights to the content +- Agree that you have received the necessary permissions from your employer to make the contributions (if applicable) +- Agree that the content you contribute may be provided under the Project license(s) +- Agree that, if you did not author 100% of the content, the appropriate licenses and copyrights have been added along + with any other necessary attribution. ## Getting started **What does "contributing" mean?** -Creating an issue is the simplest form of contributing to a project. But there are many ways to contribute, including the following: +Creating an issue is the simplest form of contributing to a project. But there are many ways to contribute, +including the following: - Updating or correcting documentation - Feature requests - Bug reports -If you'd like to learn more about contributing in general, the [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) has a lot of useful information. - -**Showing support for Cake.Warp** +If you'd like to learn more about contributing in general, +the [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) +has a lot of useful information. -Please keep in mind that open source software is built by people like you, who spend their free time creating things the rest the community can use. +**Showing support for Cake.Warp** +Please keep in mind that open source software is built by people like you, +who spend their free time creating things the rest the community can use. Don't have time to contribute? No worries, here are some other ways to show your support for Cake.Warp: - star the [project](https://github.com/AdmiringWorm/Cake.Warp) - tweet your support for Cake.Warp - ## Issues -Please only create issues for bug reports or feature requests. Issues discussing any other topics may be closed by the project's maintainers without further explanation. - -Do not create issues about bumping dependencies unless a bug has been identified and you can demonstrate that it effects this library. +Please only create issues for bug reports or feature requests. +Issues discussing any other topics may be closed by the project's maintainers without further explanation. -**Help us to help you** +Do not create issues about bumping dependencies unless a bug has been identified +and you can demonstrate that it effects this library. +**Help us to help you** Remember that we’re here to help, but not to make guesses about what you need help with: - Whatever bug or issue you're experiencing, assume that it will not be as obvious to the maintainers as it is to you. -- Spell it out completely. Keep in mind that maintainers need to think about _all potential use cases_ of a library. It's important that you explain how you're using a library so that maintainers can make that connection and solve the issue. +- Spell it out completely. Keep in mind that maintainers need to think about _all potential use cases_ of a library. + It's important that you explain how you're using a library so that maintainers can make that connection + and solve the issue. -_It can't be understated how frustrating and draining it can be to maintainers to have to ask clarifying questions on the most basic things, before it's even possible to start debugging. Please try to make the best use of everyone's time involved, including yourself, by providing this information up front._ +_It can't be understated how frustrating and draining it can be to maintainers to have to ask +clarifying questions on the most basic things, +before it's even possible to start debugging. +Please try to make the best use of everyone's time involved, including yourself, +by providing this information up front._ ### Before creating an issue -Please try to determine if the issue is caused by an underlying library, and if so, create the issue there. Sometimes this is difficult to know. We only ask that you attempt to give a reasonable attempt to find out. Oftentimes the readme will have advice about where to go to create issues. +Please try to determine if the issue is caused by an underlying library, and if so, create the issue there. +Sometimes this is difficult to know. We only ask that you attempt to give a reasonable attempt to find out. +Oftentimes the readme will have advice about where to go to create issues. Try to follow these guidelines: -- **Avoid creating issues for implementation help** - It's much better for discoverability, SEO, and semantics - to keep the issue tracker focused on bugs and feature requests - to ask implementation-related questions on [stackoverflow.com][so] -- **Investigate the issue** - Search for exising issues (open or closed) that address the issue, and might have even resolved it already. -- **Check the readme** - oftentimes you will find notes about creating issues, and where to go depending on the type of issue. +- **Avoid creating issues for implementation help** - It's much better for discoverability, SEO, and semantics - + to keep the issue tracker focused on bugs and feature requests - + to ask implementation-related questions on [stackoverflow.com][so] +- **Investigate the issue** - Search for exising issues (open or closed) that address the issue, + and might have even resolved it already. +- **Check the readme** - oftentimes you will find notes about creating issues, + and where to go depending on the type of issue. - Create the issue in the appropriate repository. ### Creating an issue -Please be as descriptive as possible when creating an issue. Give us the information we need to successfully answer your question or address your issue by answering the following in your issue: +Please be as descriptive as possible when creating an issue. +Give us the information we need to successfully answer your question or address your issue +by answering the following in your issue: - **description**: (required) What is the bug you're experiencing? How are you using this library/app? - **OS**: (required) what operating system are you on? - **version**: (required) please note the version of Cake.Warp are you using - **Cake Version**: (required) please note the version of Cake you are running your build script with -- **error messages**: (required) please paste any error messages into the issue, or a [gist](https://gist.github.com/) (you may also link to a failing build) +- **error messages**: (required) please paste any error messages into the issue, + or a [gist](https://gist.github.com/) (you may also link to a failing build) - **addins, etc** (if applicable): please list any other addins you're using that may affect the Cake.Warp addin - ### Closing issues -The original poster or the maintainers of Cake.Warp may close an issue at any time. Typically, but not exclusively, issues are closed when: +The original poster or the maintainers of Cake.Warp may close an issue at any time. +Typically, but not exclusively, issues are closed when: - The issue is resolved, and will be released in the next version of Cake.Warp - The project's maintainers have determined the issue is out of scope - An issue is clearly a duplicate of another issue, in which case the duplicate issue will be linked. - A discussion has clearly run its course - ## Next steps -**Tips for creating idiomatic issues** - -Spending just a little extra time to review best practices and brush up on your contributing skills will, at minimum, make your issue easier to read, easier to resolve, and more likely to be found by others who have the same or similar issue in the future. At best, it will open up doors and potential career opportunities by helping you be at your best. +**Tips for creating idiomatic issues** +Spending just a little extra time to review best practices and brush up on your contributing skills will, at minimum, +make your issue easier to read, easier to resolve, +and more likely to be found by others who have the same or similar issue in the future. +At best, it will open up doors and potential career opportunities by helping you be at your best. The following resources were hand-picked to help you be the most effective contributor you can be: -- The [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) is a great place for newcomers to start, but there is also information for experienced contributors there. -- Take some time to learn basic markdown. We can't stress this enough. Don't start pasting code into GitHub issues before you've taken a moment to review this [markdown cheatsheet](https://gist.github.com/jonschlinkert/5854601) -- The GitHub guide to [basic markdown](https://help.github.com/articles/markdown-basics/) is another great markdown resource. -- Learn about [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown/). And if you want to really go above and beyond, read [mastering markdown](https://guides.github.com/features/mastering-markdown/). +- The [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) + is a great place for newcomers to start, but there is also information for experienced contributors there. +- Take some time to learn basic markdown. We can't stress this enough. + Don't start pasting code into GitHub issues before you've taken a moment to review this + [markdown cheatsheet](https://gist.github.com/jonschlinkert/5854601) +- The GitHub guide to [basic markdown](https://help.github.com/articles/markdown-basics/) + is another great markdown resource. +- Learn about [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown/). + And if you want to really go above and beyond, + read [mastering markdown](https://guides.github.com/features/mastering-markdown/). At the very least, please try to: -- Use backticks to wrap code. This ensures that it retains its formatting and isn't modified when it's rendered by GitHub, and makes the code more readable to others +- Use backticks to wrap code. + This ensures that it retains its formatting and isn't modified when it's rendered by GitHub, + and makes the code more readable to others - When applicable, use syntax highlighting by adding the correct language name after the first "code fence" - -[so]: http://stackoverflow.com/questions/tagged/Cake.Warp +[so]: http://stackoverflow.com/questions/tagged/cakebuild From 24f3d25fff3660372a3058f20f926f413baf5ecd Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 12:31:48 +0200 Subject: [PATCH 09/68] (maint) Created initial project structure --- src/Cake.Warp.Demo/Cake.Warp.Demo.csproj | 11 +++ src/Cake.Warp.Demo/Program.cs | 12 +++ .../Cake.Warp.IntegrationTests.csproj | 20 +++++ src/Cake.Warp.IntegrationTests/UnitTest1.cs | 18 +++++ src/Cake.Warp.Tests/Cake.Warp.Tests.csproj | 22 ++++++ src/Cake.Warp.Tests/UnitTest1.cs | 18 +++++ src/Cake.Warp.sln | 76 +++++++++++++++++++ src/Cake.Warp/Cake.Warp.csproj | 15 ++++ src/Cake.Warp/Class1.cs | 8 ++ src/Cake.Warp/downloads.targets | 36 +++++++++ 10 files changed, 236 insertions(+) create mode 100644 src/Cake.Warp.Demo/Cake.Warp.Demo.csproj create mode 100644 src/Cake.Warp.Demo/Program.cs create mode 100644 src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj create mode 100644 src/Cake.Warp.IntegrationTests/UnitTest1.cs create mode 100644 src/Cake.Warp.Tests/Cake.Warp.Tests.csproj create mode 100644 src/Cake.Warp.Tests/UnitTest1.cs create mode 100644 src/Cake.Warp.sln create mode 100644 src/Cake.Warp/Cake.Warp.csproj create mode 100644 src/Cake.Warp/Class1.cs create mode 100644 src/Cake.Warp/downloads.targets diff --git a/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj new file mode 100644 index 0000000..5d5b303 --- /dev/null +++ b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj @@ -0,0 +1,11 @@ + + + + Exe + netcoreapp2.1;net461 + 7.3 + true + win-x64;linux-x64;osx-x64 + + + diff --git a/src/Cake.Warp.Demo/Program.cs b/src/Cake.Warp.Demo/Program.cs new file mode 100644 index 0000000..6f4f6ae --- /dev/null +++ b/src/Cake.Warp.Demo/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace Cake.Warp.Demo +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("I should work from a single binary!"); + } + } +} diff --git a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj new file mode 100644 index 0000000..97c75f7 --- /dev/null +++ b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp2.1 + netcoreapp2.1;net461 + + false + + + + + + + + + + + + + diff --git a/src/Cake.Warp.IntegrationTests/UnitTest1.cs b/src/Cake.Warp.IntegrationTests/UnitTest1.cs new file mode 100644 index 0000000..794c408 --- /dev/null +++ b/src/Cake.Warp.IntegrationTests/UnitTest1.cs @@ -0,0 +1,18 @@ +using NUnit.Framework; + +namespace Tests +{ + public class Tests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } + } +} \ No newline at end of file diff --git a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj new file mode 100644 index 0000000..4f62b5b --- /dev/null +++ b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj @@ -0,0 +1,22 @@ + + + + netcoreapp2.1 + netcoreapp2.1;net461 + 7.3 + + false + + + + + + + + + + + + + + diff --git a/src/Cake.Warp.Tests/UnitTest1.cs b/src/Cake.Warp.Tests/UnitTest1.cs new file mode 100644 index 0000000..794c408 --- /dev/null +++ b/src/Cake.Warp.Tests/UnitTest1.cs @@ -0,0 +1,18 @@ +using NUnit.Framework; + +namespace Tests +{ + public class Tests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } + } +} \ No newline at end of file diff --git a/src/Cake.Warp.sln b/src/Cake.Warp.sln new file mode 100644 index 0000000..b2da769 --- /dev/null +++ b/src/Cake.Warp.sln @@ -0,0 +1,76 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Warp", "Cake.Warp\Cake.Warp.csproj", "{9E1F6E53-99ED-478C-BC0B-0D17101A9283}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Warp.Tests", "Cake.Warp.Tests\Cake.Warp.Tests.csproj", "{FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Warp.Demo", "Cake.Warp.Demo\Cake.Warp.Demo.csproj", "{6057476B-C66D-4E77-9542-CD8816A53D2D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Warp.IntegrationTests", "Cake.Warp.IntegrationTests\Cake.Warp.IntegrationTests.csproj", "{AEA956C0-D607-4D6A-9983-BD3BA8F260F6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Debug|x64.ActiveCfg = Debug|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Debug|x64.Build.0 = Debug|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Debug|x86.ActiveCfg = Debug|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Debug|x86.Build.0 = Debug|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Release|Any CPU.Build.0 = Release|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Release|x64.ActiveCfg = Release|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Release|x64.Build.0 = Release|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Release|x86.ActiveCfg = Release|Any CPU + {9E1F6E53-99ED-478C-BC0B-0D17101A9283}.Release|x86.Build.0 = Release|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Debug|x64.ActiveCfg = Debug|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Debug|x64.Build.0 = Debug|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Debug|x86.ActiveCfg = Debug|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Debug|x86.Build.0 = Debug|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Release|Any CPU.Build.0 = Release|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Release|x64.ActiveCfg = Release|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Release|x64.Build.0 = Release|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Release|x86.ActiveCfg = Release|Any CPU + {FEFD1EDB-D1AA-4EBE-B6CA-A3C6E6BBDF32}.Release|x86.Build.0 = Release|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Debug|x64.ActiveCfg = Debug|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Debug|x64.Build.0 = Debug|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Debug|x86.ActiveCfg = Debug|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Debug|x86.Build.0 = Debug|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Release|Any CPU.Build.0 = Release|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Release|x64.ActiveCfg = Release|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Release|x64.Build.0 = Release|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Release|x86.ActiveCfg = Release|Any CPU + {6057476B-C66D-4E77-9542-CD8816A53D2D}.Release|x86.Build.0 = Release|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Debug|x64.ActiveCfg = Debug|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Debug|x64.Build.0 = Debug|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Debug|x86.ActiveCfg = Debug|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Debug|x86.Build.0 = Debug|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Release|Any CPU.Build.0 = Release|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Release|x64.ActiveCfg = Release|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Release|x64.Build.0 = Release|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Release|x86.ActiveCfg = Release|Any CPU + {AEA956C0-D607-4D6A-9983-BD3BA8F260F6}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj new file mode 100644 index 0000000..af9b30a --- /dev/null +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -0,0 +1,15 @@ + + + netstandard2.0;net461 + 7.3 + + + + + runtime; build; native; contentfiles; analyzers + all + + + + + diff --git a/src/Cake.Warp/Class1.cs b/src/Cake.Warp/Class1.cs new file mode 100644 index 0000000..c0945cf --- /dev/null +++ b/src/Cake.Warp/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace Cake.Warp +{ + public class Class1 + { + } +} diff --git a/src/Cake.Warp/downloads.targets b/src/Cake.Warp/downloads.targets new file mode 100644 index 0000000..d3c3ac4 --- /dev/null +++ b/src/Cake.Warp/downloads.targets @@ -0,0 +1,36 @@ + + + v0.3.0 + $(MSBuildProjectDirectory)/warp + linux-warp-packer + macos-warp-packer + windows-warp-packer.exe + + + + + + + + + + + + + + + + + + + + + + + From 58fde44ae5b05f8a8af1244de0fe2164b568920c Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 14:20:41 +0200 Subject: [PATCH 10/68] (build) Added cake build files --- build.ps1 | 256 ++++++++++++++++++++++++++++++++++++++++++ build.sh | 117 +++++++++++++++++++ setup.cake | 21 ++++ tools/packages.config | 4 + 4 files changed, 398 insertions(+) create mode 100644 build.ps1 create mode 100755 build.sh create mode 100644 setup.cake create mode 100644 tools/packages.config diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..aafd519 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,256 @@ +########################################################################## +# This is the Cake bootstrapper script for PowerShell. +# This file was downloaded from https://github.com/cake-build/resources +# Feel free to change this file to fit your needs. +########################################################################## + +<# + +.SYNOPSIS +This is a Powershell script to bootstrap a Cake build. + +.DESCRIPTION +This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) +and execute your Cake build script with the parameters you provide. + +.PARAMETER Script +The build script to execute. +.PARAMETER Target +The build script target to run. +.PARAMETER Configuration +The build configuration to use. +.PARAMETER Verbosity +Specifies the amount of information to be displayed. +.PARAMETER ShowDescription +Shows description about tasks. +.PARAMETER DryRun +Performs a dry run. +.PARAMETER SkipToolPackageRestore +Skips restoring of packages. +.PARAMETER ScriptArgs +Remaining arguments are added here. + +.LINK +https://cakebuild.net + +#> + +[CmdletBinding()] +Param( + [string]$Script = "setup.cake", + [string]$Target, + [string]$Configuration, + [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] + [string]$Verbosity, + [switch]$ShowDescription, + [Alias("WhatIf", "Noop")] + [switch]$DryRun, + [switch]$SkipToolPackageRestore, + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$ScriptArgs +) + +# Attempt to set highest encryption available for SecurityProtocol. +# PowerShell will not set this by default (until maybe .NET 4.6.x). This +# will typically produce a message for PowerShell v2 (just an info +# message though) +try { + # Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48) + # Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't + # exist in .NET 4.0, even though they are addressable if .NET 4.5+ is + # installed (.NET 4.5 is an in-place upgrade). + # PowerShell Core already has support for TLS 1.2 so we can skip this if running in that. + if (-not $IsCoreCLR) { + [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48 + } + } catch { + Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3' + } + +[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null +function MD5HashFile([string] $filePath) +{ + if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) + { + return $null + } + + [System.IO.Stream] $file = $null; + [System.Security.Cryptography.MD5] $md5 = $null; + try + { + $md5 = [System.Security.Cryptography.MD5]::Create() + $file = [System.IO.File]::OpenRead($filePath) + return [System.BitConverter]::ToString($md5.ComputeHash($file)) + } + finally + { + if ($file -ne $null) + { + $file.Dispose() + } + } +} + +function GetProxyEnabledWebClient +{ + $wc = New-Object System.Net.WebClient + $proxy = [System.Net.WebRequest]::GetSystemWebProxy() + $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials + $wc.Proxy = $proxy + return $wc +} + +Write-Host "Preparing to run build script..." + +if(!$PSScriptRoot){ + $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent +} + +$TOOLS_DIR = Join-Path $PSScriptRoot "tools" +$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins" +$MODULES_DIR = Join-Path $TOOLS_DIR "Modules" +$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" +$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" +$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" +$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" +$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" +$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config" +$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config" + +# Make sure tools folder exists +if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { + Write-Verbose -Message "Creating tools directory..." + New-Item -Path $TOOLS_DIR -Type Directory | Out-Null +} + +# Make sure that packages.config exist. +if (!(Test-Path $PACKAGES_CONFIG)) { + Write-Verbose -Message "Downloading packages.config..." + try { + $wc = GetProxyEnabledWebClient + $wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) + } catch { + Throw "Could not download packages.config." + } +} + +# Try find NuGet.exe in path if not exists +if (!(Test-Path $NUGET_EXE)) { + Write-Verbose -Message "Trying to find nuget.exe in PATH..." + $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) } + $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 + if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { + Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." + $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName + } +} + +# Try download NuGet.exe if not exists +if (!(Test-Path $NUGET_EXE)) { + Write-Verbose -Message "Downloading NuGet.exe..." + try { + $wc = GetProxyEnabledWebClient + $wc.DownloadFile($NUGET_URL, $NUGET_EXE) + } catch { + Throw "Could not download NuGet.exe." + } +} + +# Save nuget.exe path to environment to be available to child processed +$env:NUGET_EXE = $NUGET_EXE +$env:NUGET_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { + "mono `"$NUGET_EXE`"" +} else { + "`"$NUGET_EXE`"" +} + +# Restore tools from NuGet? +if(-Not $SkipToolPackageRestore.IsPresent) { + Push-Location + Set-Location $TOOLS_DIR + + # Check for changes in packages.config and remove installed tools if true. + [string] $md5Hash = MD5HashFile $PACKAGES_CONFIG + if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or + ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { + Write-Verbose -Message "Missing or changed package.config hash..." + Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery | + Remove-Item -Recurse + } + + Write-Verbose -Message "Restoring tools from NuGet..." + + $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" + + if ($LASTEXITCODE -ne 0) { + Throw "An error occurred while restoring NuGet tools." + } + else + { + $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" + } + Write-Verbose -Message ($NuGetOutput | Out-String) + + Pop-Location +} + +# Restore addins from NuGet +if (Test-Path $ADDINS_PACKAGES_CONFIG) { + Push-Location + Set-Location $ADDINS_DIR + + Write-Verbose -Message "Restoring addins from NuGet..." + $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" + + if ($LASTEXITCODE -ne 0) { + Throw "An error occurred while restoring NuGet addins." + } + + Write-Verbose -Message ($NuGetOutput | Out-String) + + Pop-Location +} + +# Restore modules from NuGet +if (Test-Path $MODULES_PACKAGES_CONFIG) { + Push-Location + Set-Location $MODULES_DIR + + Write-Verbose -Message "Restoring modules from NuGet..." + $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" + + if ($LASTEXITCODE -ne 0) { + Throw "An error occurred while restoring NuGet modules." + } + + Write-Verbose -Message ($NuGetOutput | Out-String) + + Pop-Location +} + +# Make sure that Cake has been installed. +if (!(Test-Path $CAKE_EXE)) { + Throw "Could not find Cake.exe at $CAKE_EXE" +} + +$CAKE_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { + "mono `"$CAKE_EXE`"" +} else { + "`"$CAKE_EXE`"" +} + + +# Build Cake arguments +$cakeArguments = @("$Script"); +if ($Target) { $cakeArguments += "-target=$Target" } +if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } +if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } +if ($ShowDescription) { $cakeArguments += "-showdescription" } +if ($DryRun) { $cakeArguments += "-dryrun" } +$cakeArguments += $ScriptArgs + +# Start Cake +Write-Host "Running build script..." +Invoke-Expression "& $CAKE_EXE_INVOCATION $($cakeArguments -join " ")" +exit $LASTEXITCODE diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..01d34b4 --- /dev/null +++ b/build.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +########################################################################## +# This is the Cake bootstrapper script for Linux and OS X. +# This file was downloaded from https://github.com/cake-build/resources +# Feel free to change this file to fit your needs. +########################################################################## + +# Define directories. +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +TOOLS_DIR=$SCRIPT_DIR/tools +ADDINS_DIR=$TOOLS_DIR/Addins +MODULES_DIR=$TOOLS_DIR/Modules +NUGET_EXE=$TOOLS_DIR/nuget.exe +CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe +PACKAGES_CONFIG=$TOOLS_DIR/packages.config +PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum +ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config +MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config + +# Define md5sum or md5 depending on Linux/OSX +MD5_EXE= +if [[ "$(uname -s)" == "Darwin" ]]; then + MD5_EXE="md5 -r" +else + MD5_EXE="md5sum" +fi + +# Define default arguments. +SCRIPT="setup.cake" +CAKE_ARGUMENTS=() + +# Parse arguments. +for i in "$@"; do + case $1 in + -s|--script) SCRIPT="$2"; shift ;; + --) shift; CAKE_ARGUMENTS+=("$@"); break ;; + *) CAKE_ARGUMENTS+=("$1") ;; + esac + shift +done + +# Make sure the tools folder exist. +if [ ! -d "$TOOLS_DIR" ]; then + mkdir "$TOOLS_DIR" +fi + +# Make sure that packages.config exist. +if [ ! -f "$TOOLS_DIR/packages.config" ]; then + echo "Downloading packages.config..." + curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages + if [ $? -ne 0 ]; then + echo "An error occurred while downloading packages.config." + exit 1 + fi +fi + +# Download NuGet if it does not exist. +if [ ! -f "$NUGET_EXE" ]; then + echo "Downloading NuGet..." + curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + if [ $? -ne 0 ]; then + echo "An error occurred while downloading nuget.exe." + exit 1 + fi +fi + +# Restore tools from NuGet. +pushd "$TOOLS_DIR" >/dev/null +if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then + find . -type d ! -name . ! -name 'Cake.Bakery' | xargs rm -rf +fi + +mono "$NUGET_EXE" install -ExcludeVersion +if [ $? -ne 0 ]; then + echo "Could not restore NuGet tools." + exit 1 +fi + +$MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5" + +popd >/dev/null + +# Restore addins from NuGet. +if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then + pushd "$ADDINS_DIR" >/dev/null + + mono "$NUGET_EXE" install -ExcludeVersion + if [ $? -ne 0 ]; then + echo "Could not restore NuGet addins." + exit 1 + fi + + popd >/dev/null +fi + +# Restore modules from NuGet. +if [ -f "$MODULES_PACKAGES_CONFIG" ]; then + pushd "$MODULES_DIR" >/dev/null + + mono "$NUGET_EXE" install -ExcludeVersion + if [ $? -ne 0 ]; then + echo "Could not restore NuGet modules." + exit 1 + fi + + popd >/dev/null +fi + +# Make sure that Cake has been installed. +if [ ! -f "$CAKE_EXE" ]; then + echo "Could not find Cake.exe at '$CAKE_EXE'." + exit 1 +fi + +# Start Cake +exec mono "$CAKE_EXE" $SCRIPT "${CAKE_ARGUMENTS[@]}" diff --git a/setup.cake b/setup.cake new file mode 100644 index 0000000..0179d82 --- /dev/null +++ b/setup.cake @@ -0,0 +1,21 @@ +#load nuget:?package=Cake.Recipe&version=1.0.0 + +Environment.SetVariableNames(); + +BuildParameters.SetParameters(context: Context, + buildSystem: BuildSystem, + sourceDirectoryPath: "./src", + title: "Cake.Warp", + repositoryOwner: "cake-contrib", + repositoryName: "Cake.Warp", + appVeyorAccountName: "cakecontrib", + shouldRunGitVersion: true); + +BuildParameters.PrintParameters(Context); + +ToolSettings.SetToolSettings(context: Context); + +// TODO: Add a task to publish Demo project, +// so we can run integration tests against it. + +Build.RunDotNetCore(); diff --git a/tools/packages.config b/tools/packages.config new file mode 100644 index 0000000..f27ab48 --- /dev/null +++ b/tools/packages.config @@ -0,0 +1,4 @@ + + + + From 52161464fee6da0525a335caacf621c797efe17f Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 14:42:43 +0200 Subject: [PATCH 11/68] Testing if appveyor will exclude env variables --- .appveyor.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..3380182 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,39 @@ +image: + - Ubuntu +# - Visual Studio 2017 +version: '{build}' +pull_requests: + do_not_increment_build_number: true +skip_branch_with_pr: true +configuration: Release +platform: Any CPU + +matrix: + fast_finish: true + +build: off +test: off +deploy: off + +build_script: +- ps: echo "$env:CONFIGURATION" +- ps: echo "$env:PLATFORM" +- sh: echo "$PLATFORM" +- sh: echo "$CONFIGURATION" + + +for: + +- + matrix: + only: + - image: Ubuntu + environment: + GITHUB_PASSWORD: + MYGET_API_KEY: + GITTER_TOKEN: + SLACK_TOKEN: + TWITTER_CONSUMER_KEY: + TWITTER_ACCESS_TOKEN: + NUGET_API_KEY: + WYAM_ACCESS_TOKEN: From 58695c0c6253889bef731fded52c8698bc33c682 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 15:47:53 +0200 Subject: [PATCH 12/68] (GH-2) Added appveyor build configuration --- .appveyor.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 3380182..2ca07db 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,12 +1,13 @@ image: - Ubuntu -# - Visual Studio 2017 + - Visual Studio 2017 version: '{build}' pull_requests: do_not_increment_build_number: true skip_branch_with_pr: true configuration: Release -platform: Any CPU +environment: + APPVEYOR_YML_DISABLE_PS_LINUX: true matrix: fast_finish: true @@ -16,12 +17,14 @@ test: off deploy: off build_script: -- ps: echo "$env:CONFIGURATION" -- ps: echo "$env:PLATFORM" -- sh: echo "$PLATFORM" -- sh: echo "$CONFIGURATION" + - ps: .\build.ps1 -Target AppVeyor -Configuration $env:CONFIGURATION + - sh: ./build.sh --target=AppVeyor --configuration=$CONFIGURATION +cache: + - 'tools -> setup.cake,tools/packages.config' + - 'src/Cake.Warp/warp -> src/Cake.Warp/Cake.Warp.csproj' + for: - From 0233c95ba306d0bc1fb9a1fbc49eb7d8bb0e3582 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 16:15:50 +0200 Subject: [PATCH 13/68] (build) Corrected indent style for yaml files specifically, using tabs made appveyor think the configuration was invalid --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 9e48097..e11dfa7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,7 +20,7 @@ end_of_line = crlf [*.{yml,yaml}] indent_size = 2 -indent_style = tab +indent_style = space # Files that need to be crlf eol to work [tasks.json] From 4e68deacf945b8a959457af4ec60374d1e967afc Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 16:23:25 +0200 Subject: [PATCH 14/68] (build) Renamed cake build script to recipe.cake Co-authored-by: Gary Ewan Park --- .appveyor.yml | 2 +- build.ps1 | 2 +- build.sh | 2 +- setup.cake => recipe.cake | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename setup.cake => recipe.cake (100%) diff --git a/.appveyor.yml b/.appveyor.yml index 2ca07db..80416a0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -22,7 +22,7 @@ build_script: cache: - - 'tools -> setup.cake,tools/packages.config' + - 'tools -> recipe.cake,tools/packages.config' - 'src/Cake.Warp/warp -> src/Cake.Warp/Cake.Warp.csproj' for: diff --git a/build.ps1 b/build.ps1 index aafd519..4514a51 100644 --- a/build.ps1 +++ b/build.ps1 @@ -37,7 +37,7 @@ https://cakebuild.net [CmdletBinding()] Param( - [string]$Script = "setup.cake", + [string]$Script = "recipe.cake", [string]$Target, [string]$Configuration, [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] diff --git a/build.sh b/build.sh index 01d34b4..7fc4599 100755 --- a/build.sh +++ b/build.sh @@ -27,7 +27,7 @@ else fi # Define default arguments. -SCRIPT="setup.cake" +SCRIPT="recipe.cake" CAKE_ARGUMENTS=() # Parse arguments. diff --git a/setup.cake b/recipe.cake similarity index 100% rename from setup.cake rename to recipe.cake From 67eb2c8e9e067979eaf7a3c41489fc97d486f024 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 16:29:34 +0200 Subject: [PATCH 15/68] (build) Fixed indention issues in yaml files --- .codecov.yml | 12 +++++------ GitReleaseManager.yaml | 46 +++++++++++++++++++++--------------------- GitVersion.yml | 6 +++--- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index ffd6126..70f88e4 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,12 +1,12 @@ codecov: - ci: # Ignore builds on travis, until it is supported in codecov-exe - - !travis-ci + ci: # Ignore builds on travis, until it is supported in codecov-exe + - !travis-ci coverage: - range: "85...100" + range: "85...100" - status: - changes: yes + status: + changes: yes comment: - require_changes: yes + require_changes: yes diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml index bcd152f..2ff7a92 100644 --- a/GitReleaseManager.yaml +++ b/GitReleaseManager.yaml @@ -1,29 +1,29 @@ create: - include-footer: true - footer-heading: Where to get it - footer-content: > - You can download this release from - [nuget](https://nuget.org/packages/Cake.Warp/{milestone}, - or you can just reference it in a cake build script - with `#addin nuget:?package?Cake.Warp&version={milestone}`. - footer-includes-milestone: true - milestone-replace-text: '{milestone}' + include-footer: true + footer-heading: Where to get it + footer-content: > + You can download this release from + [nuget](https://nuget.org/packages/Cake.Warp/{milestone}, + or you can just reference it in a cake build script + with `#addin nuget:?package?Cake.Warp&version={milestone}`. + footer-includes-milestone: true + milestone-replace-text: '{milestone}' export: - include-created-date-in-title: true - created-date-string-format: yyyy-MM-dd - perform-regex-removal: true - regex-text: '### Where to get it(\r?\n)*You can .*\)' - multiline-regex: true + include-created-date-in-title: true + created-date-string-format: yyyy-MM-dd + perform-regex-removal: true + regex-text: '### Where to get it(\r?\n)*You can .*\)' + multiline-regex: true issue-labels-include: - - Breaking Change - - Bug - - Enhancement - - Feature - - Documentation + - Breaking Change + - Bug + - Enhancement + - Feature + - Documentation issue-labels-exclude: - - Build + - Build issue-labels-alias: - - name: Documentation - header: Documentation - plural: Documentation + - name: Documentation + header: Documentation + plural: Documentation diff --git a/GitVersion.yml b/GitVersion.yml index 940fc72..895e9f7 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,6 +1,6 @@ mode: ContinuousDelivery branches: - dev(elop)?(ment)?$: - tag: alpha + dev(elop)?(ment)?$: + tag: alpha ignore: - sha: [] + sha: [] From 3434ccd347d0e3f49c28fd248bf2a040f9e4f824 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 17:01:57 +0200 Subject: [PATCH 16/68] (build) Changed to download warp binaries in cake script --- .appveyor.yml | 2 +- recipe.cake | 22 ++++++++++++++++++++ src/Cake.Warp/Cake.Warp.csproj | 9 +++++---- src/Cake.Warp/downloads.targets | 36 --------------------------------- 4 files changed, 28 insertions(+), 41 deletions(-) delete mode 100644 src/Cake.Warp/downloads.targets diff --git a/.appveyor.yml b/.appveyor.yml index 80416a0..03f4323 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -23,7 +23,7 @@ build_script: cache: - 'tools -> recipe.cake,tools/packages.config' - - 'src/Cake.Warp/warp -> src/Cake.Warp/Cake.Warp.csproj' + - 'src/Cake.Warp/warp -> recipe.cake' for: diff --git a/recipe.cake b/recipe.cake index 0179d82..f3dc8bd 100644 --- a/recipe.cake +++ b/recipe.cake @@ -1,5 +1,14 @@ #load nuget:?package=Cake.Recipe&version=1.0.0 +const string WarpVersion = "0.3.0"; +DirectoryPath downloadDir = (DirectoryPath)"./src/Cake.Warp/warp"; +const string baseDownloadFormat = "https://github.com/dgiagio/warp/releases/download/v" + WarpVersion + "/{0}.warp-packer"; +readonly string[] downloadUrls = { + string.Format(baseDownloadFormat, "linux-x64"), + string.Format(baseDownloadFormat, "macos-x64"), + string.Format(baseDownloadFormat, "windows-x64") + ".exe" +}; + Environment.SetVariableNames(); BuildParameters.SetParameters(context: Context, @@ -18,4 +27,17 @@ ToolSettings.SetToolSettings(context: Context); // TODO: Add a task to publish Demo project, // so we can run integration tests against it. +Task("Download-Warp") + .IsDependeeOf("DotNetCore-Build") + .Does(() => { + EnsureDirectoryExists(downloadDir); +}).DoesForEach(downloadUrls, (url) => +{ + var fileName = url.Split('/').Last(); + var fullFilePath = downloadDir.CombineWithFilePath(fileName); + if (!FileExists(fullFilePath)) { + DownloadFile(url, fullFilePath); + } +}); + Build.RunDotNetCore(); diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index af9b30a..8d9eb88 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -6,10 +6,11 @@ - runtime; build; native; contentfiles; analyzers - all + runtime; build; native; contentfiles; analyzers + all - - + + + diff --git a/src/Cake.Warp/downloads.targets b/src/Cake.Warp/downloads.targets deleted file mode 100644 index d3c3ac4..0000000 --- a/src/Cake.Warp/downloads.targets +++ /dev/null @@ -1,36 +0,0 @@ - - - v0.3.0 - $(MSBuildProjectDirectory)/warp - linux-warp-packer - macos-warp-packer - windows-warp-packer.exe - - - - - - - - - - - - - - - - - - - - - - - From 4cac8185ca8f258deb42cc2b6b2e75acffb2099f Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 18:45:23 +0200 Subject: [PATCH 17/68] (maint) Corrected target frameworks --- src/Cake.Warp.Demo/Cake.Warp.Demo.csproj | 2 +- .../Cake.Warp.IntegrationTests.csproj | 2 +- src/Cake.Warp.Tests/Cake.Warp.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj index 5d5b303..b7714d1 100644 --- a/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj +++ b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1;net461 + netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2 7.3 true win-x64;linux-x64;osx-x64 diff --git a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj index 97c75f7..e0516ad 100644 --- a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj +++ b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj @@ -2,7 +2,7 @@ netcoreapp2.1 - netcoreapp2.1;net461 + netcoreapp2.1;net461 false diff --git a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj index 4f62b5b..54a0590 100644 --- a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj +++ b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj @@ -2,7 +2,7 @@ netcoreapp2.1 - netcoreapp2.1;net461 + netcoreapp2.1;net461 7.3 false From 48c681ae2e28db703dfed2b8eaf462e7ef90888a Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Tue, 7 May 2019 19:04:51 +0200 Subject: [PATCH 18/68] (build) Customised dupFinderExclude pattern --- recipe.cake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index f3dc8bd..03c5b09 100644 --- a/recipe.cake +++ b/recipe.cake @@ -22,7 +22,12 @@ BuildParameters.SetParameters(context: Context, BuildParameters.PrintParameters(Context); -ToolSettings.SetToolSettings(context: Context); +ToolSettings.SetToolSettings(context: Context, + dupFinderExcludePattern: new[] { + "**/*Tests/**/*.cs", + "**/*.Demo/**/*.cs", + "**/*.AssemblyInfo.cs" + }); // TODO: Add a task to publish Demo project, // so we can run integration tests against it. From a5da3b09565e0d4613d7db448b3791a51cf217a2 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 08:58:28 +0200 Subject: [PATCH 19/68] (build) Disabled gitlink in recipe setup --- recipe.cake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index 03c5b09..a769d7c 100644 --- a/recipe.cake +++ b/recipe.cake @@ -18,7 +18,8 @@ BuildParameters.SetParameters(context: Context, repositoryOwner: "cake-contrib", repositoryName: "Cake.Warp", appVeyorAccountName: "cakecontrib", - shouldRunGitVersion: true); + shouldRunGitVersion: true, + shouldExecuteGitLink: false); BuildParameters.PrintParameters(Context); From 2957724733fc53882faa84a8cd3d416ff6b6689e Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 18:15:53 +0200 Subject: [PATCH 20/68] (GH-2) Added config script for travis ci --- .appveyor.yml | 5 +++++ .travis.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .travis.yml diff --git a/.appveyor.yml b/.appveyor.yml index 03f4323..331f01e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,6 +9,11 @@ configuration: Release environment: APPVEYOR_YML_DISABLE_PS_LINUX: true +branches: + except: + - ci/travis + - /^dependabot\/.*/ + matrix: fast_finish: true diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..345915c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: csharp +dist: xenial +os: + - linux + - osx +mono: latest +dotnet: 2.2.106 + +cache: + directories: + - tools + - src/Cake.Warp/warp +env: + global: + - DOTNET_CLI_TELEMETRY_OPTOUT: 1 + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true +git: + depth: false + +branches: + except: + - ci/appveyor + - /^dependabot\/.*/ + +script: + - ./build.sh From 0362bb76227e649cde9cdbf1ac33daf589e5e42b Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 18:53:54 +0200 Subject: [PATCH 21/68] (build) Testing if travis accepts latest for dotnet --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 345915c..57d8a9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ os: - linux - osx mono: latest -dotnet: 2.2.106 +dotnet: latest cache: directories: From e77931382dab8b495dbdea7959241af8f25e59c7 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 19:29:15 +0200 Subject: [PATCH 22/68] (build) Changed to .NET Core 2.1 on travis --- .travis.yml | 2 +- src/Cake.Warp.Demo/Cake.Warp.Demo.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 57d8a9d..357dfe6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ os: - linux - osx mono: latest -dotnet: latest +dotnet: 2.1.603 cache: directories: diff --git a/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj index b7714d1..c4bf75a 100644 --- a/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj +++ b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2 + netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1 7.3 true win-x64;linux-x64;osx-x64 From 228e04a18bd9482e7d3cc911326a4ebaa49186b0 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 20:17:05 +0200 Subject: [PATCH 23/68] (GH-2) Added first iteration of mergify settings --- .mergify.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000..f2c9d64 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,39 @@ +pull_request_rules: + - name: Add Documentation label for documentation changes, but not in source + conditions: + - "files~=^(docs/.*|README.md|CODE_OF_CONDUCT.md|CONTRIBUTING.md)$" + - "-files~=*src/Cake.Warp/.*$" + actions: + label: + add: ["Documentation"] + - name: Add build label when no change in source, and not in documentation + conditions: + - "-files~=^(docs/.*|README.md|CODE_OF_CONDUCT.md|CONTRIBUTING.md)$" + - "-files~=*src/Cake.Warp/.*$" + actions: + label: + add: ["Build"] + - name: "Add Breaking change when Cake.Core is mentioned in title" + conditions: + - "title~=Cake.Core" + actions: + label: + add: ["Breaking Change"] + remove: ["Build"] # In case dependabot was the one that opened this + # Although we can not have mergify auto-merge PR's (because we require GPG signature) + # We still want this rule, in case mergify suddenly signs commits. + - name: "Merge Pull Request when CI passes, and no outstanding issues" + conditions: + - "status-success=continuous-integration/appveyor/pr" + - "status-success=continuous-integration/travis-ci/pr" + - "#approved-reviews-by>=1" + - "#review-requested=0" + - "#changes-requested-reviews-by=0" + - "#commented-reviews-by=0" + actions: + comment: + message: "Thank you for your contribution, this PR will be merged by a human collaborator soon!" + - name: delete head branch after merge + conditions: [] + actions: + delete_head_branch: {} From 8d9e03d00f7677cae204b6322cc1075ee1367cb9 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 21:33:47 +0200 Subject: [PATCH 24/68] (docs) Added xml documentation generation --- src/Cake.Warp/Cake.Warp.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 8d9eb88..265376a 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -2,6 +2,7 @@ netstandard2.0;net461 7.3 + true From b467727614e4e5201277529da88b50af1ec0f2a5 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 21:37:03 +0200 Subject: [PATCH 25/68] (build) Added code analysis to main project --- src/Cake.Warp/Cake.Warp.csproj | 2 ++ src/Cake.Warp/Cake.Warp.ruleset | 9 +++++++++ src/Cake.Warp/stylecop.json | 11 +++++++++++ 3 files changed, 22 insertions(+) create mode 100644 src/Cake.Warp/Cake.Warp.ruleset create mode 100644 src/Cake.Warp/stylecop.json diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 265376a..3cd15ab 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -3,6 +3,8 @@ netstandard2.0;net461 7.3 true + true + Cake.Warp.ruleset diff --git a/src/Cake.Warp/Cake.Warp.ruleset b/src/Cake.Warp/Cake.Warp.ruleset new file mode 100644 index 0000000..65ee55c --- /dev/null +++ b/src/Cake.Warp/Cake.Warp.ruleset @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/Cake.Warp/stylecop.json b/src/Cake.Warp/stylecop.json new file mode 100644 index 0000000..f2ada18 --- /dev/null +++ b/src/Cake.Warp/stylecop.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "layoutRules": { + "newlineAtEndOfFile": "require" + }, + "documentationRules": { + "xmlHeader": false + } + } +} From 6d08d4b98a3024be779ba1def29120e86661fde3 Mon Sep 17 00:00:00 2001 From: "Kim J. Nordmo" Date: Fri, 10 May 2019 00:18:47 +0200 Subject: [PATCH 26/68] (docs) Added requirement regarding gpg signed commits --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4abb98a..a798f57 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ PRs accepted. Cake.Warp follows the [Contributor Covenant](https://www.contributor-covenant.org/version/1/4/code-of-conduct) Code of Conduct. +Commits to the repository is required to be signed with a valid GPG key with the contributors email addresses. + Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification. Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): From 51e71e3eca1258934f9d310f2e3ce4f7e6d8b58e Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 14:26:38 +0200 Subject: [PATCH 27/68] (GH-#) Commit summary #Commit body #Co-authored-by: GITHUB_USERNAME ## Remove the commented lines you want to use (GH-5) Changed addin to target cake 0.28.0 fixes #5 --- src/Cake.Warp.Tests/Cake.Warp.Tests.csproj | 1 + src/Cake.Warp/Cake.Warp.csproj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj index 54a0590..e19c6c8 100644 --- a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj +++ b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj @@ -10,6 +10,7 @@ + diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 3cd15ab..99e70f0 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -7,7 +7,7 @@ Cake.Warp.ruleset - + runtime; build; native; contentfiles; analyzers all From 7a6414bfeb6b0a51a2a4184577ee9f1f28b4af76 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 14:27:45 +0200 Subject: [PATCH 28/68] (GH-#) Commit summary #Commit body #Co-authored-by: GITHUB_USERNAME ## Remove the commented lines you want to use (build) Added missing package reference in integration tests --- src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj index e0516ad..de62457 100644 --- a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj +++ b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj @@ -8,6 +8,7 @@ + From c050d607a1ebd22209fcfd8d29724eb86647ee70 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 17:50:14 +0200 Subject: [PATCH 29/68] (build) Corrected tasks.json eol --- .gitattributes | 2 +- .vscode/tasks.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 69cc00f..aca3da0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,7 +17,7 @@ *.sln text eol=crlf *.csproj text eol=crlf -task.json text eol=crlf +tasks.json text eol=crlf # # Exclude files from exporting diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ddb59b8..f82bc73 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -33,6 +33,7 @@ "watch", "--project", "${workspaceFolder}/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj", + "--verbose", "test" ], "problemMatcher": "$tsc" From 298ec7a5d8d0b8abc5ca50da7c30b2272721be75 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 21:25:13 +0200 Subject: [PATCH 30/68] (doc) Corrected link to repository --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d849853..91d5fcd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ who spend their free time creating things the rest the community can use. Don't have time to contribute? No worries, here are some other ways to show your support for Cake.Warp: -- star the [project](https://github.com/AdmiringWorm/Cake.Warp) +- star the [project](https://github.com/cake-contrib/Cake.Warp) - tweet your support for Cake.Warp ## Issues From 17e200d51f0c75bdc2bc801f58ef6ebba200b1b6 Mon Sep 17 00:00:00 2001 From: "Kim J. Nordmo" Date: Fri, 10 May 2019 21:27:23 +0200 Subject: [PATCH 31/68] (build) Corrected status settings for mergify --- .mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index f2c9d64..0eb9c87 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -25,7 +25,7 @@ pull_request_rules: - name: "Merge Pull Request when CI passes, and no outstanding issues" conditions: - "status-success=continuous-integration/appveyor/pr" - - "status-success=continuous-integration/travis-ci/pr" + - "status-success=continuous-integration/travis-ci" - "#approved-reviews-by>=1" - "#review-requested=0" - "#changes-requested-reviews-by=0" From 3d91cdc020fd33b1bfaf41943c67cc7ea9f9d770 Mon Sep 17 00:00:00 2001 From: "Kim J. Nordmo" Date: Fri, 10 May 2019 21:44:10 +0200 Subject: [PATCH 32/68] (build) Corrected regex in mergify settings --- .mergify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index 0eb9c87..6de8cbf 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -2,14 +2,14 @@ pull_request_rules: - name: Add Documentation label for documentation changes, but not in source conditions: - "files~=^(docs/.*|README.md|CODE_OF_CONDUCT.md|CONTRIBUTING.md)$" - - "-files~=*src/Cake.Warp/.*$" + - "-files~=^src/Cake.Warp/.*$" actions: label: add: ["Documentation"] - name: Add build label when no change in source, and not in documentation conditions: - "-files~=^(docs/.*|README.md|CODE_OF_CONDUCT.md|CONTRIBUTING.md)$" - - "-files~=*src/Cake.Warp/.*$" + - "-files~=^src/Cake.Warp/.*$" actions: label: add: ["Build"] From a04c6ffe615fe1f29f819a2e3fc1f631df2cba7c Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 21:48:25 +0200 Subject: [PATCH 33/68] Revert "(build) Corrected status settings for mergify" This reverts commit 17e200d51f0c75bdc2bc801f58ef6ebba200b1b6. --- .mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index 6de8cbf..a8cc964 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -25,7 +25,7 @@ pull_request_rules: - name: "Merge Pull Request when CI passes, and no outstanding issues" conditions: - "status-success=continuous-integration/appveyor/pr" - - "status-success=continuous-integration/travis-ci" + - "status-success=continuous-integration/travis-ci/pr" - "#approved-reviews-by>=1" - "#review-requested=0" - "#changes-requested-reviews-by=0" From 1e2bd926b6853a5c2d65270a85bfe88f785304c1 Mon Sep 17 00:00:00 2001 From: "Kim J. Nordmo" Date: Fri, 10 May 2019 21:53:18 +0200 Subject: [PATCH 34/68] Update .mergify.yml --- .mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index a8cc964..55e9d9b 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -22,7 +22,7 @@ pull_request_rules: remove: ["Build"] # In case dependabot was the one that opened this # Although we can not have mergify auto-merge PR's (because we require GPG signature) # We still want this rule, in case mergify suddenly signs commits. - - name: "Merge Pull Request when CI passes, and no outstanding issues" + - name: "Comment on Pull Request when CI passes, and no outstanding issues" conditions: - "status-success=continuous-integration/appveyor/pr" - "status-success=continuous-integration/travis-ci/pr" From a5fcc51f5ada104bac8bb480c68ead0e1cd92dfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 10 May 2019 19:56:05 +0000 Subject: [PATCH 35/68] Bump NUnit3TestAdapter from 3.11.0 to 3.13.0 Bumps [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter) from 3.11.0 to 3.13.0. - [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases) - [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/3.11...V3.13) Signed-off-by: dependabot[bot] --- .../Cake.Warp.IntegrationTests.csproj | 2 +- src/Cake.Warp.Tests/Cake.Warp.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj index de62457..7e3e1c9 100644 --- a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj +++ b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj index e19c6c8..c965566 100644 --- a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj +++ b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj @@ -12,7 +12,7 @@ - + From 37e17856803c415f83f6b0c5bc4dc8317788fec3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sun, 12 May 2019 10:22:32 +0000 Subject: [PATCH 36/68] Bump Microsoft.NET.Test.Sdk from 15.9.0 to 16.1.0 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 15.9.0 to 16.1.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v15.9.0...v16.1.0) Signed-off-by: dependabot[bot] --- .../Cake.Warp.IntegrationTests.csproj | 2 +- src/Cake.Warp.Tests/Cake.Warp.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj index 7e3e1c9..7ae5462 100644 --- a/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj +++ b/src/Cake.Warp.IntegrationTests/Cake.Warp.IntegrationTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj index c965566..40dd708 100644 --- a/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj +++ b/src/Cake.Warp.Tests/Cake.Warp.Tests.csproj @@ -13,7 +13,7 @@ - + From 5eaa87c6c6ab5061b7988f4291dbc8b9bd7315e0 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 8 May 2019 21:11:19 +0200 Subject: [PATCH 37/68] (maint) Created configuration class to hold common addin values This is a class that will be used in cooperation with setting and getting the location of warp, along with other common values only used inside the addin --- src/Cake.Warp/Class1.cs | 8 --- src/Cake.Warp/Common/AddinConfiguration.cs | 63 ++++++++++++++++++++++ 2 files changed, 63 insertions(+), 8 deletions(-) delete mode 100644 src/Cake.Warp/Class1.cs create mode 100644 src/Cake.Warp/Common/AddinConfiguration.cs diff --git a/src/Cake.Warp/Class1.cs b/src/Cake.Warp/Class1.cs deleted file mode 100644 index c0945cf..0000000 --- a/src/Cake.Warp/Class1.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Cake.Warp -{ - public class Class1 - { - } -} diff --git a/src/Cake.Warp/Common/AddinConfiguration.cs b/src/Cake.Warp/Common/AddinConfiguration.cs new file mode 100644 index 0000000..e3d19a7 --- /dev/null +++ b/src/Cake.Warp/Common/AddinConfiguration.cs @@ -0,0 +1,63 @@ +namespace Cake.Warp.Common +{ + using System; + using System.Runtime.InteropServices; + + internal sealed class AddinConfiguration + { + private static AddinConfiguration instance; + + private AddinConfiguration() + { + } + + /// + /// Gets the singleton instance of the addin configuration class + /// + public static AddinConfiguration Instance + { + get + { + if (instance == null) + { + instance = new AddinConfiguration(); + } + + return instance; + } + } + + /// + /// Gets the current path to the executing assembly. + /// + public string AssemblyPath { get; } + + /// + /// Gets or sets the full file path to the warp binary file. + /// + /// + /// This should/will be set in the + /// + /// during library loading. + /// + public string WarpFilePath { get; set; } + + /// + /// Gets wether we are running on the Linux platform or not. + /// + public bool IsLinux { get; } + = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + + /// + /// Gets wether we are running on the Mac OSX platform or not. + /// + public bool IsMacOS { get; } + = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + + /// + /// Gets wether we are running on the Windows platform or not. + /// + public bool IsWindows { get; } + = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + } +} From ef62acd2220e90286f293838e51810c37ee38ffc Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 9 May 2019 20:01:21 +0200 Subject: [PATCH 38/68] (build) Fixed compilation issue on windows Turned out to be missing RuntimeInformation when compiling .NET 4.6.1 Framework. This seem to only be needed when compiiling the addin, not referencing it --- src/Cake.Warp/Cake.Warp.csproj | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 99e70f0..3a18626 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -7,11 +7,21 @@ Cake.Warp.ruleset - + runtime; build; native; contentfiles; analyzers all + + From acf0093ab178315be4fa1b029a93b95ba64ed247 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 9 May 2019 21:26:15 +0200 Subject: [PATCH 39/68] (GH-4) Added module initializer using ModuleInit..Fody --- .../ModuleInitiazerTests.cs | 22 ++++++++++++++++ src/Cake.Warp.IntegrationTests/UnitTest1.cs | 18 ------------- src/Cake.Warp/Cake.Warp.csproj | 16 +++++------- src/Cake.Warp/FodyWeavers.xml | 3 +++ src/Cake.Warp/FodyWeavers.xsd | 26 +++++++++++++++++++ src/Cake.Warp/ModuleInitializer.cs | 23 ++++++++++++++++ 6 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs delete mode 100644 src/Cake.Warp.IntegrationTests/UnitTest1.cs create mode 100644 src/Cake.Warp/FodyWeavers.xml create mode 100644 src/Cake.Warp/FodyWeavers.xsd create mode 100644 src/Cake.Warp/ModuleInitializer.cs diff --git a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs new file mode 100644 index 0000000..37dc48c --- /dev/null +++ b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs @@ -0,0 +1,22 @@ +namespace Cake.Warp.IntegrationTests +{ + using System.IO; + using NUnit.Framework; + + [TestFixture] + [Category("Integration")] + public class ModuleInitializerTests + { + // See for a partial list of valid platform values + [TestCase("warp-runner", IncludePlatform = "Unix", ExpectedResult = true)] + [TestCase("warp-runner", IncludePlatform = "Win", ExpectedResult = true)] + public bool Test1(string runnerName) + { + string directory = typeof(Cake.Warp.ModuleInitializer).Assembly.Location; + + var expectedPath = Path.Combine(directory, runnerName); + + return File.Exists(expectedPath); + } + } +} diff --git a/src/Cake.Warp.IntegrationTests/UnitTest1.cs b/src/Cake.Warp.IntegrationTests/UnitTest1.cs deleted file mode 100644 index 794c408..0000000 --- a/src/Cake.Warp.IntegrationTests/UnitTest1.cs +++ /dev/null @@ -1,18 +0,0 @@ -using NUnit.Framework; - -namespace Tests -{ - public class Tests - { - [SetUp] - public void Setup() - { - } - - [Test] - public void Test1() - { - Assert.Pass(); - } - } -} \ No newline at end of file diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 3a18626..74b025d 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -7,21 +7,19 @@ Cake.Warp.ruleset - + + + runtime; build; native; contentfiles; analyzers + all + + runtime; build; native; contentfiles; analyzers all - + diff --git a/src/Cake.Warp/FodyWeavers.xml b/src/Cake.Warp/FodyWeavers.xml new file mode 100644 index 0000000..0068698 --- /dev/null +++ b/src/Cake.Warp/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/Cake.Warp/FodyWeavers.xsd b/src/Cake.Warp/FodyWeavers.xsd new file mode 100644 index 0000000..e24ec01 --- /dev/null +++ b/src/Cake.Warp/FodyWeavers.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/src/Cake.Warp/ModuleInitializer.cs b/src/Cake.Warp/ModuleInitializer.cs new file mode 100644 index 0000000..539f9bc --- /dev/null +++ b/src/Cake.Warp/ModuleInitializer.cs @@ -0,0 +1,23 @@ +namespace Cake.Warp +{ + /// + /// Module class responible for the logic needed + /// to run when the library is loaded. + /// + public static class ModuleInitializer + { + /// + /// The actual method that will be called during + /// the loading of the addin library (by Module.Fody IL weaving). + /// + /// + /// While this method is public, it should never be + /// called manually. It should only be called + /// using the existing IL weaving. + /// + public static void Initialize() + { + // TODO + } + } +} From 94448160cdc52d50fdb60f6a447b47dd13498447 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 9 May 2019 23:24:04 +0200 Subject: [PATCH 40/68] (GH-4) Added ability to save warp file to disk on library load --- .../ModuleInitiazerTests.cs | 28 +++++++++-- src/Cake.Warp/Cake.Warp.csproj | 1 + src/Cake.Warp/Common/AddinConfiguration.cs | 12 ++++- src/Cake.Warp/FodyWeavers.xml | 1 + src/Cake.Warp/FodyWeavers.xsd | 1 + src/Cake.Warp/ModuleInitializer.cs | 46 +++++++++++++++++++ 6 files changed, 82 insertions(+), 7 deletions(-) diff --git a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs index 37dc48c..b17bdff 100644 --- a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs +++ b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs @@ -1,5 +1,6 @@ namespace Cake.Warp.IntegrationTests { + using System; using System.IO; using NUnit.Framework; @@ -7,14 +8,31 @@ namespace Cake.Warp.IntegrationTests [Category("Integration")] public class ModuleInitializerTests { - // See for a partial list of valid platform values - [TestCase("warp-runner", IncludePlatform = "Unix", ExpectedResult = true)] - [TestCase("warp-runner", IncludePlatform = "Win", ExpectedResult = true)] - public bool Test1(string runnerName) + private string addinAssemblyDirectory; + + [SetUp] + public void SetAddinAssemblyDirectory() { string directory = typeof(Cake.Warp.ModuleInitializer).Assembly.Location; + var attr = File.GetAttributes(directory); + if ((attr & FileAttributes.Directory) != FileAttributes.Directory) + { + directory = Path.GetDirectoryName(directory); + } + addinAssemblyDirectory = directory; + } - var expectedPath = Path.Combine(directory, runnerName); + // See for a partial list of valid platform values + [TestCase("warp-packer", IncludePlatform = "Unix", ExpectedResult = true)] + [TestCase("warp-packer.exe", IncludePlatform = "Win", ExpectedResult = true)] + [TestCase("warp-packer", IncludePlatform = "Win", ExpectedResult = false, + TestName = "Should_Not_Have_Saved_Incorrect_Platform_Executable_To_Assembly_Path")] + [TestCase("warp-packer.exe", IncludePlatform = "Unix", ExpectedResult = false, + TestName = "Should_Not_Have_Saved_Incorrect_Platform_Executable_To_Assembly_Path")] + public bool Should_Have_Saved_Correct_Executable_To_Assembly_Path(string runnerName) + { + // The file should have been saved to path already in the setup method + var expectedPath = Path.Combine(addinAssemblyDirectory, runnerName); return File.Exists(expectedPath); } diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 74b025d..25d44c0 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -13,6 +13,7 @@ all + runtime; build; native; contentfiles; analyzers all diff --git a/src/Cake.Warp/Common/AddinConfiguration.cs b/src/Cake.Warp/Common/AddinConfiguration.cs index e3d19a7..eb9c369 100644 --- a/src/Cake.Warp/Common/AddinConfiguration.cs +++ b/src/Cake.Warp/Common/AddinConfiguration.cs @@ -1,6 +1,8 @@ namespace Cake.Warp.Common { using System; + using System.IO; + using System.Reflection; using System.Runtime.InteropServices; internal sealed class AddinConfiguration @@ -9,6 +11,12 @@ internal sealed class AddinConfiguration private AddinConfiguration() { + AssemblyDirectoryPath = Assembly.GetExecutingAssembly().Location; + var attr = File.GetAttributes(AssemblyDirectoryPath); + if ((attr & FileAttributes.Directory) != FileAttributes.Directory) + { + AssemblyDirectoryPath = Path.GetDirectoryName(AssemblyDirectoryPath); + } } /// @@ -28,9 +36,9 @@ public static AddinConfiguration Instance } /// - /// Gets the current path to the executing assembly. + /// Gets the current path to the executing assembly directory. /// - public string AssemblyPath { get; } + public string AssemblyDirectoryPath { get; } /// /// Gets or sets the full file path to the warp binary file. diff --git a/src/Cake.Warp/FodyWeavers.xml b/src/Cake.Warp/FodyWeavers.xml index 0068698..ce6533d 100644 --- a/src/Cake.Warp/FodyWeavers.xml +++ b/src/Cake.Warp/FodyWeavers.xml @@ -1,3 +1,4 @@  + diff --git a/src/Cake.Warp/FodyWeavers.xsd b/src/Cake.Warp/FodyWeavers.xsd index e24ec01..94eea2e 100644 --- a/src/Cake.Warp/FodyWeavers.xsd +++ b/src/Cake.Warp/FodyWeavers.xsd @@ -4,6 +4,7 @@ + diff --git a/src/Cake.Warp/ModuleInitializer.cs b/src/Cake.Warp/ModuleInitializer.cs index 539f9bc..8995e7c 100644 --- a/src/Cake.Warp/ModuleInitializer.cs +++ b/src/Cake.Warp/ModuleInitializer.cs @@ -1,3 +1,8 @@ +using System; +using System.IO; +using Cake.Warp.Common; +using Resourcer; + namespace Cake.Warp { /// @@ -18,6 +23,47 @@ public static class ModuleInitializer public static void Initialize() { // TODO + using (var resourceStream = GetWarpResource()) + { + var assemblyDirectory = AddinConfiguration.Instance.AssemblyDirectoryPath; + var warpFileName = "warp-packer"; + if (AddinConfiguration.Instance.IsWindows) + { + // Would prefer to get the file extension preffered by + // system instead of hard-coding this. + // Not found anything related to this. + warpFileName += ".exe"; + } + + var fullPathToFile = Path.Combine(assemblyDirectory, warpFileName); + using (var filestream = File.Create(fullPathToFile)) + { + // Is there perhaps a better way, than doing this + resourceStream.CopyTo(filestream); + } + + AddinConfiguration.Instance.WarpFilePath = fullPathToFile; + } + } + + private static Stream GetWarpResource() + { + if (AddinConfiguration.Instance.IsLinux) + { + return Resource.AsStream("warp.linux-x64.warp-packer"); + } + else if (AddinConfiguration.Instance.IsMacOS) + { + return Resource.AsStream("warp.macos-x64.warp-packer"); + } + else if (AddinConfiguration.Instance.IsWindows) + { + return Resource.AsStream("warp.windows-x64.warp-packer.exe"); + } + else + { + throw new PlatformNotSupportedException("The resource file was not found for the current platform"); + } } } } From f2e2d07c0130d451b5b4b6578e23b97faee8aace Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 9 May 2019 23:36:17 +0200 Subject: [PATCH 41/68] (build) Updated classes to conform to stylecop --- .../ModuleInitiazerTests.cs | 4 ++-- src/Cake.Warp/Common/AddinConfiguration.cs | 21 ++++++++++++------- src/Cake.Warp/ModuleInitializer.cs | 10 ++++----- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs index b17bdff..984ed45 100644 --- a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs +++ b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs @@ -19,7 +19,7 @@ public void SetAddinAssemblyDirectory() { directory = Path.GetDirectoryName(directory); } - addinAssemblyDirectory = directory; + this.addinAssemblyDirectory = directory; } // See for a partial list of valid platform values @@ -32,7 +32,7 @@ public void SetAddinAssemblyDirectory() public bool Should_Have_Saved_Correct_Executable_To_Assembly_Path(string runnerName) { // The file should have been saved to path already in the setup method - var expectedPath = Path.Combine(addinAssemblyDirectory, runnerName); + var expectedPath = Path.Combine(this.addinAssemblyDirectory, runnerName); return File.Exists(expectedPath); } diff --git a/src/Cake.Warp/Common/AddinConfiguration.cs b/src/Cake.Warp/Common/AddinConfiguration.cs index eb9c369..6cdc1ae 100644 --- a/src/Cake.Warp/Common/AddinConfiguration.cs +++ b/src/Cake.Warp/Common/AddinConfiguration.cs @@ -5,22 +5,26 @@ namespace Cake.Warp.Common using System.Reflection; using System.Runtime.InteropServices; + /// + /// Configuration class responsible for holding + /// Addin values only used internally. + /// internal sealed class AddinConfiguration { private static AddinConfiguration instance; private AddinConfiguration() { - AssemblyDirectoryPath = Assembly.GetExecutingAssembly().Location; - var attr = File.GetAttributes(AssemblyDirectoryPath); + this.AssemblyDirectoryPath = Assembly.GetExecutingAssembly().Location; + var attr = File.GetAttributes(this.AssemblyDirectoryPath); if ((attr & FileAttributes.Directory) != FileAttributes.Directory) { - AssemblyDirectoryPath = Path.GetDirectoryName(AssemblyDirectoryPath); + this.AssemblyDirectoryPath = Path.GetDirectoryName(this.AssemblyDirectoryPath); } } /// - /// Gets the singleton instance of the addin configuration class + /// Gets the singleton instance of the addin configuration class. /// public static AddinConfiguration Instance { @@ -51,19 +55,22 @@ public static AddinConfiguration Instance public string WarpFilePath { get; set; } /// - /// Gets wether we are running on the Linux platform or not. + /// Gets a value indicating whether we are running + /// on the Linux platform or not. /// public bool IsLinux { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); /// - /// Gets wether we are running on the Mac OSX platform or not. + /// Gets a value indicating whether we are running + /// on the Mac OSX platform or not. /// public bool IsMacOS { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); /// - /// Gets wether we are running on the Windows platform or not. + /// Gets a value indicating whether we are running + /// on the Windows platform or not. /// public bool IsWindows { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); diff --git a/src/Cake.Warp/ModuleInitializer.cs b/src/Cake.Warp/ModuleInitializer.cs index 8995e7c..ebe5c8a 100644 --- a/src/Cake.Warp/ModuleInitializer.cs +++ b/src/Cake.Warp/ModuleInitializer.cs @@ -1,10 +1,10 @@ -using System; -using System.IO; -using Cake.Warp.Common; -using Resourcer; - namespace Cake.Warp { + using System; + using System.IO; + using Cake.Warp.Common; + using Resourcer; + /// /// Module class responible for the logic needed /// to run when the library is loaded. From f34db8e938720305dfb954e3f38b2ab0faaab50b Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 12:27:59 +0200 Subject: [PATCH 42/68] (GH-4) Added a check to see if the file already exist in such a case, we should not extract the binary file. --- src/Cake.Warp/ModuleInitializer.cs | 38 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Cake.Warp/ModuleInitializer.cs b/src/Cake.Warp/ModuleInitializer.cs index ebe5c8a..66047c7 100644 --- a/src/Cake.Warp/ModuleInitializer.cs +++ b/src/Cake.Warp/ModuleInitializer.cs @@ -22,27 +22,29 @@ public static class ModuleInitializer /// public static void Initialize() { - // TODO - using (var resourceStream = GetWarpResource()) + var assemblyDirectory = AddinConfiguration.Instance.AssemblyDirectoryPath; + var warpFileName = "warp-packer"; + if (AddinConfiguration.Instance.IsWindows) { - var assemblyDirectory = AddinConfiguration.Instance.AssemblyDirectoryPath; - var warpFileName = "warp-packer"; - if (AddinConfiguration.Instance.IsWindows) - { - // Would prefer to get the file extension preffered by - // system instead of hard-coding this. - // Not found anything related to this. - warpFileName += ".exe"; - } + // Would prefer to get the file extension preffered by + // system instead of hard-coding this. + // Not found anything related to this. + warpFileName += ".exe"; + } - var fullPathToFile = Path.Combine(assemblyDirectory, warpFileName); - using (var filestream = File.Create(fullPathToFile)) - { - // Is there perhaps a better way, than doing this - resourceStream.CopyTo(filestream); - } + var fullPathToFile = Path.Combine(assemblyDirectory, warpFileName); + AddinConfiguration.Instance.WarpFilePath = fullPathToFile; - AddinConfiguration.Instance.WarpFilePath = fullPathToFile; + if (File.Exists(fullPathToFile)) + { + return; + } + + using (var resourceStream = GetWarpResource()) + using (var filestream = File.Create(fullPathToFile)) + { + // Is there perhaps a better way, than doing this + resourceStream.CopyTo(filestream); } } From a26e68e4d6556f515b9532f28a86acfd21a23925 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 12:56:55 +0200 Subject: [PATCH 43/68] (GH-4) Updated to set executable bit on unix platforms --- .../ModuleInitiazerTests.cs | 23 +++++++++++++++++++ src/Cake.Warp/ModuleInitializer.cs | 14 ++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs index 984ed45..32eddf7 100644 --- a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs +++ b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs @@ -1,6 +1,7 @@ namespace Cake.Warp.IntegrationTests { using System; + using System.Diagnostics; using System.IO; using NUnit.Framework; @@ -36,5 +37,27 @@ public bool Should_Have_Saved_Correct_Executable_To_Assembly_Path(string runnerN return File.Exists(expectedPath); } + + [Test] + public void Should_Be_Able_To_Launch_Warp_Binary_File() + { + var filePath = Path.Combine(this.addinAssemblyDirectory, + Environment.OSVersion.Platform == PlatformID.Win32NT + ? "warp-packer.exe" + : "warp-packer"); + var processInfo = new ProcessStartInfo + { + CreateNoWindow = true, + FileName = filePath, + RedirectStandardError = true, + RedirectStandardOutput = true, + UseShellExecute = false, + }; + + // This will throw an exception if the file can't be run + var proc = Process.Start(processInfo); + + proc.WaitForExit(); + } } } diff --git a/src/Cake.Warp/ModuleInitializer.cs b/src/Cake.Warp/ModuleInitializer.cs index 66047c7..f58e44b 100644 --- a/src/Cake.Warp/ModuleInitializer.cs +++ b/src/Cake.Warp/ModuleInitializer.cs @@ -1,6 +1,7 @@ namespace Cake.Warp { using System; + using System.Diagnostics; using System.IO; using Cake.Warp.Common; using Resourcer; @@ -41,10 +42,17 @@ public static void Initialize() } using (var resourceStream = GetWarpResource()) - using (var filestream = File.Create(fullPathToFile)) + using (var filestream = File.Create(fullPathToFile)) + { + // Is there perhaps a better way, than doing this + resourceStream.CopyTo(filestream); + } + + if (!AddinConfiguration.Instance.IsWindows) { - // Is there perhaps a better way, than doing this - resourceStream.CopyTo(filestream); + // This is required, otherwise we won't be able to run warp-packer + var process = Process.Start("chmod", $"755 \"{fullPathToFile}\""); + process.WaitForExit(); } } From cfeeb3244526d4fa1548e5bcbd9643071a9d21e9 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 10 May 2019 16:43:10 +0200 Subject: [PATCH 44/68] (GH-7) Created basic settings class for warp fixes #7 --- src/Cake.Warp/WarpPlatforms.cs | 24 +++++++++++++ src/Cake.Warp/WarpSettings.cs | 63 ++++++++++++++++++++++++++++++++++ src/Cake.Warp/stylecop.json | 7 ++++ 3 files changed, 94 insertions(+) create mode 100644 src/Cake.Warp/WarpPlatforms.cs create mode 100644 src/Cake.Warp/WarpSettings.cs diff --git a/src/Cake.Warp/WarpPlatforms.cs b/src/Cake.Warp/WarpPlatforms.cs new file mode 100644 index 0000000..4057def --- /dev/null +++ b/src/Cake.Warp/WarpPlatforms.cs @@ -0,0 +1,24 @@ +namespace Cake.Warp +{ + /// + /// The platform to use when creating + /// the self-contained application. + /// + public enum WarpPlatforms + { + /// + /// Create the application as a Linux x64 executable. + /// + LinuxX64, + + /// + /// Create the application as a Mac OSX x64 executable. + /// /// + MacOSX64, + + /// + /// Create the application as a Windows x64 executable. + /// + WindowsX64, + } +} diff --git a/src/Cake.Warp/WarpSettings.cs b/src/Cake.Warp/WarpSettings.cs new file mode 100644 index 0000000..15123d9 --- /dev/null +++ b/src/Cake.Warp/WarpSettings.cs @@ -0,0 +1,63 @@ +namespace Cake.Warp +{ + using Cake.Core.IO; + using Cake.Core.Tooling; + // using Cake.Warp.Common; + + /// + /// Contains the settings used by . + /// + public sealed class WarpSettings : ToolSettings + { + /// + /// Initializes a new instance of the class, + /// with ToolPath set to the extracted warp binary file. + /// + /// ToolPath can be overridden if desired. + public WarpSettings() + { + // We can not enable this until PR #11 is merged + // this.ToolPath = AddinConfiguration.Instance.WarpFilePath; + } + + /// + /// Gets or sets the platform and architecture to create the + /// self-contained application for. + /// + public WarpPlatforms Architecture { get; set; } + + /// + /// Gets or sets the platform and architecture to create the + /// self-contained application for. + /// + /// + /// This is just an alias for . + /// + public WarpPlatforms Platform + { + get => this.Architecture; + set => this.Architecture = value; + } + + /// + /// Gets or sets the name of the executable to run after the + /// the created application is being executed by a user. + /// + /// + /// This should only be the filaname including the file extension. + /// + public string ExecutableName { get; set; } + + /// + /// Gets or sets the directory that will be packed into the + /// self-contained application. + /// + public DirectoryPath InputDirectory { get; set; } + + /// + /// Gets or sets the output path to where the self-contained application + /// should be created. + /// + public FilePath OutputFilePath { get; set; } + } +} diff --git a/src/Cake.Warp/stylecop.json b/src/Cake.Warp/stylecop.json index f2ada18..ce8c6cd 100644 --- a/src/Cake.Warp/stylecop.json +++ b/src/Cake.Warp/stylecop.json @@ -1,6 +1,13 @@ { "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", "settings": { + "maintainabilityRules": { + "topLevelTypes": [ + "class", + "interface", + "enum" + ] + }, "layoutRules": { "newlineAtEndOfFile": "require" }, From cc524381b6a778c16657cc9adaec8303226da3dd Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 13:33:40 +0200 Subject: [PATCH 45/68] (GH-7) Set path to warp binary by default --- .vscode/tasks.json | 14 ++++++++++- .../ModuleInitiazerTests.cs | 2 ++ src/Cake.Warp.Tests/UnitTest1.cs | 18 ------------- src/Cake.Warp.Tests/WarpSettingsTests.cs | 25 +++++++++++++++++++ src/Cake.Warp/WarpSettings.cs | 5 ++-- 5 files changed, 42 insertions(+), 22 deletions(-) delete mode 100644 src/Cake.Warp.Tests/UnitTest1.cs create mode 100644 src/Cake.Warp.Tests/WarpSettingsTests.cs diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f82bc73..8e8fc77 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,13 +1,24 @@ { "version": "2.0.0", "tasks": [ + { + "label": "restore", + "command": "dotnet", + "type": "process", + "args": [ + "restore", + "${workspaceFolder}/src/Cake.Warp.sln" + ] + }, { "label": "build", "command": "dotnet", + "dependsOn":["restore"], "type": "process", "args": [ "build", - "${workspaceFolder}/src/Cake.Warp.sln" + "${workspaceFolder}/src/Cake.Warp.sln", + "--no-restore" ], "problemMatcher": "$tsc", "group": { @@ -29,6 +40,7 @@ "label": "watch", "command": "dotnet", "type": "process", + "dependsOn":["build"], "args": [ "watch", "--project", diff --git a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs index 32eddf7..6b0bf00 100644 --- a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs +++ b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs @@ -45,6 +45,8 @@ public void Should_Be_Able_To_Launch_Warp_Binary_File() Environment.OSVersion.Platform == PlatformID.Win32NT ? "warp-packer.exe" : "warp-packer"); + + Assume.That(filePath, Does.Exist); var processInfo = new ProcessStartInfo { CreateNoWindow = true, diff --git a/src/Cake.Warp.Tests/UnitTest1.cs b/src/Cake.Warp.Tests/UnitTest1.cs deleted file mode 100644 index 794c408..0000000 --- a/src/Cake.Warp.Tests/UnitTest1.cs +++ /dev/null @@ -1,18 +0,0 @@ -using NUnit.Framework; - -namespace Tests -{ - public class Tests - { - [SetUp] - public void Setup() - { - } - - [Test] - public void Test1() - { - Assert.Pass(); - } - } -} \ No newline at end of file diff --git a/src/Cake.Warp.Tests/WarpSettingsTests.cs b/src/Cake.Warp.Tests/WarpSettingsTests.cs new file mode 100644 index 0000000..ea3c157 --- /dev/null +++ b/src/Cake.Warp.Tests/WarpSettingsTests.cs @@ -0,0 +1,25 @@ +using System; +using System.IO; +using NUnit.Framework; + +namespace Cake.Warp.Tests +{ + public class WarpSettingsTests + { + + [Test] + public void Constructor_Should_Set_ToolPath_To_Warp_Binary_On_Default() + { + var settings = new WarpSettings(); + var expectedDir = Path.GetDirectoryName( + settings.GetType().Assembly.Location); + var expectedFilename = "warp-packer" + + (Environment.OSVersion.Platform == PlatformID.Win32NT + ? ".exe" : ""); + var expectedPath = Path.Combine(expectedDir, expectedFilename); + + Assert.That(settings.ToolPath.FullPath, + Is.Not.Null.And.SamePath(expectedPath)); + } + } +} diff --git a/src/Cake.Warp/WarpSettings.cs b/src/Cake.Warp/WarpSettings.cs index 15123d9..3f363f2 100644 --- a/src/Cake.Warp/WarpSettings.cs +++ b/src/Cake.Warp/WarpSettings.cs @@ -2,7 +2,7 @@ namespace Cake.Warp { using Cake.Core.IO; using Cake.Core.Tooling; - // using Cake.Warp.Common; + using Cake.Warp.Common; /// /// Contains the settings used by . @@ -16,8 +16,7 @@ public sealed class WarpSettings : ToolSettings /// ToolPath can be overridden if desired. public WarpSettings() { - // We can not enable this until PR #11 is merged - // this.ToolPath = AddinConfiguration.Instance.WarpFilePath; + this.ToolPath = AddinConfiguration.Instance.WarpFilePath; } /// From e17389fce9fc6feb4c3b2d07583cd7c1f9626ce8 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 13:35:25 +0200 Subject: [PATCH 46/68] (build) Enabled codecov coverage report --- recipe.cake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index a769d7c..bfa35f7 100644 --- a/recipe.cake +++ b/recipe.cake @@ -19,7 +19,8 @@ BuildParameters.SetParameters(context: Context, repositoryName: "Cake.Warp", appVeyorAccountName: "cakecontrib", shouldRunGitVersion: true, - shouldExecuteGitLink: false); + shouldExecuteGitLink: false, + shouldRunCodecov: true); BuildParameters.PrintParameters(Context); From 778b3d09601dd51a7c8c2a6f5c02ba88d7adf66a Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 13:52:44 +0200 Subject: [PATCH 47/68] (doc) Added new label to git release manager --- GitReleaseManager.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml index 2ff7a92..50ae00c 100644 --- a/GitReleaseManager.yaml +++ b/GitReleaseManager.yaml @@ -23,6 +23,7 @@ issue-labels-include: issue-labels-exclude: - Build + - Internal / Refactoring issue-labels-alias: - name: Documentation header: Documentation From 391b01cd734d4e4bb512c7e3d9b8ef43c25e679e Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 14:08:38 +0200 Subject: [PATCH 48/68] (build) Updated test coverage filter --- recipe.cake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index bfa35f7..e66619d 100644 --- a/recipe.cake +++ b/recipe.cake @@ -29,7 +29,8 @@ ToolSettings.SetToolSettings(context: Context, "**/*Tests/**/*.cs", "**/*.Demo/**/*.cs", "**/*.AssemblyInfo.cs" - }); + }, + testCoverageFilter: "+[Cake.Warp*]* -[*Tests]*"); // TODO: Add a task to publish Demo project, // so we can run integration tests against it. From 30fd26b2180e260fba94812b54b9bd0297cb91f7 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 18:55:45 +0200 Subject: [PATCH 49/68] (build) Fixed resharper issues --- .appveyor.yml | 2 +- .vscode/tasks.json | 1 - src/Cake.Warp.Demo/Program.cs | 7 ++++--- .../ModuleInitiazerTests.cs | 3 ++- src/Cake.Warp.sln.DotSettings | 13 +++++++++++++ src/Cake.Warp/Cake.Warp.csproj | 1 + src/Cake.Warp/Common/AddinConfiguration.cs | 13 +------------ src/Cake.Warp/ModuleInitializer.cs | 16 ++++++++++++---- src/Cake.Warp/WarpPlatforms.cs | 2 +- src/Cake.Warp/WarpSettings.cs | 4 +++- 10 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 src/Cake.Warp.sln.DotSettings diff --git a/.appveyor.yml b/.appveyor.yml index 331f01e..67cc905 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,6 @@ image: - Ubuntu - - Visual Studio 2017 + - Visual Studio 2019 version: '{build}' pull_requests: do_not_increment_build_number: true diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 8e8fc77..a834786 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -40,7 +40,6 @@ "label": "watch", "command": "dotnet", "type": "process", - "dependsOn":["build"], "args": [ "watch", "--project", diff --git a/src/Cake.Warp.Demo/Program.cs b/src/Cake.Warp.Demo/Program.cs index 6f4f6ae..6044c2f 100644 --- a/src/Cake.Warp.Demo/Program.cs +++ b/src/Cake.Warp.Demo/Program.cs @@ -1,10 +1,11 @@ -using System; +using System; namespace Cake.Warp.Demo { - class Program + // ReSharper disable once ClassNeverInstantiated.Global + internal class Program { - static void Main(string[] args) + internal static void Main() { Console.WriteLine("I should work from a single binary!"); } diff --git a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs index 6b0bf00..8d575a9 100644 --- a/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs +++ b/src/Cake.Warp.IntegrationTests/ModuleInitiazerTests.cs @@ -14,7 +14,7 @@ public class ModuleInitializerTests [SetUp] public void SetAddinAssemblyDirectory() { - string directory = typeof(Cake.Warp.ModuleInitializer).Assembly.Location; + string directory = typeof(ModuleInitializer).Assembly.Location; var attr = File.GetAttributes(directory); if ((attr & FileAttributes.Directory) != FileAttributes.Directory) { @@ -59,6 +59,7 @@ public void Should_Be_Able_To_Launch_Warp_Binary_File() // This will throw an exception if the file can't be run var proc = Process.Start(processInfo); + Assume.That(proc, Is.Not.Null); proc.WaitForExit(); } } diff --git a/src/Cake.Warp.sln.DotSettings b/src/Cake.Warp.sln.DotSettings new file mode 100644 index 0000000..c49da23 --- /dev/null +++ b/src/Cake.Warp.sln.DotSettings @@ -0,0 +1,13 @@ + + ExplicitlyExcluded + SOLUTION + DO_NOT_SHOW + Field, Property, Event, Method + True + True + OS + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + True + True + diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 25d44c0..ac31298 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -12,6 +12,7 @@ runtime; build; native; contentfiles; analyzers all + diff --git a/src/Cake.Warp/Common/AddinConfiguration.cs b/src/Cake.Warp/Common/AddinConfiguration.cs index 6cdc1ae..b87550f 100644 --- a/src/Cake.Warp/Common/AddinConfiguration.cs +++ b/src/Cake.Warp/Common/AddinConfiguration.cs @@ -1,6 +1,5 @@ namespace Cake.Warp.Common { - using System; using System.IO; using System.Reflection; using System.Runtime.InteropServices; @@ -27,17 +26,7 @@ private AddinConfiguration() /// Gets the singleton instance of the addin configuration class. /// public static AddinConfiguration Instance - { - get - { - if (instance == null) - { - instance = new AddinConfiguration(); - } - - return instance; - } - } + => instance ?? (instance = new AddinConfiguration()); /// /// Gets the current path to the executing assembly directory. diff --git a/src/Cake.Warp/ModuleInitializer.cs b/src/Cake.Warp/ModuleInitializer.cs index f58e44b..c6f122a 100644 --- a/src/Cake.Warp/ModuleInitializer.cs +++ b/src/Cake.Warp/ModuleInitializer.cs @@ -4,10 +4,11 @@ namespace Cake.Warp using System.Diagnostics; using System.IO; using Cake.Warp.Common; + using JetBrains.Annotations; using Resourcer; /// - /// Module class responible for the logic needed + /// Module class responsible for the logic needed /// to run when the library is loaded. /// public static class ModuleInitializer @@ -21,13 +22,14 @@ public static class ModuleInitializer /// called manually. It should only be called /// using the existing IL weaving. /// + [UsedImplicitly] public static void Initialize() { var assemblyDirectory = AddinConfiguration.Instance.AssemblyDirectoryPath; var warpFileName = "warp-packer"; if (AddinConfiguration.Instance.IsWindows) { - // Would prefer to get the file extension preffered by + // Would prefer to get the file extension preferred by // system instead of hard-coding this. // Not found anything related to this. warpFileName += ".exe"; @@ -42,16 +44,21 @@ public static void Initialize() } using (var resourceStream = GetWarpResource()) - using (var filestream = File.Create(fullPathToFile)) + using (var fileStream = File.Create(fullPathToFile)) { // Is there perhaps a better way, than doing this - resourceStream.CopyTo(filestream); + resourceStream.CopyTo(fileStream); } if (!AddinConfiguration.Instance.IsWindows) { // This is required, otherwise we won't be able to run warp-packer var process = Process.Start("chmod", $"755 \"{fullPathToFile}\""); + if (process == null) + { + throw new NullReferenceException("Unable to run chmod on warp packer"); + } + process.WaitForExit(); } } @@ -64,6 +71,7 @@ private static Stream GetWarpResource() } else if (AddinConfiguration.Instance.IsMacOS) { + // ReSharper disable once StringLiteralTypo return Resource.AsStream("warp.macos-x64.warp-packer"); } else if (AddinConfiguration.Instance.IsWindows) diff --git a/src/Cake.Warp/WarpPlatforms.cs b/src/Cake.Warp/WarpPlatforms.cs index 4057def..9f7e4a1 100644 --- a/src/Cake.Warp/WarpPlatforms.cs +++ b/src/Cake.Warp/WarpPlatforms.cs @@ -14,7 +14,7 @@ public enum WarpPlatforms /// /// Create the application as a Mac OSX x64 executable. /// /// - MacOSX64, + MacOsx64, /// /// Create the application as a Windows x64 executable. diff --git a/src/Cake.Warp/WarpSettings.cs b/src/Cake.Warp/WarpSettings.cs index 3f363f2..19067d0 100644 --- a/src/Cake.Warp/WarpSettings.cs +++ b/src/Cake.Warp/WarpSettings.cs @@ -3,6 +3,7 @@ namespace Cake.Warp using Cake.Core.IO; using Cake.Core.Tooling; using Cake.Warp.Common; + using JetBrains.Annotations; /// /// Contains the settings used by . @@ -32,6 +33,7 @@ public WarpSettings() /// /// This is just an alias for . /// + [PublicAPI] public WarpPlatforms Platform { get => this.Architecture; @@ -43,7 +45,7 @@ public WarpPlatforms Platform /// the created application is being executed by a user. /// /// - /// This should only be the filaname including the file extension. + /// This should only be the filename including the file extension. /// public string ExecutableName { get; set; } From 7b9a04d2b09bf54e10d5852540d223dd98633543 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 19:20:33 +0200 Subject: [PATCH 50/68] (GH-12) Implemented the warp tool runner --- src/Cake.Warp.Tests/WarpRunnerFixture.cs | 43 ++++++ src/Cake.Warp.Tests/WarpRunnerTests.cs | 158 +++++++++++++++++++++++ src/Cake.Warp/AssemblyInfo.cs | 3 + src/Cake.Warp/WarpPlatforms.cs | 2 +- src/Cake.Warp/WarpRunner.cs | 98 ++++++++++++++ src/Cake.Warp/WarpSettings.cs | 5 + 6 files changed, 308 insertions(+), 1 deletion(-) create mode 100644 src/Cake.Warp.Tests/WarpRunnerFixture.cs create mode 100644 src/Cake.Warp.Tests/WarpRunnerTests.cs create mode 100644 src/Cake.Warp/AssemblyInfo.cs create mode 100644 src/Cake.Warp/WarpRunner.cs diff --git a/src/Cake.Warp.Tests/WarpRunnerFixture.cs b/src/Cake.Warp.Tests/WarpRunnerFixture.cs new file mode 100644 index 0000000..cf44aa7 --- /dev/null +++ b/src/Cake.Warp.Tests/WarpRunnerFixture.cs @@ -0,0 +1,43 @@ +namespace Cake.Warp.Tests +{ + using System; + using Cake.Testing; + using Cake.Testing.Fixtures; + + internal class WarpRunnerFixture : ToolFixture + { + public WarpRunnerFixture() + : base("warp-packer") + { + } + + public void GivenExpectedSettings() + { + this.SetSettings(); + this.GivenSettingsToolPathExist(); + } + + public void GivenExpectedSettingsWithoutTool() + { + this.SetSettings(); + this.GivenDefaultToolDoNotExist(); + } + + protected override void RunTool() + { + var tool = new WarpRunner(FileSystem, Environment, ProcessRunner, Tools); + tool.Run(Settings); + } + + private void SetSettings() + { + this.Settings = new WarpSettings + { + Architecture = WarpPlatforms.LinuxX64, + ExecutableName = "Cake.Warp.Demo.exe", + InputDirectory = System.Environment.CurrentDirectory, + OutputFilePath = "./cake-warp-demo", + }; + } + } +} diff --git a/src/Cake.Warp.Tests/WarpRunnerTests.cs b/src/Cake.Warp.Tests/WarpRunnerTests.cs new file mode 100644 index 0000000..47e6fa9 --- /dev/null +++ b/src/Cake.Warp.Tests/WarpRunnerTests.cs @@ -0,0 +1,158 @@ +namespace Cake.Warp.Tests +{ + using System; + using Cake.Core; + using Cake.Testing; + using Cake.Warp.Common; + using NUnit.Framework; + + [TestFixture] + [TestOf(typeof(WarpRunner))] + public class WarpRunnerTests + { + [Test] + public void Should_Throw_ArgumentNullException_If_Settings_Is_Null() + { + void FixtureResult() + { + var fixture = new WarpRunnerFixture {Settings = null}; + + fixture.Run(); + } + + Assert.That(FixtureResult, + Throws.ArgumentNullException + .With.Message.Contains("settings")); + } + + [Test] + public void Should_Use_Assembly_Warp_File_If_No_ToolPath_Is_Overridden() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + + var result = fixture.Run(); + + Assert.That(result.Path.FullPath, + Is.Not.Null + .And.SamePath(AddinConfiguration.Instance.WarpFilePath)); + } + + [Test] + public void Should_Throw_If_Warp_Executable_Was_Not_Found() + { + void FixtureResult() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettingsWithoutTool(); + fixture.Run(); + } + + Assert.That(FixtureResult, + Throws.TypeOf() + .With.Message.EqualTo( + "Warp Packer: Could not locate executable." + )); + } + + [Test] + public void Should_Throw_If_Process_Has_Non_Zero_Exit_Code() + { + void FixtureResult() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + fixture.GivenProcessExitsWithCode(1); + fixture.Run(); + } + + Assert.That(FixtureResult, + Throws.TypeOf() + .With.Message.EqualTo( + "Warp Packer: Process returned an error (exit code 1).")); + } + + [TestCase("/bin/tools/Warp/warp-packer", ExpectedResult = "/bin/tools/Warp/warp-packer")] + [TestCase("/bin/tools/Warp/warp-packer.exe", ExpectedResult = "/bin/tools/Warp/warp-packer.exe")] + [TestCase("./tools/Warp/warp-packer", ExpectedResult = "/Working/tools/Warp/warp-packer")] + [TestCase("./tools/Warp/warp-packer.exe", ExpectedResult = "/Working/tools/Warp/warp-packer.exe")] + public string Should_Use_Warp_Runner_From_Tool_Path_If_Provided( + string toolPath) + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + fixture.Settings.ToolPath = toolPath; + fixture.GivenSettingsToolPathExist(); + + var result = fixture.Run(); + + Assert.That(result.Path, Is.Not.Null); + return result.Path.FullPath; + } + + [TestCase("C:/Warp/warp.exe", ExpectedResult = "C:/Warp/warp.exe", IncludePlatform = "win")] + public string Should_Use_Warp_Runner_From_Tool_Path_If_Provided_OnWindows( + string toolPath) + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + fixture.Settings.ToolPath = toolPath; + fixture.GivenSettingsToolPathExist(); + + var result = fixture.Run(); + + Assert.That(result.Path, Is.Not.Null); + return result.Path.FullPath; + } + + [TestCase(WarpPlatforms.LinuxX64, "linux-x64")] + [TestCase(WarpPlatforms.MacOSX64, "macos-x64")] + [TestCase(WarpPlatforms.WindowsX64, "windows-x64")] + public void Should_Set_Architecture(WarpPlatforms platform, string expected) + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + fixture.Settings.Platform = platform; + + var result = fixture.Run(); + + Assert.That(result.Args, Does.Contain("--arch " + expected)); + } + + [Test] + public void Should_Set_InputDirectory() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + Assume.That(fixture.Settings.InputDirectory, Is.Not.Null); + + var result = fixture.Run(); + + Assert.That(result.Args, Does.Contain($"--input_dir \"{Environment.CurrentDirectory}\"")); + } + + [Test] + public void Should_Set_ExecFileName() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + Assume.That(fixture.Settings.ExecutableName, Is.Not.Null.And.Not.Empty); + + var result = fixture.Run(); + + Assert.That(result.Args, Does.Contain($"--exec \"Cake.Warp.Demo.exe\"")); + } + + [Test] + public void Should_Set_OutputPath() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + Assume.That(fixture.Settings.InputDirectory, Is.Not.Null); + + var result = fixture.Run(); + + Assert.That(result.Args, Does.Contain($"--output \"cake-warp-demo\"")); + } + } +} diff --git a/src/Cake.Warp/AssemblyInfo.cs b/src/Cake.Warp/AssemblyInfo.cs new file mode 100644 index 0000000..5d16963 --- /dev/null +++ b/src/Cake.Warp/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Cake.Warp.Tests")] diff --git a/src/Cake.Warp/WarpPlatforms.cs b/src/Cake.Warp/WarpPlatforms.cs index 9f7e4a1..4057def 100644 --- a/src/Cake.Warp/WarpPlatforms.cs +++ b/src/Cake.Warp/WarpPlatforms.cs @@ -14,7 +14,7 @@ public enum WarpPlatforms /// /// Create the application as a Mac OSX x64 executable. /// /// - MacOsx64, + MacOSX64, /// /// Create the application as a Windows x64 executable. diff --git a/src/Cake.Warp/WarpRunner.cs b/src/Cake.Warp/WarpRunner.cs new file mode 100644 index 0000000..bb36b43 --- /dev/null +++ b/src/Cake.Warp/WarpRunner.cs @@ -0,0 +1,98 @@ +namespace Cake.Warp +{ + using System; + using System.Collections.Generic; + using Cake.Core; + using Cake.Core.IO; + using Cake.Core.Tooling; + + /// + /// The runner implementation responsible for + /// passing the correct arguments to the warp packer. + /// + internal sealed class WarpRunner : Tool + { + /// + /// Initializes a new instance of the class. + /// + /// The file system. + /// The environment. + /// The process runner. + /// The tool locator. + internal WarpRunner( + IFileSystem fileSystem, + ICakeEnvironment environment, + IProcessRunner processRunner, + IToolLocator tools) + : base(fileSystem, environment, processRunner, tools) + { + } + + /// + /// Runs the tool using the specified settings. + /// + /// The settings to run the tool with. + internal void Run(WarpSettings settings) + { + if (settings == null) + { + throw new ArgumentNullException(nameof(settings)); + } + + // TODO: Validate arguments before trying to create them. + this.Run(settings, GetArguments(settings)); + } + + /// + /// Gets the possible names of the tool executable. + /// + /// The tool executable name. + protected override IEnumerable GetToolExecutableNames() + { + yield return "warp-packer"; + yield return "warp-packer.exe"; + } + + /// + /// Gets the name of the tool. + /// + /// The name of the tool. + protected override string GetToolName() + { + return "Warp Packer"; + } + + private static ProcessArgumentBuilder GetArguments(WarpSettings settings) + { + var builder = new ProcessArgumentBuilder(); + + // An enum should always have a value. + string architecture; + switch (settings.Architecture) + { + case WarpPlatforms.LinuxX64: + architecture = "linux-x64"; + break; + case WarpPlatforms.MacOSX64: + // ReSharper disable once StringLiteralTypo + architecture = "macos-x64"; + break; + case WarpPlatforms.WindowsX64: + architecture = "windows-x64"; + break; + default: + throw new NotSupportedException("The specified platform/architecture is not supported"); + } + + builder.AppendSwitch("--arch", architecture); + + builder.AppendSwitchQuoted("--input_dir", settings.InputDirectory.FullPath); + + builder.AppendSwitchQuoted("--exec", settings.ExecutableName); + + builder.AppendSwitchQuoted("--output", settings.OutputFilePath.FullPath); + + return builder; + } + } +} diff --git a/src/Cake.Warp/WarpSettings.cs b/src/Cake.Warp/WarpSettings.cs index 19067d0..3962157 100644 --- a/src/Cake.Warp/WarpSettings.cs +++ b/src/Cake.Warp/WarpSettings.cs @@ -8,6 +8,11 @@ namespace Cake.Warp /// /// Contains the settings used by . /// + /// + /// All properties are required + /// (except as this as just an alias + /// for ). + /// public sealed class WarpSettings : ToolSettings { /// From d7574259b5e59b5be7524e24810ce9a96b024eaa Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 19:58:49 +0200 Subject: [PATCH 51/68] (GH-12) Added basic validation of runner arguments --- src/Cake.Warp.Tests/WarpRunnerTests.cs | 50 ++++++++++++++++++++++++++ src/Cake.Warp/WarpRunner.cs | 23 +++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/src/Cake.Warp.Tests/WarpRunnerTests.cs b/src/Cake.Warp.Tests/WarpRunnerTests.cs index 47e6fa9..070de2b 100644 --- a/src/Cake.Warp.Tests/WarpRunnerTests.cs +++ b/src/Cake.Warp.Tests/WarpRunnerTests.cs @@ -154,5 +154,55 @@ public void Should_Set_OutputPath() Assert.That(result.Args, Does.Contain($"--output \"cake-warp-demo\"")); } + + [Test] + public void Should_Throw_ArgumentNullExcetion_When_InputDir_Is_Null() + { + void FixtureResult() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + fixture.Settings.InputDirectory = null; + + fixture.Run(); + } + + Assert.That(FixtureResult, Throws.ArgumentNullException + .With.Message.Contains(nameof(WarpSettings.InputDirectory))); + } + + [TestCase(null)] + [TestCase("")] + [TestCase(" ")] + public void Should_Throw_ArgumentNullExcetion_When_ExecutableName_Is_Null_Or_Empty(string value) + { + void FixtureResult() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + fixture.Settings.ExecutableName = value; + + fixture.Run(); + } + + Assert.That(FixtureResult, Throws.ArgumentNullException + .With.Message.Contains(nameof(WarpSettings.ExecutableName))); + } + + [Test] + public void Should_Throw_ArgumentNullExcetion_When_OutputFilePath_Is_Null() + { + void FixtureResult() + { + var fixture = new WarpRunnerFixture(); + fixture.GivenExpectedSettings(); + fixture.Settings.OutputFilePath = null; + + fixture.Run(); + } + + Assert.That(FixtureResult, Throws.ArgumentNullException + .With.Message.Contains(nameof(WarpSettings.OutputFilePath))); + } } } diff --git a/src/Cake.Warp/WarpRunner.cs b/src/Cake.Warp/WarpRunner.cs index bb36b43..f9c3a71 100644 --- a/src/Cake.Warp/WarpRunner.cs +++ b/src/Cake.Warp/WarpRunner.cs @@ -39,7 +39,7 @@ internal void Run(WarpSettings settings) throw new ArgumentNullException(nameof(settings)); } - // TODO: Validate arguments before trying to create them. + ValidateSettingsProperties(settings); this.Run(settings, GetArguments(settings)); } @@ -94,5 +94,26 @@ private static ProcessArgumentBuilder GetArguments(WarpSettings settings) return builder; } + + private static void ValidateSettingsProperties(WarpSettings settings) + { + if (settings.InputDirectory == null) + { + throw new ArgumentNullException(nameof(settings.InputDirectory)); + } + + if (string.IsNullOrWhiteSpace(settings.ExecutableName)) + { + throw new ArgumentNullException(nameof(settings.ExecutableName)); + } + + if (settings.OutputFilePath == null) + { + throw new ArgumentNullException(nameof(settings.OutputFilePath)); + } + + // We could handle wether the directory/files exist, + // we will let warp packer handle this for now. + } } } From 3bb59e33be65052a22931debaa1f7c8be38e29da Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 20:27:10 +0200 Subject: [PATCH 52/68] (build) Resharper + windows fixes --- src/Cake.Warp.Tests/WarpRunnerFixture.cs | 1 - src/Cake.Warp.Tests/WarpRunnerTests.cs | 14 ++++++++------ src/Cake.Warp.Tests/WarpSettingsTests.cs | 8 ++++---- src/Cake.Warp.sln.DotSettings | 2 ++ src/Cake.Warp/WarpRunner.cs | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Cake.Warp.Tests/WarpRunnerFixture.cs b/src/Cake.Warp.Tests/WarpRunnerFixture.cs index cf44aa7..6768719 100644 --- a/src/Cake.Warp.Tests/WarpRunnerFixture.cs +++ b/src/Cake.Warp.Tests/WarpRunnerFixture.cs @@ -1,6 +1,5 @@ namespace Cake.Warp.Tests { - using System; using Cake.Testing; using Cake.Testing.Fixtures; diff --git a/src/Cake.Warp.Tests/WarpRunnerTests.cs b/src/Cake.Warp.Tests/WarpRunnerTests.cs index 070de2b..c2d23a4 100644 --- a/src/Cake.Warp.Tests/WarpRunnerTests.cs +++ b/src/Cake.Warp.Tests/WarpRunnerTests.cs @@ -2,6 +2,7 @@ namespace Cake.Warp.Tests { using System; using Cake.Core; + using Cake.Core.IO; using Cake.Testing; using Cake.Warp.Common; using NUnit.Framework; @@ -127,8 +128,9 @@ public void Should_Set_InputDirectory() Assume.That(fixture.Settings.InputDirectory, Is.Not.Null); var result = fixture.Run(); + var expectedDirectory = new FilePath(Environment.CurrentDirectory); - Assert.That(result.Args, Does.Contain($"--input_dir \"{Environment.CurrentDirectory}\"")); + Assert.That(result.Args, Does.Contain($"--input_dir \"{expectedDirectory}\"")); } [Test] @@ -140,7 +142,7 @@ public void Should_Set_ExecFileName() var result = fixture.Run(); - Assert.That(result.Args, Does.Contain($"--exec \"Cake.Warp.Demo.exe\"")); + Assert.That(result.Args, Does.Contain("--exec \"Cake.Warp.Demo.exe\"")); } [Test] @@ -152,11 +154,11 @@ public void Should_Set_OutputPath() var result = fixture.Run(); - Assert.That(result.Args, Does.Contain($"--output \"cake-warp-demo\"")); + Assert.That(result.Args, Does.Contain("--output \"cake-warp-demo\"")); } [Test] - public void Should_Throw_ArgumentNullExcetion_When_InputDir_Is_Null() + public void Should_Throw_ArgumentNullException_When_InputDir_Is_Null() { void FixtureResult() { @@ -174,7 +176,7 @@ void FixtureResult() [TestCase(null)] [TestCase("")] [TestCase(" ")] - public void Should_Throw_ArgumentNullExcetion_When_ExecutableName_Is_Null_Or_Empty(string value) + public void Should_Throw_ArgumentNullException_When_ExecutableName_Is_Null_Or_Empty(string value) { void FixtureResult() { @@ -190,7 +192,7 @@ void FixtureResult() } [Test] - public void Should_Throw_ArgumentNullExcetion_When_OutputFilePath_Is_Null() + public void Should_Throw_ArgumentNullException_When_OutputFilePath_Is_Null() { void FixtureResult() { diff --git a/src/Cake.Warp.Tests/WarpSettingsTests.cs b/src/Cake.Warp.Tests/WarpSettingsTests.cs index ea3c157..58ab5d1 100644 --- a/src/Cake.Warp.Tests/WarpSettingsTests.cs +++ b/src/Cake.Warp.Tests/WarpSettingsTests.cs @@ -1,9 +1,9 @@ -using System; -using System.IO; -using NUnit.Framework; - namespace Cake.Warp.Tests { + using System; + using System.IO; + using NUnit.Framework; + public class WarpSettingsTests { diff --git a/src/Cake.Warp.sln.DotSettings b/src/Cake.Warp.sln.DotSettings index c49da23..30aabd1 100644 --- a/src/Cake.Warp.sln.DotSettings +++ b/src/Cake.Warp.sln.DotSettings @@ -6,8 +6,10 @@ True True OS + OSX <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> True True + True diff --git a/src/Cake.Warp/WarpRunner.cs b/src/Cake.Warp/WarpRunner.cs index f9c3a71..f96cdb6 100644 --- a/src/Cake.Warp/WarpRunner.cs +++ b/src/Cake.Warp/WarpRunner.cs @@ -112,7 +112,7 @@ private static void ValidateSettingsProperties(WarpSettings settings) throw new ArgumentNullException(nameof(settings.OutputFilePath)); } - // We could handle wether the directory/files exist, + // We could handle whether the directory/files exist, // we will let warp packer handle this for now. } } From aaa42f1299edb418dbff099c3063328998f14047 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 20:56:28 +0200 Subject: [PATCH 53/68] (build) Reverted appveyor image back to vs2017 --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 67cc905..331f01e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,6 @@ image: - Ubuntu - - Visual Studio 2019 + - Visual Studio 2017 version: '{build}' pull_requests: do_not_increment_build_number: true From 67a5c39da0ce17d0e4602ea554968ca0854af66c Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 21:19:34 +0200 Subject: [PATCH 54/68] (build) Updated codecov settings This is to reflect that we currently are unable to create coverage reports on any other platform than windows --- .codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codecov.yml b/.codecov.yml index 70f88e4..5c3d528 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,7 +3,7 @@ codecov: - !travis-ci coverage: - range: "85...100" + range: "70...100" status: changes: yes From 869eab61ac2c6d82248e3b7634cda510867c678b Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 22:00:53 +0200 Subject: [PATCH 55/68] (GH-13) Added first draft of the wyam documentation fixes #13 --- .gitignore | 3 +- config.wyam | 3 + docs/input/_Bottom.cshtml | 50 +++++++++++ docs/input/_Footer.cshtml | 1 + docs/input/assets/css/override.less | 124 ++++++++++++++++++++++++++ docs/input/assets/images/clippy.svg | 3 + docs/input/assets/js/anchor.min.js | 6 ++ docs/input/assets/js/clipboard.min.js | 7 ++ docs/input/docs/building/index.cshtml | 7 ++ docs/input/docs/building/linux.md | 21 +++++ docs/input/docs/building/macos.md | 11 +++ docs/input/docs/building/windows.md | 28 ++++++ docs/input/docs/index.cshtml | 19 ++++ docs/input/docs/usage/contributing.md | 35 ++++++++ docs/input/docs/usage/index.cshtml | 7 ++ docs/input/docs/usage/intro.md | 22 +++++ docs/input/index.cshtml | 35 ++++++++ recipe.cake | 3 +- 18 files changed, 382 insertions(+), 3 deletions(-) create mode 100644 config.wyam create mode 100644 docs/input/_Bottom.cshtml create mode 100644 docs/input/_Footer.cshtml create mode 100644 docs/input/assets/css/override.less create mode 100644 docs/input/assets/images/clippy.svg create mode 100644 docs/input/assets/js/anchor.min.js create mode 100644 docs/input/assets/js/clipboard.min.js create mode 100644 docs/input/docs/building/index.cshtml create mode 100644 docs/input/docs/building/linux.md create mode 100644 docs/input/docs/building/macos.md create mode 100644 docs/input/docs/building/windows.md create mode 100644 docs/input/docs/index.cshtml create mode 100644 docs/input/docs/usage/contributing.md create mode 100644 docs/input/docs/usage/index.cshtml create mode 100644 docs/input/docs/usage/intro.md create mode 100644 docs/input/index.cshtml diff --git a/.gitignore b/.gitignore index 01529bc..7608d1e 100644 --- a/.gitignore +++ b/.gitignore @@ -49,8 +49,7 @@ ehthumbs_vista.db docs/input/tasks/* # Wyam related -docs/config.wyam.dll -docs/config.wyam.hash +config.wyam.* # Project specific ignore list diff --git a/config.wyam b/config.wyam new file mode 100644 index 0000000..5b69b4d --- /dev/null +++ b/config.wyam @@ -0,0 +1,3 @@ +System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB"); +Settings["LinkHideExtensions"] = true; +Settings["LinksUseHttps"] = true; diff --git a/docs/input/_Bottom.cshtml b/docs/input/_Bottom.cshtml new file mode 100644 index 0000000..bdff4e8 --- /dev/null +++ b/docs/input/_Bottom.cshtml @@ -0,0 +1,50 @@ + + + + + diff --git a/docs/input/_Footer.cshtml b/docs/input/_Footer.cshtml new file mode 100644 index 0000000..b0e7552 --- /dev/null +++ b/docs/input/_Footer.cshtml @@ -0,0 +1 @@ +Copyright © 2017-@(System.DateTime.Now.Year) Kim J. Nordmo diff --git a/docs/input/assets/css/override.less b/docs/input/assets/css/override.less new file mode 100644 index 0000000..4485281 --- /dev/null +++ b/docs/input/assets/css/override.less @@ -0,0 +1,124 @@ +/* Control the margin for bootstrap alert boxes */ +.alert > p { + margin-top: 0px; +} + +.btn-copy { + /* Control the look and feel of the copy box applied to code sections */ + &[disabled] .clippy { + opacity: .3; + } + + pre & { + -webkit-transition: opacity 0.3s ease-in-out; + -o-transition: opacity 0.3s ease-in-out; + -moz-transition: opacity 0.3s ease-in-out; + transition: opacity 0.3s ease-in-out; + opacity: 0; + padding: 2px 6px; + float: right; + } + + pre:hover & { + opacity: 1; + } +} + +.tooltipped { + position: relative; + + &:after, &:before { + position: absolute; + display: none; + pointer-events: none; + } + + &:after { + z-index: 1000000; + padding: 5px 8px; + font: normal normal 11px/1.5 Helvetica arial, nimbussans1, liberationsans, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; + color: #fff; + text-align: center; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-wrap: break-word; + white-space: pre; + content: attr(aria-label); + background: rgba(0, 0, 0, 0.8); + border-radius: 3px; + -webkit-font-smoothing: subpixel-antialiased; + } + + &:before { + z-index: 1000001; + width: 0; + height: 0; + color: rgba(0, 0, 0, 0.8); + content: ""; + border: 5px solid transparent; + } + + &:hover, &:active, &:focus { + &:before, &:after { + display: inline-block; + text-decoration: none; + } + } +} + +.tooltipped-s, .tooltipped-se, .tooltipped-sw { + &:after { + top: 100%; + right: 50%; + margin-top: 5px; + } + + &:before { + top:auto; + right: 50%; + bottom: -5px; + margin-right: -5px; + border-bottom-color: rgba(0, 0, 0, 0.8); + } +} + +@font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif; + +/* For GitHub */ +.bottom-footer { + margin-bottom: 40px !important; // Make room for the GitHub button +} + +.github-button { + z-index: 100; + position: fixed; + bottom: 0px; + right: 90px; + padding: 1em 3em; + background-color: #367fa9; + border: 0; + border-top-left-radius: 0.5em; + border-top-right-radius: 0.5em; + font-family: sans-serif; + font-size: 9pt; + text-transform: uppercase; + text-align: center; + text-decoration: none; + cursor: pointer; + cursor: hand; + -webkit-transition: all .3s ease; + -o-transition: all .3s ease; + -moz-transition: all .3s ease; + transition: all .3s ease; + color: #fff; + a, a:active, a:hover, a:focus { + color: #fff; + } + + &:hover, &:focus { + background-color: #4EABDD; + color: #fff; + } +} diff --git a/docs/input/assets/images/clippy.svg b/docs/input/assets/images/clippy.svg new file mode 100644 index 0000000..a06cc7a --- /dev/null +++ b/docs/input/assets/images/clippy.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/docs/input/assets/js/anchor.min.js b/docs/input/assets/js/anchor.min.js new file mode 100644 index 0000000..44431c2 --- /dev/null +++ b/docs/input/assets/js/anchor.min.js @@ -0,0 +1,6 @@ +/** + * AnchorJS - v3.2.2 - 2016-10-05 + * https://github.com/bryanbraun/anchorjs + * Copyright (c) 2016 Bryan Braun; Licensed MIT + */ +!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";function A(A){function e(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.class=A.hasOwnProperty("class")?A.class:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64}function t(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}function n(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style"),t=" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",n=" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",i=' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',o=" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }";e.className="anchorjs",e.appendChild(document.createTextNode("")),A=document.head.querySelector('[rel="stylesheet"], style'),void 0===A?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(t,e.sheet.cssRules.length),e.sheet.insertRule(n,e.sheet.cssRules.length),e.sheet.insertRule(o,e.sheet.cssRules.length),e.sheet.insertRule(i,e.sheet.cssRules.length)}}this.options=A||{},this.elements=[],e(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var i,o,s,c,r,a,h,l,u,d,f,p,w=[];if(e(this.options),p=this.options.visible,"touch"===p&&(p=this.isTouchDevice()?"always":"hover"),A||(A="h1, h2, h3, h4, h5, h6"),i=t(A),0===i.length)return!1;for(n(),o=document.querySelectorAll("[id]"),s=[].map.call(o,function(A){return A.id}),r=0;r-1,t=A.lastChild&&(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ")>-1;return e||t||!1}}return A}); \ No newline at end of file diff --git a/docs/input/assets/js/clipboard.min.js b/docs/input/assets/js/clipboard.min.js new file mode 100644 index 0000000..1d7c5d5 --- /dev/null +++ b/docs/input/assets/js/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v1.5.16 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Clipboard=e()}}(function(){var e,t,n;return function e(t,n,i){function o(a,c){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return o(n?n:e)},u,u.exports,e,t,n,i)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function e(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function e(){var t=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.addEventListener("focus",window.scrollTo(0,i)),this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function e(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function e(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function e(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function e(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function e(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function e(){this.removeFake()}},{key:"action",set:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function e(){return this._action}},{key:"target",set:function e(t){if(void 0!==t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function e(){return this._target}}]),e}();e.exports=c})},{select:5}],8:[function(t,n,i){!function(o,r){if("function"==typeof e&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof i)r(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var a={exports:{}};r(a,o.clipboardAction,o.tinyEmitter,o.goodListener),o.clipboard=a.exports}}(this,function(e,t,n,i){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var s=o(t),u=o(n),f=o(i),d=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText}},{key:"listenClick",value:function e(t){var n=this;this.listener=(0,f.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function e(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})}},{key:"defaultAction",value:function e(t){return l("action",t)}},{key:"defaultTarget",value:function e(t){var n=l("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function e(t){return l("text",t)}},{key:"destroy",value:function e(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}]),t}(u.default);e.exports=h})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}); \ No newline at end of file diff --git a/docs/input/docs/building/index.cshtml b/docs/input/docs/building/index.cshtml new file mode 100644 index 0000000..8ec10c2 --- /dev/null +++ b/docs/input/docs/building/index.cshtml @@ -0,0 +1,7 @@ +--- +Order: 3 +Description: How to build the Cake.Warp library +--- +

@Html.Raw(Model.String(DocsKeys.Description))

+ +@Html.Partial("_ChildPages") diff --git a/docs/input/docs/building/linux.md b/docs/input/docs/building/linux.md new file mode 100644 index 0000000..ab2b099 --- /dev/null +++ b/docs/input/docs/building/linux.md @@ -0,0 +1,21 @@ +--- +Order: 2 +Title: Building on Linux +Author: Kim Nordmo +--- + +## Requirements + +The following are need to build Cake.Warp on Linux: + +- .NET Core SDK 2.1 as a minimum +- Mono 5.0.0+ *(earlier versions may work, but are not supported)* + +All other dependencies will be automatically downloaded when invoking the build script. + +## Invoking the build itself + +1. To build the Cake.Warp library, just open any shell and navigate to the root of +downloaded/cloned repository. +2. After that just type `sh build.sh` and everything will be automatically built and all unit tests +will run. diff --git a/docs/input/docs/building/macos.md b/docs/input/docs/building/macos.md new file mode 100644 index 0000000..604e2a4 --- /dev/null +++ b/docs/input/docs/building/macos.md @@ -0,0 +1,11 @@ +--- +Order: 3 +Title: Building on OSX +ValidateLinksAsError: true +Author: Kim Nordmo +--- + +Building on MAC OSX is highly untested, and any contribution to document +the build process would be greatly appreciated. + +In the meantime, try following the *[Building on Linux](linux)* documentation. diff --git a/docs/input/docs/building/windows.md b/docs/input/docs/building/windows.md new file mode 100644 index 0000000..152ce0e --- /dev/null +++ b/docs/input/docs/building/windows.md @@ -0,0 +1,28 @@ +--- +Order: 1 +Title: Building on Windows +Author: Kim Nordmo +--- + +## Requirements + +The following are need to build Cake.Warp on Windows: + +- Visual Studio 2019 (or as long as MSBuild 16.0 is installed) +- .NET Core SDK 2.1 *(could work with other versions as well)* +- .NET Framework 4.7.1 + +All other dependencies will be automatically downloaded when invoking the build script. + +## Invoking the build itself + +1. To build the Cake.Warp library, just open powershell and navigate to the root of +downloaded/cloned repository. +2. After that just type `.\build.ps1` and everything will be automatically built and all unit tests +will run. + +## Creating a redistributable nuget package + +To create a nuget package you can follow the same process as when building the library, +with the exception of calling `.\build.ps1` without any arguments. +The only difference is to run the build script with the following: `.\build.ps1 -Target Package`. diff --git a/docs/input/docs/index.cshtml b/docs/input/docs/index.cshtml new file mode 100644 index 0000000..267292d --- /dev/null +++ b/docs/input/docs/index.cshtml @@ -0,0 +1,19 @@ +--- +Title: Documentation +--- +

This user guide, like Cake.Warp itself, is under very active development. Some parts of it aren't +documented as completely as they need to be, but we gladly accept your contributions.

+ +

We need your help to improve the documentation for Cake.Warp, so if there is something that you +would like to add then you can edit the content directly on GitHub.

+ +@foreach(IDocument child in Model.DocumentList(Keys.Children).OrderBy(x => x.Get(DocsKeys.Order, 1000))) +{ +

@(child.String(Keys.Title))

+ if(child.ContainsKey(DocsKeys.Description)) + { +

@Html.Raw(child.String(DocsKeys.Description))

+ } + + @Html.Partial("_ChildPages", child) +} diff --git a/docs/input/docs/usage/contributing.md b/docs/input/docs/usage/contributing.md new file mode 100644 index 0000000..ab06d1a --- /dev/null +++ b/docs/input/docs/usage/contributing.md @@ -0,0 +1,35 @@ +--- +Order: 20 +Title: Contributing +--- + +This is very much an active project so any and all contributions are welcome, even just finding issues! + +## Reporting Issues + +All issues should be tracked at [GitHub](https://github.com/cake-contrib/Cake.Warp), +with enough information to reproduce the issue. + +See the [contrubiton docs](https://github.com/cake-contrib/Cake.Warp/blob/develop/CONTRIBUTING.md) for expectations when creating issues. + +## Code Contributions + +This repository is based around the Git Flow workflow, using feature/hotfix/bugfix branches and pull requests to manage incoming changes and fixes. Generally speaking you can follow a similar guidance as Cake itself (found [here](http://cakebuild.net/docs/contributing/guidelines)), which can be summarised as follows: + +- Find a change or fix you want to implement +- Fork the repo +- Workflow for new features + - Create a new branch named `feature/` and make your changes + - Open a PR from your feature branch against the `develop` branch (include the GitHub issue number) +- Workflow for bug fixes in the latest stable version + - Create a new branch named `hotfix/` and make your changes + - Open a PR from your hotfix branch against the `master` branch (include the GitHub issue number) + *(This will be re-targeted to a different branch when accepted)* +- Workflow for bug fixes in an unpublished version of Cake.Warp + - Create a new branch named `bugfix/` and make your changes + - Open a PR from your bugfix branch against the `develop` branch (include the GitHub issue number) +- Success! I will provide feedback if needed, or just accept the changes directly and they should appear in the next release + +## License + +Note that this project (and all contributions) fall under the [MIT License terms](https://github.com/cake-contrib/Cake.Warp/blob/develop/LICENSE). diff --git a/docs/input/docs/usage/index.cshtml b/docs/input/docs/usage/index.cshtml new file mode 100644 index 0000000..fdbfb25 --- /dev/null +++ b/docs/input/docs/usage/index.cshtml @@ -0,0 +1,7 @@ +--- +Order: 2 +Description: How to obtain, configure, and execute Cake.Warp. +--- +

@Html.Raw(Model.String(DocsKeys.Description))

+ +@Html.Partial("_ChildPages") diff --git a/docs/input/docs/usage/intro.md b/docs/input/docs/usage/intro.md new file mode 100644 index 0000000..25884a3 --- /dev/null +++ b/docs/input/docs/usage/intro.md @@ -0,0 +1,22 @@ +--- +Order: 10 +Title: Introduction +Author: Kim Nordmo +--- + +# Getting Started + +This addin is designed to be used inside of cake scripts. To start using it, first you must add a cake [preprocessor directive](http://cakebuild.net/docs/fundamentals/preprocessor-directives) to your script as below. + +```cs +// latest version +#addin "Cake.Warp" + +// or +#addin "nuget?package=Cake.Warp" + +// for a specific version, use ?version= +#addin "Cake.Warp?version=0.3.0" +``` + +When the cake script is run, this will download the latest version of the `Cake.Warp` nuget package and will now be available to use inside of the script. diff --git a/docs/input/index.cshtml b/docs/input/index.cshtml new file mode 100644 index 0000000..2e8b019 --- /dev/null +++ b/docs/input/index.cshtml @@ -0,0 +1,35 @@ +--- +Title: Cake.Warp +NoSidebar: true +NoContainer: false +NoGutter: false +--- + +
+

What is it?

+

+ Cake.Warp is an addin for the Cake Build script adding support for creating stand-alone platform specific + binaries on Linux, MAC OSX, and Windows. +

+ +

Where to get it

+

+ Officially published versions are available on + + NuGet + . + While development versions are made available using the following nuget end point: + + https://ci.appveyor.com/nuget/cake-warp + + Every build produces nuget packages on this feed, be it official builds, + Pull Requests, or anything between. As such, it is very important to + pin the version used in your build script. +

+ +

Cake support

+

+ This addin targets .NET Standard 2.0 framework and .NET 4.6.1, which + allows you to use the addin with either Cake, Cake.CoreCLR or Cake.Tool. +

+
diff --git a/recipe.cake b/recipe.cake index e66619d..fa4b3dc 100644 --- a/recipe.cake +++ b/recipe.cake @@ -20,7 +20,8 @@ BuildParameters.SetParameters(context: Context, appVeyorAccountName: "cakecontrib", shouldRunGitVersion: true, shouldExecuteGitLink: false, - shouldRunCodecov: true); + shouldRunCodecov: true, + shouldDeployGraphDocumentation: false); BuildParameters.PrintParameters(Context); From 464d8b589ced36caaf2077d60c953b291b5cd586 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 22:03:03 +0200 Subject: [PATCH 56/68] (docs) Added example usage to readme documentation --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a798f57..37cb772 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Cake.Warp + [![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) @@ -16,13 +17,33 @@ You may start using Cake.Warp as soon as you have imported the addin into you cake build script with the following: -``` +```cs #addin nuget:?package=Cake.Warp&version=0.1.0 ``` ## Usage -``` +The most basic use of Cake.Warp is by first creating a standalone +executable through dotnet publish, then calling Warp to create the self-contained binary. + +```cs +#addin nuget:?package=Cake.Warp&version=0.1.0 + +Task("Create-Warp-Binary") + .Does(() => +{ + DotNetCorePublish("./src/Cake.Warp.Demo", new DotNetCorePublishSettings { + Framework = "netcoreapp2.0", + RuntimeIdentifier = "linux-x64", + Configuration = "Release", + OutputDirectory = "./artifacts/output" + }); + Warp("./artifacts/output", + "Cake.Warp.Demo", // Must include .exe if creating for windows + "./artifacts/cake-warp-demo", + WarpPlatforms.LinuxX64 + ); +}); ``` ## Maintainers From 1bfa316fdb8a1092b3dcd29314d4e186c823c45b Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 22:16:39 +0200 Subject: [PATCH 57/68] (docs) Added missing badges --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 37cb772..43caba1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ [![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) +![GitHub](https://img.shields.io/github/license/cake-contrib/Cake.Warp.svg?style=flat-square) +[![AppVeyor](https://img.shields.io/appveyor/ci/cakecontrib/cake-warp.svg?logo=AppVeyor&style=flat-square)](https://ci.appveyor.com/project/cakecontrib/cake-warp) +[![Travis (.org)](https://img.shields.io/travis/cake-contrib/Cake.Warp.svg?logo=travis&style=flat-square)](https://travis-ci.org/cake-contrib/Cake.Warp) +[![Codecov](https://img.shields.io/codecov/c/github/cake-contrib/Cake.Warp.svg?logo=codecov&style=flat-square)]() +[![Nuget](https://img.shields.io/nuget/v/Cake.Warp.svg?logo=nuget&style=flat-square)](https://nuget.org/packages/Cake.Warp) > Cake addin for creating self-contained single binary applications using [warp](https://github.com/dgiagio/warp) From aa03c3b3be4c5bdf126a7a71d3d4edcf1552b5eb Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 21:18:35 +0200 Subject: [PATCH 58/68] (GH-6) Added the first two basic aliases fixes #6 --- src/Cake.Warp/WarpAliases.cs | 135 +++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 src/Cake.Warp/WarpAliases.cs diff --git a/src/Cake.Warp/WarpAliases.cs b/src/Cake.Warp/WarpAliases.cs new file mode 100644 index 0000000..7a6eaa3 --- /dev/null +++ b/src/Cake.Warp/WarpAliases.cs @@ -0,0 +1,135 @@ +namespace Cake.Warp +{ + using Cake.Core; + using Cake.Core.Annotations; + using Cake.Core.IO; + using JetBrains.Annotations; + + /// + /// + /// Runs the warp binary (embedded in addin) to create a + /// stand-alone packed binary for supported platforms. + /// + /// + /// In order to use the commands for this addin, you will need + /// to include the following in your cake script. + /// + /// + /// #addin nuget:?package=Cake.Warp&version=0.1.0 + /// /// + /// + [PublicAPI] + [CakeAliasCategory("Compilation")] + public static class WarpAliases + { + /// + /// Runs the warp packer binary on the specified + /// , and outputs the + /// resulting packed binary to . + /// + /// The cake context + /// + /// The directory that should be packed into the resulting binary + /// file. + /// + /// + /// The name of the file that should be executed when the + /// packed binary is launched by the user. (Needs to already exist + /// in the ). + /// + /// + /// The location where the created packed binary file should + /// be created. + /// + /// + /// The architecture/platform to create the binary file for. + /// See for valid values. + /// + /// + /// This example shows a basic call to create the packed binary, + /// by first calling dotnet publish to create the program. + /// + /// #addin nuget:?package=Cake.Warp&version=0.1.0 + /// + /// Task("Create-Warp-Binary") + /// .Does(() => + /// { + /// DotNetCorePublish("./src/Cake.Warp.Demo", new DotNetCorePublishSettings { + /// Framework = "netcoreapp2.0", + /// RuntimeIdentifier = "linux-x64", + /// Configuration = "Release", + /// OutputDirectory = "./artifacts/output" + /// }); + /// Warp("./artifacts/output", + /// "Cake.Warp.Demo", // Must include .exe if creating for windows + /// "./artifacts/cake-warp-demo", + /// WarpPlatforms.LinuxX64 + /// ); + /// }); + /// + /// + [CakeMethodAlias] + public static void Warp( + this ICakeContext context, + DirectoryPath inputDirectory, + string executableName, + FilePath outputFilePath, + WarpPlatforms architecture + ) + { + Warp(context, new WarpSettings + { + InputDirectory = inputDirectory, + ExecutableName = executableName, + OutputFilePath = outputFilePath, + Architecture = architecture + }); + } + + /// + /// Runs the warp packer binary with the specified + /// . + /// + /// The settings to use when creating the packed binary file. + /// + /// + /// + /// This example shows a basic call to create the packed binary, + /// by first calling dotnet publish to create the program. + /// + /// #addin nuget:?package=Cake.Warp&version=0.1.0 + /// + /// Task("Create-Warp-Binary") + /// .Does(() => + /// { + /// DotNetCorePublish("./src/Cake.Warp.Demo", new DotNetCorePublishSettings { + /// Framework = "netcoreapp2.0", + /// RuntimeIdentifier = "win-x64", + /// Configuration = "Release", + /// OutputDirectory = "./artifacts/output" + /// }); + /// Warp(new WarpSettings { + /// InputDirectory = "./artifacts/output", + /// ExecutableName = "Cake.Warp.Demo.exe, + /// OutputFilePath = "./artifacts/cake-warp-demo", + /// Architecture = WarpPlatform.WindowsX64 + /// }); + /// }); + /// + /// + [CakeMethodAlias] + public static void Warp( + this ICakeContext context, + WarpSettings settings + ) + { + var runner = new WarpRunner( + context.FileSystem, + context.Environment, + context.ProcessRunner, + context.Tools + ); + runner.Run(settings); + } + } +} From 2b029d8b0525fa91e766b55683acbb8ded38e18a Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 22:25:16 +0200 Subject: [PATCH 59/68] (docs) Corrected documentation in source files --- src/Cake.Warp/AssemblyInfo.cs | 3 +++ src/Cake.Warp/WarpAliases.cs | 15 ++++++++------- src/Cake.Warp/WarpPlatforms.cs | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Cake.Warp/AssemblyInfo.cs b/src/Cake.Warp/AssemblyInfo.cs index 5d16963..01d64b0 100644 --- a/src/Cake.Warp/AssemblyInfo.cs +++ b/src/Cake.Warp/AssemblyInfo.cs @@ -1,3 +1,6 @@ using System.Runtime.CompilerServices; +// Would prefer not to do this, but we have +// the WarpRunner as an internal. Therefor we +// must (unless we want to make use of reflection). [assembly: InternalsVisibleTo("Cake.Warp.Tests")] diff --git a/src/Cake.Warp/WarpAliases.cs b/src/Cake.Warp/WarpAliases.cs index 7a6eaa3..6ee03d8 100644 --- a/src/Cake.Warp/WarpAliases.cs +++ b/src/Cake.Warp/WarpAliases.cs @@ -15,8 +15,8 @@ namespace Cake.Warp /// to include the following in your cake script. /// /// - /// #addin nuget:?package=Cake.Warp&version=0.1.0 - /// /// + /// #addin nuget:?package=Cake.Warp&version=0.1.0 + /// ///
[PublicAPI] [CakeAliasCategory("Compilation")] @@ -49,7 +49,7 @@ public static class WarpAliases /// This example shows a basic call to create the packed binary, /// by first calling dotnet publish to create the program. /// - /// #addin nuget:?package=Cake.Warp&version=0.1.0 + /// #addin nuget:?package=Cake.Warp&version=0.1.0 /// /// Task("Create-Warp-Binary") /// .Does(() => @@ -88,16 +88,17 @@ WarpPlatforms architecture /// /// Runs the warp packer binary with the specified - /// . + /// . + /// + /// The cake context /// /// The settings to use when creating the packed binary file. /// - ///
/// /// This example shows a basic call to create the packed binary, /// by first calling dotnet publish to create the program. /// - /// #addin nuget:?package=Cake.Warp&version=0.1.0 + /// #addin nuget:?package=Cake.Warp&version=0.1.0 /// /// Task("Create-Warp-Binary") /// .Does(() => @@ -112,7 +113,7 @@ WarpPlatforms architecture /// InputDirectory = "./artifacts/output", /// ExecutableName = "Cake.Warp.Demo.exe, /// OutputFilePath = "./artifacts/cake-warp-demo", - /// Architecture = WarpPlatform.WindowsX64 + /// Architecture = WarpPlatform.WindowsX64" /// }); /// }); /// diff --git a/src/Cake.Warp/WarpPlatforms.cs b/src/Cake.Warp/WarpPlatforms.cs index 4057def..285ba33 100644 --- a/src/Cake.Warp/WarpPlatforms.cs +++ b/src/Cake.Warp/WarpPlatforms.cs @@ -13,7 +13,7 @@ public enum WarpPlatforms /// /// Create the application as a Mac OSX x64 executable. - /// /// + ///
MacOSX64, /// From 236c928e504b286060034fadbd0f874103698763 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 22:26:46 +0200 Subject: [PATCH 60/68] (GH-16) Enabled dotnet pack in build script Still need to add the necessary metadata for the package creation --- recipe.cake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index fa4b3dc..f21abfa 100644 --- a/recipe.cake +++ b/recipe.cake @@ -21,7 +21,8 @@ BuildParameters.SetParameters(context: Context, shouldRunGitVersion: true, shouldExecuteGitLink: false, shouldRunCodecov: true, - shouldDeployGraphDocumentation: false); + shouldDeployGraphDocumentation: false, + shouldRunDotNetCorePack: true); BuildParameters.PrintParameters(Context); From 7f7e32b5c314327c0f0a996660fdbade6efa59e0 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Sun, 12 May 2019 22:34:38 +0200 Subject: [PATCH 61/68] (docs) Added missing link to codecov --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43caba1..b844f19 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![GitHub](https://img.shields.io/github/license/cake-contrib/Cake.Warp.svg?style=flat-square) [![AppVeyor](https://img.shields.io/appveyor/ci/cakecontrib/cake-warp.svg?logo=AppVeyor&style=flat-square)](https://ci.appveyor.com/project/cakecontrib/cake-warp) [![Travis (.org)](https://img.shields.io/travis/cake-contrib/Cake.Warp.svg?logo=travis&style=flat-square)](https://travis-ci.org/cake-contrib/Cake.Warp) -[![Codecov](https://img.shields.io/codecov/c/github/cake-contrib/Cake.Warp.svg?logo=codecov&style=flat-square)]() +[![Codecov](https://img.shields.io/codecov/c/github/cake-contrib/Cake.Warp.svg?logo=codecov&style=flat-square)](https://codecov.io/gh/cake-contrib/Cake.Warp) [![Nuget](https://img.shields.io/nuget/v/Cake.Warp.svg?logo=nuget&style=flat-square)](https://nuget.org/packages/Cake.Warp) > Cake addin for creating self-contained single binary applications using [warp](https://github.com/dgiagio/warp) From 2e87d99fa537137c2c072bdc4c4912f8bb875f5f Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" Date: Sun, 12 May 2019 20:36:02 +0000 Subject: [PATCH 62/68] docs: update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b844f19..79d79a5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cake.Warp -[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) ![GitHub](https://img.shields.io/github/license/cake-contrib/Cake.Warp.svg?style=flat-square) [![AppVeyor](https://img.shields.io/appveyor/ci/cakecontrib/cake-warp.svg?logo=AppVeyor&style=flat-square)](https://ci.appveyor.com/project/cakecontrib/cake-warp) @@ -75,6 +75,8 @@ This project follows the [all-contributors](https://github.com/all-contributors/ +
Kim J. Nordmo
Kim J. Nordmo

🚧
+ ## License From 90fab5b506f9c51274ce32eeb520ed468acfdc79 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" Date: Sun, 12 May 2019 20:36:03 +0000 Subject: [PATCH 63/68] docs: update .all-contributorsrc --- .all-contributorsrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index f879f45..a77f37a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -9,6 +9,16 @@ "imageSize": 70, "commit": false, "commitConvention": "none", - "contributors": [], + "contributors": [ + { + "login": "AdmiringWorm", + "name": "Kim J. Nordmo", + "avatar_url": "https://avatars3.githubusercontent.com/u/1474648?v=4", + "profile": "https://github.com/AdmiringWorm", + "contributions": [ + "maintenance" + ] + } + ], "contributorsPerLine": 7 } From 05a701f9911d6622e8282897133017717d95abda Mon Sep 17 00:00:00 2001 From: "Kim J. Nordmo" Date: Sun, 12 May 2019 22:52:07 +0200 Subject: [PATCH 64/68] Added codecov to required status check in mergify --- .mergify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mergify.yml b/.mergify.yml index 55e9d9b..dcdc513 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -26,6 +26,7 @@ pull_request_rules: conditions: - "status-success=continuous-integration/appveyor/pr" - "status-success=continuous-integration/travis-ci/pr" + - "status-success=codecov/patch" - "#approved-reviews-by>=1" - "#review-requested=0" - "#changes-requested-reviews-by=0" From 569b4d5928b381a4be120cd17213b4d433de6a73 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Mon, 13 May 2019 15:03:54 +0200 Subject: [PATCH 65/68] (GH-16) Added package metadata fixes #16 --- src/Cake.Warp.Demo/Cake.Warp.Demo.csproj | 1 + src/Cake.Warp/Cake.Warp.csproj | 26 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj index c4bf75a..687ffbb 100644 --- a/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj +++ b/src/Cake.Warp.Demo/Cake.Warp.Demo.csproj @@ -6,6 +6,7 @@ 7.3 true win-x64;linux-x64;osx-x64 + false diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index ac31298..8221345 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -5,6 +5,30 @@ true true Cake.Warp.ruleset + en-GB + Cake Warp addin + + + + 2019 + $([System.DateTime]::Now.Year) + $(StartYear) + $(StartYear)-$(EndYear) + + + $(AssemblyTitle) + Kim J. Nordmo;cake-contrib + Copyright © $(FullYear) - $(Authors) + Cake addin for creating self-contained single binary applications using [warp](https://github.com/dgiagio/warp). + + false + https://cdn.jsdelivr.net/gh/cake-contrib/graphics@49c3b71def749b86416d773f1ead0c0da2d590ea/png/cake-contrib-medium.png + MIT + https://cake-contrib.github.io/Cake.Warp/ + cake;addin;warp;self-contained + git + https://github.com/cake-contrib/Cake.Warp.git @@ -14,7 +38,7 @@ - + runtime; build; native; contentfiles; analyzers all From 8f842783c46cfffdb1b40a45a04da2a64903456a Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Mon, 13 May 2019 15:17:58 +0200 Subject: [PATCH 66/68] (build) Fixed stylecop issues --- src/Cake.Warp/WarpAliases.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Cake.Warp/WarpAliases.cs b/src/Cake.Warp/WarpAliases.cs index 6ee03d8..a88192f 100644 --- a/src/Cake.Warp/WarpAliases.cs +++ b/src/Cake.Warp/WarpAliases.cs @@ -27,7 +27,7 @@ public static class WarpAliases /// , and outputs the /// resulting packed binary to . ///
- /// The cake context + /// The cake context. /// /// The directory that should be packed into the resulting binary /// file. @@ -74,15 +74,14 @@ public static void Warp( DirectoryPath inputDirectory, string executableName, FilePath outputFilePath, - WarpPlatforms architecture - ) + WarpPlatforms architecture) { Warp(context, new WarpSettings { InputDirectory = inputDirectory, ExecutableName = executableName, OutputFilePath = outputFilePath, - Architecture = architecture + Architecture = architecture, }); } @@ -90,7 +89,7 @@ WarpPlatforms architecture /// Runs the warp packer binary with the specified /// . ///
- /// The cake context + /// The cake context. /// /// The settings to use when creating the packed binary file. /// @@ -121,15 +120,13 @@ WarpPlatforms architecture [CakeMethodAlias] public static void Warp( this ICakeContext context, - WarpSettings settings - ) + WarpSettings settings) { var runner = new WarpRunner( context.FileSystem, context.Environment, context.ProcessRunner, - context.Tools - ); + context.Tools); runner.Run(settings); } } From 027d63c124a5d13a63551d13e35f06f6f9cdb158 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Mon, 13 May 2019 15:43:06 +0200 Subject: [PATCH 67/68] (docs) Added ability to create release notes --- GitReleaseManager.yaml | 4 ++-- recipe.cake | 7 ++++++- src/Cake.Warp/Cake.Warp.csproj | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml index 50ae00c..ce6aa74 100644 --- a/GitReleaseManager.yaml +++ b/GitReleaseManager.yaml @@ -3,7 +3,7 @@ create: footer-heading: Where to get it footer-content: > You can download this release from - [nuget](https://nuget.org/packages/Cake.Warp/{milestone}, + [nuget](https://nuget.org/packages/Cake.Warp/{milestone}), or you can just reference it in a cake build script with `#addin nuget:?package?Cake.Warp&version={milestone}`. footer-includes-milestone: true @@ -12,7 +12,7 @@ export: include-created-date-in-title: true created-date-string-format: yyyy-MM-dd perform-regex-removal: true - regex-text: '### Where to get it(\r?\n)*You can .*\)' + regex-text: '[\r\n]*### Where to get it[\r\n]*You can .*`\.[\r\n]*' multiline-regex: true issue-labels-include: - Breaking Change diff --git a/recipe.cake b/recipe.cake index f21abfa..6519015 100644 --- a/recipe.cake +++ b/recipe.cake @@ -22,9 +22,14 @@ BuildParameters.SetParameters(context: Context, shouldExecuteGitLink: false, shouldRunCodecov: true, shouldDeployGraphDocumentation: false, - shouldRunDotNetCorePack: true); + shouldRunDotNetCorePack: true, + shouldDownloadMilestoneReleaseNotes: true, + shouldDownloadFullReleaseNotes: true, + milestoneReleaseNotesFilePath: "./BuildArtifacts/MILESTONE.md", + fullReleaseNotesFilePath: "./CHANGELOG.md"); BuildParameters.PrintParameters(Context); +BuildParameters.Tasks.ExportReleaseNotesTask.IsDependentOn("Clean"); ToolSettings.SetToolSettings(context: Context, dupFinderExcludePattern: new[] { diff --git a/src/Cake.Warp/Cake.Warp.csproj b/src/Cake.Warp/Cake.Warp.csproj index 8221345..09fd409 100644 --- a/src/Cake.Warp/Cake.Warp.csproj +++ b/src/Cake.Warp/Cake.Warp.csproj @@ -29,6 +29,8 @@ cake;addin;warp;self-contained git https://github.com/cake-contrib/Cake.Warp.git + $(MSBuildProjectDirectory)/../../BuildArtifacts/MILESTONE.md + $([System.IO.File]::ReadAllText("$(MilestoneReleasePath)")) From 207d725cc9896b342f4bde1d145c47b2d7ff37ba Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Mon, 13 May 2019 16:04:09 +0200 Subject: [PATCH 68/68] (docs) Added changelog file --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9499e50 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +## 0.1.0 (2019-05-13) + + +As part of this release we had [11 issues](https://github.com/cake-contrib/Cake.Warp/milestone/1?closed=1) closed. +The first public release of Cake.Warp + +__Enhancement__ + +- [__#16__](https://github.com/cake-contrib/Cake.Warp/issues/16) Create nuget packages through dotnet pack + +__Features__ + +- [__#7__](https://github.com/cake-contrib/Cake.Warp/issues/7) Create the settings class that will hold all parameters that will be passed to warp +- [__#6__](https://github.com/cake-contrib/Cake.Warp/issues/6) Add the first basic alias that allows the use of warp +- [__#5__](https://github.com/cake-contrib/Cake.Warp/issues/5) Target Cake version 0.28.0 for the first release +- [__#4__](https://github.com/cake-contrib/Cake.Warp/issues/4) Embedd the warp binaries and extract the correct binary when the library gets loaded + +__Documentation__ + +- [__#13__](https://github.com/cake-contrib/Cake.Warp/issues/13) Create basic documentation using Wyam +- [__#1__](https://github.com/cake-contrib/Cake.Warp/issues/1) Add documentation related files