Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore cli tools via paket #2486

Merged
merged 4 commits into from Jul 5, 2017
Merged

Restore cli tools via paket #2486

merged 4 commits into from Jul 5, 2017

Conversation

forki
Copy link
Member

@forki forki commented Jul 5, 2017

/cc @enricosada @alfonsogarciacaro @davkean @dsplaisted

This PR allows dotnet restore to create a obj/PROJECTNAME.fsproj.paket.props file with the following content:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
  </PropertyGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="dotnet-fable" Version="1.1.6" /> // or whatever cli tool we find
  </ItemGroup>
</Project>

With this we can get rid of maintaining DotNetCliToolReference in our precious csproj/fsproj.
This became an issue since version number of dotnet-fable and Fable.Core need to match. Which involved manual work and some degree of giving a fuck.

used in SAFE-Stack/SAFE-BookStore#132

Open question:

  • how do we really detect a cli tool. At the moment we check package name starts with "dotnet-"

@forki forki changed the title Restore dotnet-fable as cli tool Restore cli tools via paket Jul 5, 2017
@forki forki merged commit d475b66 into master Jul 5, 2017
@enricosada
Copy link
Collaborator

how do we really detect a cli tool. At the moment we check package name starts with "dotnet-"

It need to be explicit, trust the user
cc @livarcocc of dotnet/cli team too, for feedback

In theory, there is a flag to be set in nuspec (also for discriminate the dotnet new templates) but is pratically unused in real world.

any netcorepp1.0 console packaged will work afaik.
The only rule is: executable name must have prefix dotnet-, so dotnet-app.dll for dotnet app not the package itself, the executable
so if exists lib\netcoreapp1.0\dotnet-{something}.dll can be used as cli tool
Can exists more executables in same package btw

that said, lot of cli tool, doesnt use dotnet- prefix in package name, so need to add a conf in paket somehow.

@enricosada
Copy link
Collaborator

uops @forki you was too fast 😄

@forki
Copy link
Member Author

forki commented Jul 5, 2017 via email

@forki forki deleted the restore-clitools branch July 5, 2017 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants