forked from dotnet/Silk.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
website, nuke build & publishing workflow
- Loading branch information
Showing
67 changed files
with
18,652 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.IO; | ||
using System.Runtime.InteropServices; | ||
using Nuke.Common; | ||
using Nuke.Common.ProjectModel; | ||
using Nuke.Common.Utilities.Collections; | ||
using Nuke.Common.Tools.Npm; | ||
|
||
partial class Build | ||
{ | ||
static string workingDirectory = "./website"; | ||
|
||
Target Website => _ => _ | ||
.Executes(() => | ||
{ | ||
Console.WriteLine("Verifying dependences:\n"); | ||
Assert.True(VerifyDependences()); | ||
if (Configuration == "Debug") | ||
{ | ||
Console.WriteLine("Running website in debug mode (it may take a while)"); | ||
NpmTasks.Npm("run docusaurus start", workingDirectory, null, null, false); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Building website for production"); | ||
NpmTasks.Npm("run docusaurus build", workingDirectory); | ||
} | ||
}); | ||
|
||
static bool VerifyDependences() | ||
{ | ||
Console.Write("Node.js ... "); | ||
|
||
var nodePath = GetExecutablePath("node"); | ||
if (string.IsNullOrEmpty(nodePath)) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("\rNode.js not found!\n"); | ||
Console.ResetColor(); | ||
Console.WriteLine("Please, make sure node.js is installed on your machine!"); | ||
Console.WriteLine("Dowload node here => https://nodejs.org/en/download"); | ||
Console.WriteLine(); | ||
return false; | ||
} | ||
else | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("OK"); | ||
Console.ResetColor(); | ||
} | ||
|
||
Console.Write("Node Package Mananger ... "); | ||
|
||
var npmPath = GetExecutablePath("npm"); | ||
if (string.IsNullOrEmpty(nodePath)) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("\rNode Package Mananger not found!\n"); | ||
Console.ResetColor(); | ||
Console.WriteLine("Please, make sure node.js is working and updated on your machine!"); | ||
Console.WriteLine(); | ||
return false; | ||
} | ||
else | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("OK"); | ||
Console.ResetColor(); | ||
} | ||
|
||
Console.Write("Node Modules ... "); | ||
|
||
if (!Directory.Exists($"{workingDirectory}/node_modules")) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Yellow; | ||
Console.WriteLine("\rNode modules not found. Installing modules...\n"); | ||
Console.ResetColor(); | ||
|
||
NpmTasks.Npm("install", workingDirectory); | ||
|
||
Console.Write("Node Modules ... "); | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("OK"); | ||
Console.ResetColor(); | ||
} | ||
else | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("OK"); | ||
Console.ResetColor(); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
static string GetExecutablePath(string execName) | ||
{ | ||
var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator); | ||
|
||
string[] extensions = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) | ||
? Environment.GetEnvironmentVariable("PATHEXT").Split(';') | ||
: [""]; | ||
|
||
foreach (var path in paths) | ||
{ | ||
foreach (var ext in extensions) | ||
{ | ||
var fullPath = Path.Combine(path, execName + ext.ToLower()); | ||
if (File.Exists(fullPath)) return fullPath; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.NUKE", "Silk.NET.NUKE.csproj", "{67DA7859-4BE8-425E-9C46-41842A134D0B}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{67DA7859-4BE8-425E-9C46-41842A134D0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{67DA7859-4BE8-425E-9C46-41842A134D0B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{67DA7859-4BE8-425E-9C46-41842A134D0B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{67DA7859-4BE8-425E-9C46-41842A134D0B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5FF51335-FB2D-46BD-AE9C-ED3C6113B513} | ||
EndGlobalSection | ||
EndGlobal |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Still in development! | ||
description: This is my first post on Docusaurus. | ||
slug: welcome-docusaurus-v2 | ||
authors: | ||
- name: Lumi | ||
url: https://github.com/lumi2021 | ||
image_url: https://github.com/lumi2021.png | ||
|
||
tags: [test, Silk.NET, .NET] | ||
image: https://i.imgur.com/mErPwqL.png | ||
hide_table_of_contents: false | ||
--- | ||
|
||
Blogs will still be reinplemented! sorry! | ||
|
||
<!-- truncate --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Get Started | ||
|
||
# Coming soon! :sweat_smile: | ||
This tutorial is currently work-in-progress. |
Oops, something went wrong.