Skip to content

Commit

Permalink
migrated to wyam
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuntley committed Aug 2, 2017
1 parent 416fbd1 commit 3364311
Show file tree
Hide file tree
Showing 275 changed files with 8,856 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# 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

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Pp]ackages/
[Tt]ools/*
![Tt]ools/packages.config
[Oo]utput/
[Ii]nput/dashboard/
[Dd]ependencies/
nuget.exe
[Ll]ocal[Dd]eploy/
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2017 Geoffrey Huntley

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing

```
.\build.cmd -Target preview
```
21 changes: 21 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build script
init:
- git config --global core.autocrlf true

# Build script
build_script:
- ps: .\build.ps1 -Target "AppVeyor"

# Tests
test: off

# Artifacts
artifacts:
# Static website
- path: output

# Branches to build
branches:
# Whitelist
only:
- master
154 changes: 154 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#tool "nuget:https://api.nuget.org/v3/index.json?package=Wyam&prerelease"
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Git"
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Wyam&prerelease"
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Yaml"
#addin "nuget:https://api.nuget.org/v3/index.json?package=Octokit"

using Octokit;

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

// Define variables
var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
var netlifyToken = EnvironmentVariable("NETLIFY_TOKEN");
var currentBranch = isRunningOnAppVeyor ? BuildSystem.AppVeyor.Environment.Repository.Branch : GitBranchCurrent("./").FriendlyName;

// Define directories.
var dependenciesDir = Directory("./dependencies");
var sourceDir = dependenciesDir + Directory("reactiveui");
var dashboardDir = dependenciesDir + Directory("dashboard");
var outputPath = MakeAbsolute(Directory("./output"));

// Variables


//////////////////////////////////////////////////////////////////////
// SETUP
//////////////////////////////////////////////////////////////////////


Setup(ctx =>
{
// Executed BEFORE the first task.
Information("Building branch {0} ({1})...", currentBranch, deployBranch);
});


//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
.Does(() =>
{
if(DirectoryExists(dependenciesDir))
{
CleanDirectory(dependenciesDir);
DeleteDirectory(dependenciesDir, true);
}
CreateDirectory(dependenciesDir);
});

Task("GetDashboard")
.IsDependentOn("Clean")
.Does(() =>
{
FilePath dashboardZip = DownloadFile("https://github.com/reactiveui/dashboard/archive/master.zip");
Unzip(dashboardZip, dependenciesDir);
// Need to rename the container directory in the zip file to something consistent
var containerDir = GetDirectories(dependenciesDir.Path.FullPath + "/*").First(x => x.GetDirectoryName().StartsWith("dashboard"));
MoveDirectory(containerDir, dashboardDir);
});


Task("GetSource")
.IsDependentOn("Clean")
.Does(() =>
{
FilePath sourceZip = DownloadFile("https://github.com/reactiveui/ReactiveUI/archive/develop.zip");
Unzip(sourceZip, dependenciesDir);
// Need to rename the container directory in the zip file to something consistent
var containerDir = GetDirectories(dependenciesDir.Path.FullPath + "/*").First(x => x.GetDirectoryName().StartsWith("ReactiveUI"));
MoveDirectory(containerDir, sourceDir);
});

Task("Build")
.IsDependentOn("GetArtifacts")
.Does(() =>
{
Wyam(new WyamSettings
{
Recipe = "Docs",
Theme = "Samson",
UpdatePackages = true
});
});

// Does not download artifacts (run Build or GetArtifacts target first)
Task("Preview")
.IsDependentOn("GetArtifacts")
.Does(() =>
{
Wyam(new WyamSettings
{
Recipe = "Docs",
Theme = "Samson",
UpdatePackages = false,
Preview = true,
Watch = true
});
});

// Assumes Wyam source is local and at ../Wyam
Task("Debug")
.Does(() =>
{
StartProcess("../Wyam/src/clients/Wyam/bin/Debug/wyam.exe",
"-a \"../Wyam/src/**/bin/Debug/*.dll\" -r \"docs -i\" -t \"../Wyam/themes/Docs/Samson\" -p --attach");
});

Task("Deploy")
.WithCriteria(isRunningOnAppVeyor)
.WithCriteria(!isPullRequest)
.WithCriteria(!string.IsNullOrEmpty(netlifyToken))
.IsDependentOn("Build")
.Does(() =>
{
Zip("./output", "output.zip", "./output/**/*");
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");
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Build");

Task("GetArtifacts")
.IsDependentOn("GetDashboard")
.IsDependentOn("GetSource");

Task("AppVeyor")
.IsDependentOn(isPullRequest ? "Build" : "Deploy");

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////

if (!StringComparer.OrdinalIgnoreCase.Equals(target, "Deploy"))
{
RunTarget(target);
}
2 changes: 2 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy Unrestricted ./build.ps1 %CAKE_ARGS% %*
Loading

0 comments on commit 3364311

Please sign in to comment.