├── .gitignore
├── .nuget
├── Microsoft.Build.dll
├── NuGet.Config
├── NuGet.Core.dll
├── NuGet.exe
└── NuGet.targets
├── LICENSE.txt
├── NOTICE.txt
├── README.md
├── Sake.sln
├── Sakefile.shade
├── build
├── build.cmd
├── examples
├── intro1
│ └── makefile.shade
├── intro2
│ └── makefile.shade
└── makefile.shade
├── prerelease
└── Spark
│ └── lib
│ ├── Spark.dll
│ └── Spark.pdb
├── src
├── AssemblyVersionInfo.cs
├── Sake.Engine.Tests
│ ├── DefaultLoaderTests.cs
│ ├── Files
│ │ ├── AnotherFolder
│ │ │ └── FromAnotherFolder.shade
│ │ ├── DependenciesShouldBeRegistered.shade
│ │ ├── Sakefile.shade
│ │ ├── Shared
│ │ │ └── _shouldfindpartialinsharedfolder.shade
│ │ ├── ShouldAddTargetAsDependencyToNamedTarget.shade
│ │ ├── ShouldFindPartialFilesInCurrentDirectoryOrSharedSubdirectory.shade
│ │ ├── ShouldFindPartialFilesInSharedFolderUnderEngineAssembly.shade
│ │ ├── ShouldLoadFilesFromIncludeDir.shade
│ │ ├── SingleFile
│ │ │ ├── UseThisOne.shade
│ │ │ ├── _not-this-one.shade
│ │ │ └── _or-this-one.shade
│ │ └── _shouldfindpartialincurrentfolder.shade
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Sake.Engine.Tests.csproj
│ ├── SakeEngineOptionsTests.cs
│ ├── SakeEngineTests.cs
│ ├── Sakefile.shade
│ ├── Starter.cs
│ ├── different.shade
│ └── packages.config
├── Sake.Engine
│ ├── Builder
│ │ ├── BuilderBase.cs
│ │ ├── IBuilder.cs
│ │ └── Target.cs
│ ├── ISakeSettings.cs
│ ├── Loader
│ │ ├── DefaultLoader.cs
│ │ ├── ExtensionFactory.cs
│ │ ├── FunctionsExtension.cs
│ │ ├── ILoader.cs
│ │ └── TargetExtension.cs
│ ├── Logging
│ │ ├── DefaultLog.cs
│ │ └── ILog.cs
│ ├── Options.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Runner
│ │ ├── DefaultRunner.cs
│ │ └── IRunner.cs
│ ├── Sake.Engine.csproj
│ ├── SakeEngine.cs
│ ├── SakeSettings.cs
│ └── packages.config
├── Sake.Library
│ ├── Code
│ │ ├── MakefileTargetsDataAttribute.cs
│ │ ├── MakefileTests.cs
│ │ ├── Program.cs
│ │ └── RemoveEscapes.cs
│ ├── Data
│ │ ├── Asseminfo
│ │ │ └── versions.txt
│ │ └── Files
│ │ │ ├── Sub
│ │ │ ├── delta.txt
│ │ │ └── gamma.txt
│ │ │ ├── alpha.txt
│ │ │ ├── another.log
│ │ │ └── beta.txt
│ ├── Init
│ │ ├── Init-BuildCmd.txt
│ │ ├── Init-BuildSh.txt
│ │ ├── Init-SakefileShade.txt
│ │ └── Sakefile.shade
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Sake.Library.Tests.csproj
│ ├── Shared
│ │ ├── Environment.shade
│ │ ├── Files.shade
│ │ ├── PathResolver.shade
│ │ ├── Regex.shade
│ │ ├── _assemblyinfo.shade
│ │ ├── _build.shade
│ │ ├── _copy.shade
│ │ ├── _directory.shade
│ │ ├── _exec-clr.shade
│ │ ├── _exec.shade
│ │ ├── _log.shade
│ │ ├── _nuget-install.shade
│ │ ├── _nuget-pack.shade
│ │ ├── _nuget-push.shade
│ │ ├── _nunit.shade
│ │ ├── _stylecop.shade
│ │ ├── _update-file.shade
│ │ ├── _use-standard-goals.shade
│ │ ├── _use-standard-lifecycle.shade
│ │ ├── _use-teamcity.shade
│ │ └── _xunit.shade
│ ├── app.config
│ ├── packages.config
│ ├── test-assemblyinfo.shade
│ ├── test-copy.shade
│ ├── test-directory.shade
│ ├── test-files.shade
│ └── test-regex.shade
└── Sake
│ ├── ConsoleWriter.cs
│ ├── Program.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Sake.csproj
│ ├── Sake.nuspec
│ ├── app.config
│ └── packages.config
└── todo.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | *.user
2 | *.suo
3 | _ReSharper*
4 | packages
5 | bin
6 | obj
7 | target
8 | *.userprefs
9 | *.pidb
10 | *.log
11 |
12 |
--------------------------------------------------------------------------------
/.nuget/Microsoft.Build.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sakeproject/sake/b0dddb601967bbfba59e8bc317f4e9d8fb6cfda0/.nuget/Microsoft.Build.dll
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.nuget/NuGet.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sakeproject/sake/b0dddb601967bbfba59e8bc317f4e9d8fb6cfda0/.nuget/NuGet.Core.dll
--------------------------------------------------------------------------------
/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sakeproject/sake/b0dddb601967bbfba59e8bc317f4e9d8fb6cfda0/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/.nuget/NuGet.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildProjectDirectory)\..\
5 |
6 |
7 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
8 | $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
9 | $([System.IO.Path]::Combine($(SolutionDir), "packages"))
10 |
11 |
12 | $(SolutionDir).nuget
13 | packages.config
14 | $(SolutionDir)packages
15 |
16 |
17 | $(NuGetToolsPath)\NuGet.exe
18 | "$(NuGetExePath)"
19 | mono --runtime=v4.0.30319 $(NuGetExePath)
20 |
21 | $(TargetDir.Trim('\\'))
22 |
23 |
24 | ""
25 |
26 |
27 | false
28 |
29 |
30 | false
31 |
32 |
33 | $(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)"
34 | $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols
35 |
36 |
37 |
38 | RestorePackages;
39 | $(BuildDependsOn);
40 |
41 |
42 |
43 |
44 | $(BuildDependsOn);
45 | BuildPackage;
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
57 |
58 |
61 |
62 |
63 |
64 |
66 |
67 |
70 |
71 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | Sake build system
2 | Copyright 2012 Louis DeJardin and Contributors
3 |
4 | I. Included Third-Party Software
5 |
6 | This product includes software developed at
7 | Spark View Engine
8 | (http://sparkviewengine.com).
9 | Copyright 2008-2012 Louis DeJardin and Contributors
10 | Licensed under Apache License 2.0
11 |
12 | This product includes software developed at
13 | NDesk
14 | (http://ndesk.org).
15 | Copyright 2008 Novell
16 | Licensed under The MIT License
17 |
18 | This product includes software developed at
19 | Autofac project
20 | (http://code.google.com/p/autofac/).
21 | Copyright 2011 Autofac Contributors
22 | Licensed under The MIT License
23 |
24 | II. Used Third-Party Software
25 |
26 | This product uses software developed at
27 | ASP.NET Open Source Gallery at Outercurve Foundation
28 | (http://nuget.codeplex.com/)
29 | Copyright 2010-2012 Outercurve Foundation
30 | Licensed under Apache License 2.0
31 |
32 | This product uses software developed at
33 | Microsoft
34 | (http://xunit.codeplex.com/)
35 | Copyright 2007-2012 Microsoft
36 | Licensed under Microsoft Public License (Ms-PL)
37 |
38 | This product uses software developed at
39 | Shouldly project
40 | (http://shouldly.github.com/)
41 | Copyright 2010 Shouldy
42 | Licensed under The BSD License
43 |
44 | III. Overall License Summary
45 |
46 | Redistribution
47 | - Apache License 2.0
48 | - The MIT License
49 |
50 | Uses
51 | - Apache License 2.0
52 | - Microsoft Public License (Ms-PL)
53 | - The BSD License
54 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # CS Make - Sake
3 |
4 | Welcome to Sake, a C# language enabled make system.
5 |
6 | ## Getting Sake from source and building
7 |
8 | This also a way you can see Sake in action - it downloads itself from the Nuget gallery to build.
9 |
10 | git clone https://github.com/loudej/sake.git && cd sake && build
11 |
12 | Or to build on Mac or Linux
13 |
14 | git clone https://github.com/loudej/sake.git && cd sake && ./build
15 |
16 |
17 | ## Getting Sake on your machine
18 | ### Via Chocolatey
19 |
20 | This is a convenient if you want to run `sake` in any directory from a command line.
21 |
22 | cinst sake -pre
23 |
24 | First, you'll need to get chocolatey if you don't already have it. From a Package Manager Console
25 |
26 | Install-Package chocolatey
27 | Initialize-Chocolatey
28 | Uninstall-Package chocolatey
29 |
30 | Or there are other ways of getting chocolatey, see https://github.com/chocolatey/chocolatey/wiki/Installation
31 |
32 |
33 | ## Getting Sake in your project's build
34 | ### Via build.cmd bootstrapper
35 |
36 | This is another nice technique if you want to use Sake in your project and don't to need people to install anything machine-wide. What you do is use Nuget.exe to download SAKE from the gallery in a pre-build step. This takes three files, `package.config`, `build.cmd`, and `makefile.shade`.
37 |
38 | #### package.config
39 |
40 |
41 |
42 |
43 |
44 | #### build.cmd
45 | @echo off
46 | ".nuget\NuGet.exe" install -OutputDirectory packages .\packages.config
47 | "packages\Sake.0.1.0-alpha\tools\sake.exe" %*
48 |
49 | #### makefile.shade
50 | #default
51 | log info="Hello world!"
52 |
53 |
--------------------------------------------------------------------------------
/Sake.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sake", "src\Sake\Sake.csproj", "{9AC10F39-DE9E-46F3-926A-5A158AD322E5}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sake.Engine", "src\Sake.Engine\Sake.Engine.csproj", "{0296FE05-EFEA-4ED2-8B82-62B7795CF309}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sake.Engine.Tests", "src\Sake.Engine.Tests\Sake.Engine.Tests.csproj", "{610D7F7C-EA12-4B1E-8B08-429F838F40E9}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Welcome", ".Welcome", "{7452152B-F437-4719-8C73-9A098C5F4113}"
11 | ProjectSection(SolutionItems) = preProject
12 | todo.txt = todo.txt
13 | EndProjectSection
14 | EndProject
15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{890674E8-6A33-4781-9978-4F616FE41C02}"
16 | ProjectSection(SolutionItems) = preProject
17 | .nuget\NuGet.exe = .nuget\NuGet.exe
18 | .nuget\NuGet.targets = .nuget\NuGet.targets
19 | EndProjectSection
20 | EndProject
21 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{B84E4C5F-147B-488D-8D69-80EBDB405A79}"
22 | ProjectSection(SolutionItems) = preProject
23 | build.cmd = build.cmd
24 | build = build
25 | Sakefile.shade = Sakefile.shade
26 | EndProjectSection
27 | EndProject
28 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sake.Library.Tests", "src\Sake.Library\Sake.Library.Tests.csproj", "{2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}"
29 | EndProject
30 | Global
31 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
32 | Debug|Any CPU = Debug|Any CPU
33 | Debug|Mixed Platforms = Debug|Mixed Platforms
34 | Debug|x86 = Debug|x86
35 | Release|Any CPU = Release|Any CPU
36 | Release|Mixed Platforms = Release|Mixed Platforms
37 | Release|x86 = Release|x86
38 | Retail|Any CPU = Retail|Any CPU
39 | Retail|Mixed Platforms = Retail|Mixed Platforms
40 | Retail|x86 = Retail|x86
41 | EndGlobalSection
42 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
43 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Debug|Any CPU.ActiveCfg = Debug|x86
44 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
45 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Debug|Mixed Platforms.Build.0 = Debug|x86
46 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Debug|x86.ActiveCfg = Debug|x86
47 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Debug|x86.Build.0 = Debug|x86
48 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Release|Any CPU.ActiveCfg = Release|x86
49 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Release|Mixed Platforms.ActiveCfg = Release|x86
50 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Release|Mixed Platforms.Build.0 = Release|x86
51 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Release|x86.ActiveCfg = Release|x86
52 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Release|x86.Build.0 = Release|x86
53 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Retail|Any CPU.ActiveCfg = Release|x86
54 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Retail|Mixed Platforms.ActiveCfg = Release|x86
55 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Retail|Mixed Platforms.Build.0 = Release|x86
56 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Retail|x86.ActiveCfg = Release|x86
57 | {9AC10F39-DE9E-46F3-926A-5A158AD322E5}.Retail|x86.Build.0 = Release|x86
58 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Debug|Any CPU.Build.0 = Debug|Any CPU
60 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
61 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
62 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Debug|x86.ActiveCfg = Debug|Any CPU
63 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Release|Any CPU.ActiveCfg = Release|Any CPU
64 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Release|Any CPU.Build.0 = Release|Any CPU
65 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
66 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Release|Mixed Platforms.Build.0 = Release|Any CPU
67 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Release|x86.ActiveCfg = Release|Any CPU
68 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Retail|Any CPU.ActiveCfg = Release|Any CPU
69 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Retail|Any CPU.Build.0 = Release|Any CPU
70 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Retail|Mixed Platforms.ActiveCfg = Release|Any CPU
71 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Retail|Mixed Platforms.Build.0 = Release|Any CPU
72 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}.Retail|x86.ActiveCfg = Release|Any CPU
73 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
75 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
76 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
77 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Debug|x86.ActiveCfg = Debug|Any CPU
78 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
79 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Release|Any CPU.Build.0 = Release|Any CPU
80 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
81 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
82 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Release|x86.ActiveCfg = Release|Any CPU
83 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Retail|Any CPU.ActiveCfg = Release|Any CPU
84 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Retail|Any CPU.Build.0 = Release|Any CPU
85 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Retail|Mixed Platforms.ActiveCfg = Release|Any CPU
86 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Retail|Mixed Platforms.Build.0 = Release|Any CPU
87 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}.Retail|x86.ActiveCfg = Release|Any CPU
88 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Debug|Any CPU.ActiveCfg = Debug|x86
89 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
90 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Debug|Mixed Platforms.Build.0 = Debug|x86
91 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Debug|x86.ActiveCfg = Debug|x86
92 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Debug|x86.Build.0 = Debug|x86
93 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Release|Any CPU.ActiveCfg = Release|x86
94 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Release|Mixed Platforms.ActiveCfg = Release|x86
95 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Release|Mixed Platforms.Build.0 = Release|x86
96 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Release|x86.ActiveCfg = Release|x86
97 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Release|x86.Build.0 = Release|x86
98 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Retail|Any CPU.ActiveCfg = Release|x86
99 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Retail|Mixed Platforms.ActiveCfg = Release|x86
100 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Retail|Mixed Platforms.Build.0 = Release|x86
101 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Retail|x86.ActiveCfg = Release|x86
102 | {2AEB7DA4-82DF-45D2-9991-AF6A47F91ADB}.Retail|x86.Build.0 = Release|x86
103 | EndGlobalSection
104 | GlobalSection(SolutionProperties) = preSolution
105 | HideSolutionNode = FALSE
106 | EndGlobalSection
107 | GlobalSection(NestedProjects) = preSolution
108 | {890674E8-6A33-4781-9978-4F616FE41C02} = {7452152B-F437-4719-8C73-9A098C5F4113}
109 | {B84E4C5F-147B-488D-8D69-80EBDB405A79} = {7452152B-F437-4719-8C73-9A098C5F4113}
110 | EndGlobalSection
111 | GlobalSection(MonoDevelopProperties) = preSolution
112 | StartupItem = src\Sake.Library\Sake.Library.csproj
113 | EndGlobalSection
114 | EndGlobal
115 |
--------------------------------------------------------------------------------
/Sakefile.shade:
--------------------------------------------------------------------------------
1 |
2 | var VERSION='0.2.0'
3 | var FULL_VERSION='${VERSION}'
4 | var AUTHORS='Sake contributors'
5 |
6 | var BASE_DIR='${Directory.GetCurrentDirectory()}'
7 | var TARGET_DIR='${Path.Combine(BASE_DIR, "target")}'
8 | var BUILD_DIR='${Path.Combine(TARGET_DIR, "build")}'
9 | var TEST_DIR='${Path.Combine(TARGET_DIR, "test")}'
10 |
11 | use-standard-lifecycle
12 | use-standard-goals features='xunit,nuget'
13 |
14 |
15 | #add-files-for-packaging target='package-prepare'
16 | copy sourceDir='src/Sake.Library/Init' outputDir='${BUILD_DIR}/Sake' overwrite='${true}'
17 | copy sourceDir='src/Sake.Library/Shared' outputDir='${BUILD_DIR}/Sake/Shared' overwrite='${true}'
18 |
19 |
--------------------------------------------------------------------------------
/build:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | export EnableNuGetPackageRestore=true
4 | mono --runtime=v4.0 "./.nuget/NuGet.exe" install Sake -pre -o packages
5 | mono $(find packages/Sake.*/tools/Sake.exe|sort -r|head -n1) -I "src/Sake.Library/Shared" "$@"
6 |
7 |
--------------------------------------------------------------------------------
/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | cd %~dp0
3 |
4 | setlocal
5 | set EnableNuGetPackageRestore=true
6 | set Configuration=Release
7 |
8 | msbuild /fl /v:Q Sake.sln
9 |
10 | src\Sake\bin\%Configuration%\sake.exe -I src\Sake.Library\Shared %*
11 | set __sake__=
12 |
13 |
--------------------------------------------------------------------------------
/examples/intro1/makefile.shade:
--------------------------------------------------------------------------------
1 |
2 | use namespace="System"
3 | use namespace="System.IO"
4 |
5 | @{
6 | var baseDir = Directory.GetCurrentDirectory();
7 | var targetDir = Path.Combine(baseDir, "target");
8 |
9 | var aboutText = @"
10 | This example is mostly showing how you can create a build
11 | file that is almost entirely C# code
12 | ";
13 |
14 | }
15 |
16 |
17 | #default description="First target, which is called when no targets are provided"
18 | @{
19 | Log.Info("No target specified - calling 'test'");
20 | CallTarget("test");
21 |
22 | Log.Info("For more information, run `sake about`");
23 | }
24 |
25 |
26 | #clean description="Wipe out the ./target subfolder"
27 | @{
28 | Log.Info("cleaning");
29 | if (Directory.Exists(targetDir))
30 | {
31 | Log.Info("Deleting - " + targetDir);
32 | Directory.Delete(targetDir, true);
33 | }
34 | }
35 |
36 |
37 | #build .clean description="Add some files to the ./target subfolder"
38 | @{
39 | Log.Info("building");
40 | if (!Directory.Exists(targetDir))
41 | {
42 | Directory.CreateDirectory(targetDir);
43 | }
44 | for (var index = 0; index != 10; ++index)
45 | {
46 | var fileName = Path.Combine(targetDir, "file_" + index + ".txt");
47 | Log.Info("Writing - " + fileName);
48 | File.WriteAllText(fileName, "This is file " + index);
49 | }
50 | }
51 |
52 |
53 | #test .build description="Test that files exist in ./target subfolder :)"
54 | @{
55 | Log.Info("testing");
56 | var files = Directory.GetFiles(targetDir);
57 | if (files.Length != 10)
58 | {
59 | throw new Exception("Expected 10 files");
60 | }
61 | }
62 |
63 |
64 | #about description="Provides info about this sample"
65 | @{
66 | Log.Info(aboutText);
67 | Log.Info("It has the following targets:");
68 | foreach(var target in Targets.Values)
69 | {
70 | Log.Info(string.Format("{0} - {1}", target.Name, target.Description));
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/examples/intro2/makefile.shade:
--------------------------------------------------------------------------------
1 |
2 | use namespace="System"
3 | use namespace="System.IO"
4 | use namespace="System.Linq"
5 |
6 | var baseDir='${Directory.GetCurrentDirectory()}'
7 | var targetDir='${Path.Combine(baseDir, "target")}'
8 |
9 | var aboutText='
10 | This example is the same as intro1/makefile.shade but uses
11 | element tags more often than c# code
12 | '
13 |
14 |
15 | #default description="First target, which is called when no targets are provided"
16 | log info="No target specified - calling 'test'"
17 | -CallTarget("test");
18 | log info="For more information, run `sake about`"
19 |
20 |
21 | #clean description="Wipe out the ./target subfolder"
22 | log info="cleaning"
23 | test if="Directory.Exists(targetDir)"
24 | log info='Deleting - " + targetDir'
25 | -Directory.Delete(targetDir, true);
26 |
27 |
28 | #build .clean description="Add some files to the ./target subfolder"
29 | log info="building"
30 | test if="!Directory.Exists(targetDir)"
31 | -Directory.CreateDirectory(targetDir);
32 |
33 | for each="var index in Enumerable.Range(0, 10)"
34 | var fileName='${Path.Combine(targetDir, "file_" + index + ".txt")}'
35 | log info="Writing - ${fileName}"
36 | -File.WriteAllText(fileName, "This is file " + index);
37 |
38 |
39 | #test .build description="Test that files exist in ./target subfolder :)"
40 | log info="testing"
41 | var files="${Directory.GetFiles(targetDir)}"
42 | test if='(files.Length != 10)'
43 | -throw new Exception("Expected 10 files");
44 |
45 |
46 | #about description="Provides info about this sample"
47 | log info='${aboutText}'
48 | log info='It has the following targets:'
49 | log info='${target.Name} - ${target.Description}' each='var target in Targets.Values'
50 |
--------------------------------------------------------------------------------
/examples/makefile.shade:
--------------------------------------------------------------------------------
1 |
2 | use namespace='System'
3 | use namespace='System.IO'
4 |
5 |
6 | #default
7 | log info='This is the examples directory'
8 | log info='Run `sake about` to see description of all samples'
9 | log info='Run `sake all` to run the default target in each subfolder'
10 |
11 |
12 | #about
13 | log info='Showing information about every example folder'
14 | for each='var folder in Directory.GetDirectories(Directory.GetCurrentDirectory())'
15 | log info='-'
16 | log info='=== ${Path.GetFileName(folder)} ==='
17 | log info='-'
18 | exec program='sake' workingdir='${folder}' commandline='about'
19 |
20 |
21 | #all
22 | log info='Running the default target in each subfolder'
23 | for each='var folder in Directory.GetDirectories(Directory.GetCurrentDirectory())'
24 | log info='-'
25 | log info='=== ${Path.GetFileName(folder)} ==='
26 | log info='-'
27 | exec program='sake' workingdir='${folder}'
28 |
29 |
--------------------------------------------------------------------------------
/prerelease/Spark/lib/Spark.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sakeproject/sake/b0dddb601967bbfba59e8bc317f4e9d8fb6cfda0/prerelease/Spark/lib/Spark.dll
--------------------------------------------------------------------------------
/prerelease/Spark/lib/Spark.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sakeproject/sake/b0dddb601967bbfba59e8bc317f4e9d8fb6cfda0/prerelease/Spark/lib/Spark.pdb
--------------------------------------------------------------------------------
/src/AssemblyVersionInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | [assembly: AssemblyVersion("0.1.0")]
4 | [assembly: AssemblyFileVersion("0.1.0")]
5 | [assembly: AssemblyInformationalVersion("0.2.0")]
6 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/DefaultLoaderTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using Sake.Engine.Loader;
4 | using Sake.Engine.Logging;
5 | using Shouldly;
6 | using Xunit;
7 |
8 | namespace Sake.Engine.Tests.Loader
9 | {
10 | public class DefaultLoaderTests
11 | {
12 | private readonly DefaultLoader _loader;
13 | private SakeSettings _settings;
14 |
15 | public DefaultLoaderTests()
16 | {
17 | _settings = new SakeSettings { Output = new StringWriter() };
18 | _loader = new DefaultLoader(new DefaultLog(_settings), _settings);
19 | }
20 |
21 | [Fact]
22 | public void ShouldLoadSparkMakefiles()
23 | {
24 | var options = new Options
25 | {
26 | Makefile = Path.Combine("Files", "Sakefile.shade")
27 | };
28 | var builder = _loader.Load(options);
29 | builder.ShouldNotBe(null);
30 | }
31 |
32 | [Fact]
33 | public void ShouldFailIfFileNotFound()
34 | {
35 | var options = new Options
36 | {
37 | Makefile = Path.Combine("Files", "no-such-file.shade")
38 | };
39 | Should.Throw(() => _loader.Load(options));
40 | }
41 |
42 | [Fact]
43 | public void DependenciesShouldBeRegistered()
44 | {
45 | var options = new Options
46 | {
47 | Makefile = Path.Combine("Files", "DependenciesShouldBeRegistered.shade")
48 | };
49 |
50 | var builder = _loader.Load(options);
51 | builder.Targets.Count.ShouldBe(2);
52 |
53 | builder.Targets["default"].Description.ShouldBe("Default dependency");
54 | builder.Targets["default"].Dependencies.ShouldBe(new[] { "another" });
55 |
56 | builder.Targets["another"].Description.ShouldBe("Another dependency");
57 | builder.Targets["another"].Dependencies.Count.ShouldBe(0);
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/AnotherFolder/FromAnotherFolder.shade:
--------------------------------------------------------------------------------
1 |
2 | #from-another-folder
3 | ='WasFoundInAnotherFolder'
4 |
5 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/DependenciesShouldBeRegistered.shade:
--------------------------------------------------------------------------------
1 |
2 |
3 | @{
4 | RegisterTarget("default", "another", "Default dependency", () =>
5 | {
6 | Echo("This is default");
7 | });
8 | }
9 |
10 | #another description="Another dependency"
11 | ="This is another"
12 |
13 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/Sakefile.shade:
--------------------------------------------------------------------------------
1 |
2 | #Default .Another
3 | ="ExecDefault"
4 | ="This is Files\\makefile.shade"
5 |
6 | #Another
7 | ="ExecAnother"
8 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/Shared/_shouldfindpartialinsharedfolder.shade:
--------------------------------------------------------------------------------
1 |
2 | ='WasFoundInSharedFolder'
3 |
4 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/ShouldAddTargetAsDependencyToNamedTarget.shade:
--------------------------------------------------------------------------------
1 |
2 |
3 | #default
4 | -CallTarget("compile");
5 |
6 |
7 | #compile
8 | ='Compile'
9 |
10 | #added target="compile"
11 | ='HasBeenAdded'
12 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/ShouldFindPartialFilesInCurrentDirectoryOrSharedSubdirectory.shade:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #testing
6 | shouldfindpartialincurrentfolder
7 | shouldfindpartialinsharedfolder
8 |
9 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/ShouldFindPartialFilesInSharedFolderUnderEngineAssembly.shade:
--------------------------------------------------------------------------------
1 |
2 |
3 | #testing
4 | ='one'
5 | shouldfindpartialinassemblyfolder
6 | ='two'
7 | shouldfindpartialinassemblysharedfolder
8 |
9 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/ShouldLoadFilesFromIncludeDir.shade:
--------------------------------------------------------------------------------
1 |
2 |
3 | #default .from-another-folder
4 |
5 | use file="FromAnotherFolder"
6 |
7 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/SingleFile/UseThisOne.shade:
--------------------------------------------------------------------------------
1 |
2 | #single-file
3 | ='ShouldUseSingleShadeFileAsDefault'
4 | not-this-one
5 | or-this-one
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/SingleFile/_not-this-one.shade:
--------------------------------------------------------------------------------
1 |
2 | ='NotThisOne'
3 |
4 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/SingleFile/_or-this-one.shade:
--------------------------------------------------------------------------------
1 |
2 | ='OrThisOne'
3 |
4 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Files/_shouldfindpartialincurrentfolder.shade:
--------------------------------------------------------------------------------
1 |
2 | ='WasFoundInCurrentFolder'
3 |
4 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sake.Engine.Tests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCulture("")]
12 |
13 | // Setting ComVisible to false makes the types in this assembly not visible
14 | // to COM components. If you need to access a type in this assembly from
15 | // COM, set the ComVisible attribute to true on that type.
16 | [assembly: ComVisible(false)]
17 |
18 | // The following GUID is for the ID of the typelib if this project is exposed to COM
19 | [assembly: Guid("1342c2a1-5ab3-4b16-8137-411fb8b2446f")]
20 |
21 | [assembly: AssemblyVersion("0.2.0")]
22 | [assembly: AssemblyFileVersion("0.2.0")]
23 | [assembly: AssemblyInformationalVersion("0.2.0")]
24 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Sake.Engine.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {610D7F7C-EA12-4B1E-8B08-429F838F40E9}
9 | Library
10 | Properties
11 | Sake.Engine.Tests
12 | Sake.Engine.Tests
13 | v4.0
14 | 512
15 | ..\..\
16 | true
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ..\..\packages\Autofac.2.6.1.841\lib\NET40\Autofac.dll
45 |
46 |
47 | ..\..\packages\Autofac.2.6.1.841\lib\NET40\Autofac.Configuration.dll
48 |
49 |
50 | ..\..\packages\Shouldly.1.1.1.0\lib\35\Shouldly.dll
51 |
52 |
53 | ..\..\packages\xunit.1.9.0.1566\lib\xunit.dll
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | Always
66 |
67 |
68 | Always
69 |
70 |
71 | Always
72 |
73 |
74 | Always
75 |
76 |
77 | Always
78 |
79 |
80 | Always
81 |
82 |
83 | Always
84 |
85 |
86 | Always
87 |
88 |
89 | Always
90 | Designer
91 |
92 |
93 | Always
94 |
95 |
96 | Always
97 |
98 |
99 | Always
100 |
101 |
102 | Always
103 |
104 |
105 | Always
106 |
107 |
108 |
109 |
110 |
111 | {0296FE05-EFEA-4ED2-8B82-62B7795CF309}
112 | Sake.Engine
113 |
114 |
115 |
116 |
117 |
118 |
125 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/SakeEngineOptionsTests.cs:
--------------------------------------------------------------------------------
1 | using Autofac;
2 | using Shouldly;
3 | using Xunit;
4 |
5 | namespace Sake.Engine.Tests
6 | {
7 | public class SakeEngineOptionsTests
8 | {
9 | private readonly IContainer _container;
10 | private readonly SakeEngine _engine;
11 |
12 | public SakeEngineOptionsTests()
13 | {
14 | _container = Starter.CreateContainer(new SakeSettings());
15 | _engine = _container.Resolve();
16 | }
17 |
18 | [Fact]
19 | public void VerboseIsRecognized()
20 | {
21 | _engine.Parse("-v").Verbose.ShouldBe(1);
22 | _engine.Parse("--verbose").Verbose.ShouldBe(1);
23 | }
24 |
25 | [Fact]
26 | public void MoreThanOneVerboseMayBePassed()
27 | {
28 | _engine.Parse("-vv").Verbose.ShouldBe(2);
29 | _engine.Parse("-v", "-v").Verbose.ShouldBe(2);
30 | }
31 |
32 | [Fact]
33 | public void PlainOldArgsBecomeTargets()
34 | {
35 | _engine.Parse("this", "is", "a", "test").Targets.ShouldBe(new[] { "this", "is", "a", "test" });
36 | }
37 |
38 | [Fact]
39 | public void MakeFileMayBePassedIn()
40 | {
41 | var options = _engine.Parse("--file", "hello.txt", "foo");
42 | options.Targets.ShouldBe(new[] { "foo" });
43 | options.Makefile.ShouldBe("hello.txt");
44 | }
45 |
46 | [Fact]
47 | public void CurrentDirectoryMayBeProvided()
48 | {
49 | _engine.Parse("-C", "build").ChangeDirectory.ShouldBe(new[] { "build" });
50 | _engine.Parse("--directory", "build").ChangeDirectory.ShouldBe(new[] { "build" });
51 | _engine.Parse("--directory", "build", "-C", "src").ChangeDirectory.ShouldBe(new[] { "build", "src" });
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/SakeEngineTests.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.IO;
3 | using Autofac;
4 | using Shouldly;
5 | using Xunit;
6 |
7 | namespace Sake.Engine.Tests
8 | {
9 | public class SakeEngineTests
10 | {
11 | private readonly IContainer _container;
12 | private readonly SakeEngine _engine;
13 | private readonly StringWriter _writer;
14 | string Output { get { return _writer.ToString(); } }
15 |
16 | public SakeEngineTests()
17 | {
18 | _writer = new StringWriter();
19 | _container = Starter.CreateContainer(new SakeSettings {Output = _writer});
20 | _engine = _container.Resolve();
21 | }
22 |
23 | [Fact]
24 | public void ShouldBeCreated()
25 | {
26 | _engine.ShouldNotBe(null);
27 | }
28 |
29 | [Fact]
30 | public void ShouldLoadMakefileSparkFromCurrentDirectoryByDefault()
31 | {
32 | _engine.Execute();
33 | Output.ShouldContain("ExecDefaultTask");
34 | Output.ShouldContain("ExecAnotherTask");
35 | Output.ShouldContain("ExecYetAnotherTask");
36 | }
37 |
38 | [Fact]
39 | public void ShouldRunNamedTarget()
40 | {
41 | _engine.Execute("YetAnother");
42 | Output.ShouldNotContain("ExecDefaultTask");
43 | Output.ShouldNotContain("ExecAnotherTask");
44 | Output.ShouldContain("ExecYetAnotherTask");
45 | }
46 |
47 | [Fact]
48 | public void ShouldLoadDifferentFileIfProvided()
49 | {
50 | _engine.Execute("-f", "different.shade");
51 | Output.ShouldContain("ExecDifferentFile");
52 | }
53 |
54 | [Fact]
55 | public void ShouldChangeCurrentDirectoryBeforeLoadingFile()
56 | {
57 | _engine.Execute("-C", "Files");
58 | Output.ShouldContain("This is Files\\makefile.shade");
59 | }
60 |
61 | [Fact]
62 | public void ShouldFindPartialFilesInCurrentDirectoryOrSharedSubdirectory()
63 | {
64 | _engine.Execute("-C", "Files", "-f", "ShouldFindPartialFilesInCurrentDirectoryOrSharedSubdirectory.shade");
65 | Output.ShouldContain("WasFoundInCurrentFolder");
66 | Output.ShouldContain("WasFoundInSharedFolder");
67 | }
68 |
69 |
70 | [Fact]
71 | public void ShouldAddTargetAsDependencyToNamedTarget()
72 | {
73 | _engine.Execute("-C", "Files", "-f", "ShouldAddTargetAsDependencyToNamedTarget.shade");
74 | Output.ShouldContain("Compile");
75 | Output.ShouldContain("HasBeenAdded");
76 | }
77 |
78 |
79 | [Fact]
80 | public void ShouldLoadFilesFromIncludeDir()
81 | {
82 | _engine.Execute("-C", "Files", "-f", "ShouldLoadFilesFromIncludeDir.shade", "-I", "AnotherFolder");
83 | Output.ShouldContain("WasFoundInAnotherFolder");
84 | }
85 |
86 |
87 | [Fact]
88 | public void ShouldUseSingleShadeFileAsDefault()
89 | {
90 | _engine.Execute("-C", "Files", "-C", "SingleFile");
91 | Output.ShouldContain("ShouldUseSingleShadeFileAsDefault");
92 | Output.ShouldContain("NotThisOne");
93 | Output.ShouldContain("OrThisOne");
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Sakefile.shade:
--------------------------------------------------------------------------------
1 |
2 | #Default .Another
3 | = 'ExecDefaultTask'
4 |
5 | #Another .YetAnother
6 | = 'ExecAnotherTask'
7 |
8 | #YetAnother
9 | = 'ExecYetAnotherTask'
10 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/Starter.cs:
--------------------------------------------------------------------------------
1 | using Autofac;
2 | using Sake.Engine.Loader;
3 | using Sake.Engine.Logging;
4 | using Sake.Engine.Runner;
5 |
6 | namespace Sake.Engine.Tests
7 | {
8 | public class Starter
9 | {
10 | public static IContainer CreateContainer(ISakeSettings settings)
11 | {
12 | var builder = new ContainerBuilder();
13 | builder.RegisterInstance(settings);
14 | builder.RegisterType();
15 | builder.RegisterType().As();
16 | builder.RegisterType().As();
17 | builder.RegisterType().As();
18 | return builder.Build();
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/different.shade:
--------------------------------------------------------------------------------
1 |
2 |
3 | #build
4 | ='ExecDifferentFile'
5 |
--------------------------------------------------------------------------------
/src/Sake.Engine.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Sake.Engine/Builder/BuilderBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Sake.Engine.Logging;
5 | using Spark;
6 |
7 | namespace Sake.Engine.Builder
8 | {
9 | public abstract class BuilderBase : SparkViewBase, IBuilder
10 | {
11 | private readonly IDictionary _targets = new Dictionary();
12 |
13 | private string _previousTarget;
14 |
15 | public IDictionary Targets
16 | {
17 | get { return _targets; }
18 | }
19 |
20 | public string DefaultTarget { get; set; }
21 |
22 | public void RegisterTarget(string name, string dependencies, string description, Action method)
23 | {
24 | if (string.IsNullOrEmpty(DefaultTarget))
25 | {
26 | DefaultTarget = name;
27 | }
28 |
29 | Target target;
30 | if (!Targets.TryGetValue(name, out target))
31 | {
32 | target = new Target { Name = name, Dependencies = new List() };
33 | Targets.Add(name, target);
34 | }
35 |
36 | if (!string.IsNullOrWhiteSpace(dependencies))
37 | {
38 | target.Dependencies = target.Dependencies
39 | .Concat(dependencies.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)).
40 | ToList();
41 | }
42 |
43 | if (!string.IsNullOrWhiteSpace(description))
44 | {
45 | target.Description = description;
46 | }
47 |
48 | if (method != null)
49 | {
50 | target.Method = method;
51 | }
52 | }
53 |
54 | public virtual void StartingTarget(string name)
55 | {
56 | foreach (var dependency in Targets[name].Dependencies)
57 | {
58 | CallTarget(dependency);
59 | }
60 |
61 | _previousTarget = name;
62 | }
63 |
64 | public void CallTarget(string name)
65 | {
66 | Targets[name].Method.Invoke();
67 | }
68 |
69 | public void Echo(object value)
70 | {
71 | Log.Info(value);
72 | }
73 |
74 | protected object HTML(object value)
75 | {
76 | return value;
77 | }
78 |
79 | protected object H(object value)
80 | {
81 | Log.Info(value);
82 | return "";
83 | }
84 |
85 | public ILog Log { get; set; }
86 |
87 | public ISakeSettings SakeSettings { get; set; }
88 | }
89 |
90 | public abstract class BuilderBase : BuilderBase