runtime icon indicating copy to clipboard operation
runtime copied to clipboard

*Breaking Change* project.json

Open ericstj opened this issue 11 years ago • 8 comments

I just made changes to http://github.com/dotnet/buildtools and http://github.com/dotnet/corefx to support Nuget V3 style packages, as well as consume those in the build. This was essential since all of the work for our shipping packages is taking advantage of Nuget v3 features and up until now we were unable to consume these package.

What this means to you:

  • For framework package dependencies you now only need to list the lowest version of your direct dependency in your library’s project.json.
  • You no longer need to list out all the implementation dependencies in your project, only direct dependencies. I’m planning a pass over the repo to reduce all of our existing projects.
  • Implementation dependencies (like System.Private.Networking, System.Private.DataContractSerialization, System.Private.ServiceModel) no longer need to be referenced/copied: it’ll happen automatically without showing up in the refs passed to the compiler.
  • In the short term: community packages (like XUNIT and JSON.NET) still need to be listed in packages.config as they are today. This is a point in time problem until we bring up all the support for the old packaging conventions in the new nuget and package resolution task. This should happen within the month.
  • Any pending changes that edit the packages.config will need to take these changes into account.

What to look out for:

  • Including a new package in packages.config. This will produce a build error due to missing assets since the packages.config resolution won’t find the assets in the package. Most likely this will show up as a missing reference. Check log for ResolveNugetPackages task spew.
  • Including an old package in project.json. Same symptom as above. Check log for ResolveNugetPackageAssets task spew.

You should be able to just merge the latest and build, but if you hit any problems just delete the packages folder and try again. Please let me @ericstj know if issues persist after this.

ericstj avatar Apr 16 '15 18:04 ericstj

Can we move that locking json files to bin directory? Currently my whole repo is spammed with json files after building.

krwq avatar Apr 16 '15 22:04 krwq

We could, however it's actually a key piece of the nuget v3 design and considered to be a user asset. In the future we'll actually be checking them in. @davidfowl @lodejard @Eilon @yishaigalatzer

ericstj avatar Apr 16 '15 22:04 ericstj

Correct. For now adding project.lock.json to .gitignore is generally recommended because the versions of dependencies change all the time. But eventually it's generally recommended to check them in (and actually set locked=true) to avoid getting randomly matching packages.

Eilon avatar Apr 16 '15 23:04 Eilon

Checking in sounds good to me!

krwq avatar Apr 17 '15 17:04 krwq

It is not clear to me how to use buildtools to build corefx.

I am also wondering if this change helps me to add corefx packages to corefxlab helloworld commandline program and debug.

cheers00 avatar Apr 21 '15 17:04 cheers00

Corefx's build.cmd pulls down BuildTools and uses it when building the repo. I think @KrzysztofCwalina uses a different set of build targets for helloworld.

ericstj avatar Apr 21 '15 18:04 ericstj

Yes, today the hello world demo uses a different project template and targets. Once Eric's work stabilizes, it would be good to move hello world to the official system.

KrzysztofCwalina avatar Apr 21 '15 18:04 KrzysztofCwalina

Closing this. The information is still useful (albeit a little out of date as we are now all in on packages.json) but it will still be reachable via search. If there continues to be confusion we should add some docs to the developer wiki instead.

ellismg avatar May 13 '15 09:05 ellismg