Tools as a project reference #2469

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

Comments

Projects
None yet
10 participants
@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 from Tools from as a project reference to Tools as a project reference Apr 6, 2016

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 6, 2016

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

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

@natemcmaster

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster Apr 6, 2016

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

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

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 6, 2016

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

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

@natemcmaster

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster 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.

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

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster Apr 6, 2016

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

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

@yishaigalatzer yishaigalatzer reopened this Apr 6, 2016

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer 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

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

This comment has been minimized.

Show comment
Hide comment
@NTaylorMullen

NTaylorMullen 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.

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

This comment has been minimized.

Show comment
Hide comment
@jdom

jdom Jul 27, 2016

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

jdom commented Jul 27, 2016

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

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Aug 5, 2016

Contributor

@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.
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@TheRealPiotrP

TheRealPiotrP 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.

@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

This comment has been minimized.

Show comment
Hide comment
@fearthecowboy

fearthecowboy 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

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

This comment has been minimized.

Show comment
Hide comment
@BrainCrumbz

BrainCrumbz Feb 9, 2017

@fearthecowboy excuse me, link seems broken

BrainCrumbz commented Feb 9, 2017

@fearthecowboy excuse me, link seems broken

@joelverhagen joelverhagen removed their assignment Nov 9, 2017

@natemcmaster

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster Dec 6, 2017

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

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

@GiuseppePiscopo

This comment has been minimized.

Show comment
Hide comment
@GiuseppePiscopo

GiuseppePiscopo Dec 6, 2017

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

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

@natemcmaster

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster 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.

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