Skip to content

Instantly share code, notes, and snippets.

@marcio-azevedo
Last active May 18, 2017 09:55
Show Gist options
  • Save marcio-azevedo/9576969640a404fd2944aab89117d212 to your computer and use it in GitHub Desktop.
Save marcio-azevedo/9576969640a404fd2944aab89117d212 to your computer and use it in GitHub Desktop.
PAKET examples and How To.

Steps to install Paket and convert projects from NuGet to PAKET

  1. mkdir .paket (in root folder)
  2. Download paket.bootstrapper.exe into .paket folder
  3. update .gitignore to exclude paket.exe
# PAKET
paket.exe
  • cd .paket -> run paket.bootstrapper.exe (to download paket.exe)

  • To convert from NuGet to Paket:

$ .paket\paket.exe convert-from-nuget --log-file paket-converter.log -v
$ .paket\paket.exe simplify
  • Finds all packages.config files
  • Converts them to paket.references files
    • Generates paket.dependencies file
    • Computes paket.lock file
  • Visual Studio package restore process will be converted
  • Runs paket install
@echo off
cls
REM download paket bootstrapper and/or updated paket
REM setlocal
REM set target=%~dp0\.paket\
REM set paket=%target%\paket.exe
REM set version=latest
REM set url=https://github.com/fsprojects/Paket/releases/%version%
REM pause
REM if not exist %paket% (
REM mkdir %target% 2> nul
REM pause
REM pushd %target%
REM pause
REM curl -L -O %url%
REM pause
REM paket.bootstrapper.exe --self
REM paket.bootstrapper.exe
REM popd
REM )
REM pause
REM %paket% %*
REM endlocal
.paket\paket.bootstrapper.exe
if errorlevel 1 (
exit /b %errorlevel%
)
.paket\paket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)
pause
.paket\paket.exe --help
# .paket\paket.exe convert-from-nuget -v # https://fsprojects.github.io/Paket/paket-convert-from-nuget.html
# add <options> Adds a new package to your paket.dependencies file
# find-refs <options> Finds all project files with package installed
# init <options> Creates an empty paket.dependencies in working directory
# install <options> Download the dependencies in paket.dependencies or paket.lock
# outdated <options> Lists all dependencies that have newer versions available
# remove <options> Removes package from paket.dependencies and paket.references
# restore <options> Download the dependencies in paket.lock
# update <options> Update one or all dependencies
// Reference a nuget package
nuget FSharp.Management
// Reference a single file from GitHub
github myRepo/aProject dependency.dll
// Shared dependencies
nuget Newtonsoft.Json
nuget FSharp.Core
group Web
nuget Fake.IIS
nuget Suave
group Database
nuget FluentMigrator
nuget SQLProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment