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

Tools as a project reference #2469

Closed
natemcmaster opened this issue Apr 6, 2016 · 15 comments
Closed

Tools as a project reference #2469

natemcmaster opened this issue Apr 6, 2016 · 15 comments
Labels
Milestone

Comments

@natemcmaster
Copy link

@natemcmaster natemcmaster commented Apr 6, 2016

Currently, tools extensions can only be added as a package reference. This makes local development of tools and end to end testing cumbersome.

Example scenario

Be able to reference a dotnet tool from a project in the same solution.

src/
     dotnet-ef
test/
     testProject/
          project.json <-- references dotnet-ef as a tool
{
    "tools": {
         "dotnet-ef": { "target": "project" }
    }
}

Workaround

In the meantime, the inner dev cycle is to pack and restore the tool into the test project.

@natemcmaster natemcmaster changed the title Tools from as a project reference Tools as a project reference Apr 6, 2016
@yishaigalatzer
Copy link

@yishaigalatzer yishaigalatzer commented Apr 6, 2016

@natemcmaster please write proper issues, I can't parse this

@natemcmaster
Copy link
Author

@natemcmaster natemcmaster commented Apr 6, 2016

@yishaigalatzer not sure what you mean. Also, did you delete the content of my issue?

@yishaigalatzer
Copy link

@yishaigalatzer yishaigalatzer commented Apr 6, 2016

Of course I didn't :) That's the point why I'm asking for more data

@natemcmaster
Copy link
Author

@natemcmaster natemcmaster commented Apr 6, 2016

Oh, weird. I typed out an explanation of the issue when I submitted. Must have been a weird networking error. I'll edit comment and re-write.

@natemcmaster
Copy link
Author

@natemcmaster natemcmaster commented Apr 6, 2016

@yishaigalatzer re-added content. Apologies for empty issue cc @githubstatus

@yishaigalatzer yishaigalatzer reopened this Apr 6, 2016
@yishaigalatzer
Copy link

@yishaigalatzer yishaigalatzer commented Apr 6, 2016

Thanks, the ask makes sense, I'm not sure how this will actually work because these tools are global so we might end up in contention here.

I'll start a design discussion

@NTaylorMullen
Copy link

@NTaylorMullen NTaylorMullen commented Jul 22, 2016

Any update on this guy? I'm in the midst of building Razor tooling functional tests and I have to jump through a few hoops to work around this issue.

@jdom
Copy link

@jdom jdom commented Jul 27, 2016

I'm also interested about this, since we'd like to use it in Orleans dotnet/orleans#368

@rrelyea
Copy link
Contributor

@rrelyea rrelyea commented Aug 5, 2016

@piotrpMSFT after talking with @natemcmaster yesterday, we think this should be tracked as a CLI issue.
Make sense?

  1. provide docs on best practices today to do development of a tool and debug, etc...
    (nate passes 3 params into dotnet.exe to run after building his tool, but skipping the need to pack, and restore the target prop)
  2. consider doing better than what is possible today.
@TheRealPiotrP
Copy link

@TheRealPiotrP TheRealPiotrP commented Aug 5, 2016

@brthor as well

This issue has been bouncing around for a while and it doesn't cleanly land in CLI or NuGet.

The NuGet ask here is that we need to enable restore to find P2P references for tools. Today, it is only able to restore tools if there is a nupkg available. Certainly there are many workarounds available to us but none of them are acceptable, at least of those which I've been exposed to.

@fearthecowboy
Copy link

@fearthecowboy fearthecowboy commented Jan 4, 2017

I kinda needed this, so I hacked a not-completely terrible solution together for this.

I made a .proj file that gets included by the appropriate consuming projects that has an InitialTargets that points to a target that

  • has a condition that only happens during dotnet restore and the tool isn't installed Condition="$(RestoreRecursive) AND !Exists('$(USERPROFILE)/.nuget/packages/.tools/dotnet-razor')
  • If it's not, it ensures the tools project gets built and installed before the dotnet restore continues

see https://github.com/fearthecowboy/autorest/blob/coreclr/src/common/compile-cshtml.proj

@BrainCrumbz
Copy link

@BrainCrumbz BrainCrumbz commented Feb 9, 2017

@fearthecowboy excuse me, link seems broken

@joelverhagen joelverhagen removed their assignment Nov 9, 2017
@natemcmaster
Copy link
Author

@natemcmaster natemcmaster commented Dec 6, 2017

Closing. My request isn't relevant anymore now that MSBuild has replaced project.json.

@GiuseppePiscopo
Copy link

@GiuseppePiscopo GiuseppePiscopo commented Dec 6, 2017

@natemcmaster is there a similar request for MSBuild-based projects, or such feature is already available in that scenario? Thanks

@natemcmaster
Copy link
Author

@natemcmaster natemcmaster commented Dec 6, 2017

There isn't such a request. I closed because in MSBuild we now use the Exec task to to invoke console tools as project references. Example: https://github.com/aspnet/KestrelHttpServer/blob/c83f606b220714fa7b1b6a6a91b16d78cee6005f/build/repo.targets#L2-L4 I don't think there is anything actionable here for NuGet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants
You can’t perform that action at this time.