rojepp / MiniScaffold

F# Template for creating and publishing libraries targeting .NET Full (net461) and Core (netstandard2.0)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MiniScaffold

F# Template for creating and publishing libraries targeting .NET Full (net461) and Core (netstandard2.0)

Builds

MacOS/Linux Windows
Travis Badge Build status
Build History Build History

Nuget

Stable Prerelease
NuGet Badge NuGet Badge

Getting started

Grab the template from nuget:

dotnet new -i "MiniScaffold::*"

Use the new template:

dotnet new mini-scaffold -n MyCoolNewLib --githubUsername MyGithubUsername -lang F#
cd MyCoolNewLib

It will scaffold out something similar to:

$ tree /f
.
│   .DS_Store
│   .editorconfig
│   .gitignore
│   .travis.yml
│   appveyor.yml
│   build.cmd
│   build.fsx
│   build.sh
│   MyCoolNewLib.sln
│   LICENSE.md
│   paket.dependencies
│   paket.lock
│   README.md
│   RELEASE_NOTES.md
│
├───.github
│       ISSUE_TEMPLATE.md
│       PULL_REQUEST_TEMPLATE.md
│
├───.paket
│       paket.exe
│       paket.exe.config
│       Paket.Restore.targets
│       paket.targets
│
├───src
│   └───MyCoolNewLib
│           AssemblyInfo.fs
│           MyCoolNewLib.fsproj
│           Library.fs
│           paket.references
│
├───tests
│   └───MyCoolNewLib.Tests
│           AssemblyInfo.fs
│           MyCoolNewLib.Tests.fsproj
│           Main.fs
│           paket.references
│           Tests.fs
│
└───tools
        paket.references
        tools.csproj

Build!

> .\build.cmd // on windows
$ ./build.sh  // on unix

The bin of your new lib should look similar to:

$ tree src/MyCoolNewLib/bin/Release
src/MyCoolNewLib/bin/Release/
├── net461
│   ├── FSharp.Core.dll
│   ├── MyLib.dll
│   ├── MyLib.pdb
└── netstandard2.0
    ├── MyLib.deps.json
    ├── MyLib.dll
    └── MyLib.pdb

Watch Tests

The WatchTests target will use dotnet-watch to watch for changes in your lib or tests and re-run your tests on all TargetFrameworks

./build.sh WatchTests

Release!

git add .
git commit -m "Scaffold"
git remote add origin origin https://github.com/user/MyCoolNewLib.git
git push -u origin master
paket config add-token "https://www.nuget.org" 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a
  • Then update the RELEASE_NOTES.md with a new version, date, and release notes ReleaseNotesHelper
#### 0.2.0 - 2017-04-20
* FEATURE: Does cool stuff!
* BUGFIX: Fixes that silly oversight
  • You can then use the Release target. This will:
    • make a commit bumping the version: Bump version to 0.2.0 and add the release notes to the commit
    • publish the package to nuget
    • push a git tag
./build.sh Release

Options

githubUserName

This is uesd to atomatically configure author information in the nuget package, as well as configure push urls for repo locations.

outputType

Defaults to Library

When set to either Console or Library project and the supporting infrastructure around their respective types.

Known issues

-bash: ./build.sh: Permission denied

This is because dotnet template loses permissions of files. (TheAngryByrd#37) added a post hook to address this but this only fixes it for dotnet sdk 2.x users. dotnet sdk 1.x will need to run chmod +x ./build.sh

Example Projects using this template:

This project uses the following projects:

About

F# Template for creating and publishing libraries targeting .NET Full (net461) and Core (netstandard2.0)

License:MIT License


Languages

Language:F# 92.8%Language:Shell 4.3%Language:Batchfile 1.8%Language:Dockerfile 1.1%