Feature: Templating

Open
#2,251 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
fsharp
Domain
tooling

Research direction

Start by reviewing how paket.dependencies and paket.references are parsed, using the templated URLs and paket.var example as the desired input. Compare the proposed variable-substitution flow with the shown build.bat process, and define supported syntax and behavior for install and update before implementation.

Written by the indexing model from the issue text.

Description

configurability spec
Description

Templating support in paket.dependencies and paket.references

Reason

There are always occasions when 32/64 bit builds are required and only minor changes are required in the build step. Paket + Cake provides great combo in this regard and currently, i am following naive replace approach for that

Eg: paket.dependencies

source https://api.nuget.org/v3/index.json
framework: >= net40
nuget Cake

http http://192.168.0.115:12345/api/v1/artifact/{BUILD_NO}/shared/infrastructure/{BUILD_ARCH}/Core.DB/SequelMed.Core.dll
http http://192.168.0.115:12345/api/v1/artifact/{BUILD_NO}/shared/infrastructure/{BUILD_ARCH}/Core.DB/Oracle.DataAccess.dll

Eg: paket.var

BUILD_NO 1593
BUILD_ARCH 32bit

So, i generated paket.var file dynamically in build process with Cake and i have following build.bat file which carry this whole process

@echo off
cls

if exist paket.dependencies (
    copy paket.dependencies paket.dependencies.bkp >nul
)
.paket\paket.ext.exe

.paket\paket.bootstrapper.exe
if errorlevel 1 (
    del /f paket.dependencies
    ren paket.dependencies.bkp paket.dependencies
    exit /b %errorlevel%
)

.paket\paket.exe install
.paket\paket.exe update
if errorlevel 1 (
    del /f paket.dependencies
    ren paket.dependencies.bkp paket.dependencies
    exit /b %errorlevel%
)

packages\Cake\Cake.exe build.cake %*

del /f paket.dependencies
ren paket.dependencies.bkp paket.dependencies

Following this pattern, i can add 32/64 refs in the Project in a simple way. If there would be something in Paket, it would be really great.

Thanks

Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/Paket

All issues in fsprojects/Paket

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.