Skip to content

Commit 3364311

Browse files
committed
migrated to wyam
1 parent 416fbd1 commit 3364311

File tree

275 files changed

+8856
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+8856
-0
lines changed

.gitattributes

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Pp]ackages/
2+
[Tt]ools/*
3+
![Tt]ools/packages.config
4+
[Oo]utput/
5+
[Ii]nput/dashboard/
6+
[Dd]ependencies/
7+
nuget.exe
8+
[Ll]ocal[Dd]eploy/

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Geoffrey Huntley
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Contributing
2+
3+
```
4+
.\build.cmd -Target preview
5+
```

appveyor.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Build script
2+
init:
3+
- git config --global core.autocrlf true
4+
5+
# Build script
6+
build_script:
7+
- ps: .\build.ps1 -Target "AppVeyor"
8+
9+
# Tests
10+
test: off
11+
12+
# Artifacts
13+
artifacts:
14+
# Static website
15+
- path: output
16+
17+
# Branches to build
18+
branches:
19+
# Whitelist
20+
only:
21+
- master

build.cake

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
#tool "nuget:https://api.nuget.org/v3/index.json?package=Wyam&prerelease"
2+
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Git"
3+
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Wyam&prerelease"
4+
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Yaml"
5+
#addin "nuget:https://api.nuget.org/v3/index.json?package=Octokit"
6+
7+
using Octokit;
8+
9+
//////////////////////////////////////////////////////////////////////
10+
// ARGUMENTS
11+
//////////////////////////////////////////////////////////////////////
12+
13+
var target = Argument("target", "Default");
14+
15+
//////////////////////////////////////////////////////////////////////
16+
// PREPARATION
17+
//////////////////////////////////////////////////////////////////////
18+
19+
// Define variables
20+
var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor;
21+
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
22+
var netlifyToken = EnvironmentVariable("NETLIFY_TOKEN");
23+
var currentBranch = isRunningOnAppVeyor ? BuildSystem.AppVeyor.Environment.Repository.Branch : GitBranchCurrent("./").FriendlyName;
24+
25+
// Define directories.
26+
var dependenciesDir = Directory("./dependencies");
27+
var sourceDir = dependenciesDir + Directory("reactiveui");
28+
var dashboardDir = dependenciesDir + Directory("dashboard");
29+
var outputPath = MakeAbsolute(Directory("./output"));
30+
31+
// Variables
32+
33+
34+
//////////////////////////////////////////////////////////////////////
35+
// SETUP
36+
//////////////////////////////////////////////////////////////////////
37+
38+
39+
Setup(ctx =>
40+
{
41+
// Executed BEFORE the first task.
42+
Information("Building branch {0} ({1})...", currentBranch, deployBranch);
43+
});
44+
45+
46+
//////////////////////////////////////////////////////////////////////
47+
// TASKS
48+
//////////////////////////////////////////////////////////////////////
49+
50+
Task("Clean")
51+
.Does(() =>
52+
{
53+
if(DirectoryExists(dependenciesDir))
54+
{
55+
CleanDirectory(dependenciesDir);
56+
DeleteDirectory(dependenciesDir, true);
57+
}
58+
59+
CreateDirectory(dependenciesDir);
60+
});
61+
62+
Task("GetDashboard")
63+
.IsDependentOn("Clean")
64+
.Does(() =>
65+
{
66+
FilePath dashboardZip = DownloadFile("https://github.com/reactiveui/dashboard/archive/master.zip");
67+
Unzip(dashboardZip, dependenciesDir);
68+
69+
// Need to rename the container directory in the zip file to something consistent
70+
var containerDir = GetDirectories(dependenciesDir.Path.FullPath + "/*").First(x => x.GetDirectoryName().StartsWith("dashboard"));
71+
MoveDirectory(containerDir, dashboardDir);
72+
});
73+
74+
75+
Task("GetSource")
76+
.IsDependentOn("Clean")
77+
.Does(() =>
78+
{
79+
FilePath sourceZip = DownloadFile("https://github.com/reactiveui/ReactiveUI/archive/develop.zip");
80+
Unzip(sourceZip, dependenciesDir);
81+
82+
// Need to rename the container directory in the zip file to something consistent
83+
var containerDir = GetDirectories(dependenciesDir.Path.FullPath + "/*").First(x => x.GetDirectoryName().StartsWith("ReactiveUI"));
84+
MoveDirectory(containerDir, sourceDir);
85+
});
86+
87+
Task("Build")
88+
.IsDependentOn("GetArtifacts")
89+
.Does(() =>
90+
{
91+
Wyam(new WyamSettings
92+
{
93+
Recipe = "Docs",
94+
Theme = "Samson",
95+
UpdatePackages = true
96+
});
97+
});
98+
99+
// Does not download artifacts (run Build or GetArtifacts target first)
100+
Task("Preview")
101+
.IsDependentOn("GetArtifacts")
102+
.Does(() =>
103+
{
104+
Wyam(new WyamSettings
105+
{
106+
Recipe = "Docs",
107+
Theme = "Samson",
108+
UpdatePackages = false,
109+
Preview = true,
110+
Watch = true
111+
});
112+
});
113+
114+
// Assumes Wyam source is local and at ../Wyam
115+
Task("Debug")
116+
.Does(() =>
117+
{
118+
StartProcess("../Wyam/src/clients/Wyam/bin/Debug/wyam.exe",
119+
"-a \"../Wyam/src/**/bin/Debug/*.dll\" -r \"docs -i\" -t \"../Wyam/themes/Docs/Samson\" -p --attach");
120+
});
121+
122+
Task("Deploy")
123+
.WithCriteria(isRunningOnAppVeyor)
124+
.WithCriteria(!isPullRequest)
125+
.WithCriteria(!string.IsNullOrEmpty(netlifyToken))
126+
.IsDependentOn("Build")
127+
.Does(() =>
128+
{
129+
Zip("./output", "output.zip", "./output/**/*");
130+
StartProcess("curl", "--header \"Content-Type: application/zip\" --header \"Authorization: Bearer " + netlifyToken + "\" --data-binary \"@output.zip\" --url https://api.netlify.com/api/v1/sites/reactiveui.netlify.com/deploys");
131+
});
132+
133+
//////////////////////////////////////////////////////////////////////
134+
// TASK TARGETS
135+
//////////////////////////////////////////////////////////////////////
136+
137+
Task("Default")
138+
.IsDependentOn("Build");
139+
140+
Task("GetArtifacts")
141+
.IsDependentOn("GetDashboard")
142+
.IsDependentOn("GetSource");
143+
144+
Task("AppVeyor")
145+
.IsDependentOn(isPullRequest ? "Build" : "Deploy");
146+
147+
//////////////////////////////////////////////////////////////////////
148+
// EXECUTION
149+
//////////////////////////////////////////////////////////////////////
150+
151+
if (!StringComparer.OrdinalIgnoreCase.Equals(target, "Deploy"))
152+
{
153+
RunTarget(target);
154+
}

build.cmd

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
powershell -ExecutionPolicy Unrestricted ./build.ps1 %CAKE_ARGS% %*

0 commit comments

Comments
 (0)