Skip to content

NuGet improvements. #896

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

Closed
wants to merge 2 commits into from
Closed

NuGet improvements. #896

wants to merge 2 commits into from

Conversation

MicahZoltu
Copy link
Contributor

  • Adds a new project to the solution for building a native NuGet package.
    • The package ends up in bin\<configuration>.
    • When the package is installed, a build target file is imported into the target project that will cause the binaries to be copied to $(TargetPath) after build (if necessary).
    • Versioned as the last version of the LibGit2 that was pulled into this repository.
    • Do not be fooled, this is not actually a .csproj. In order to get Visual Studio to load it so that it shows up in Solution Explorer you have to tag it as one of a known list of project file types (http://msdn.microsoft.com/en-us/library/vstudio/ms171468(v=vs.110).aspx). If you try to view the properties on it, Visual Studio will add a bunch of stuff to the underlying project file. I don't think anything will break, but if it adds back the imports I believe it will break. Be aware, best to just not open the properties on the project and instead open it in a text editor.
  • Changes NuGet package to be generated on successful build of the class library.
    • The package ends up in bin\<configuration>.
    • Depends on the Native NuGet package (see above).
    • Only installs the one library and the one dependency, nothing fancy.
  • Adds dependency on NuGet for MSBuild.
    • Both projects have a .targets file added to them that utilizes NuGet for MSBuild.
    • Take care in updating NuGet for MSBuild, it will add some post-build tasks to your project when you install/update it. I have removed these but they will come back if you update. They may have undesired side effects.
    • I have committed the dependency to the repo, I would encourage you (project owners) to .gitignore packages/ though since Visual Studio will restore them on first build automatically (since VS2012 Update ? I believe).

* Adds a new project to the solution for building a native NuGet package.
 * The package ends up in `bin\<configuration>`.
 * When the package is installed, a build target file is imported into the target project that will cause the binaries to be copied to `$(TargetPath)` after build (if necessary).
 * Versioned as the last version of the LibGit2 that was pulled into this repository.
 * Do not be fooled, this is not actually a .csproj. In order to get Visual Studio to load it so that it shows up in Solution Explorer you have to tag it as one of a known list of project file types (http://msdn.microsoft.com/en-us/library/vstudio/ms171468(v=vs.110).aspx).  If you try to view the properties on it, Visual Studio will add a bunch of stuff to the underlying project file.  I don't *think* anything will break, but if it adds back the imports I believe it will break.  Be aware, best to just not open the properties on the project and instead open it in a text editor.

* Changes NuGet package to be generated on successful build of the class library.
 * The package ends up in `bin\<configuration>`.
 * Depends on the Native NuGet package (see above).
 * Only installs the one library and the one dependency, nothing fancy.

* Adds dependency on `NuGet for MSBuild`.
 * Both projects have a `.targets` file added to them that utilizes `NuGet for MSBuild`.
 * Take care in updating `NuGet for MSBuild`, it will add some post-build tasks to your project when you install/update it.  I have removed these but they will come back if you update.  They may have undesired side effects.
 * I have committed the dependency to the repo, I would encourage you (project owners) to `.gitignore` `packages/` though since Visual Studio will restore them on first build automatically (since VS2012 Update ? I believe).
@MicahZoltu MicahZoltu mentioned this pull request Jan 3, 2015
@MicahZoltu
Copy link
Contributor Author

Re-create of PR #778.

…lds and updates mono version.

I couldn't figure out how to get Travis CI to do a package restore on Linux.
@MicahZoltu
Copy link
Contributor Author

Once #894 is merged this PR should be modified to leverage automatic package restoration. I can take care of this once #894 is merged.

@MicahZoltu
Copy link
Contributor Author

Currently failing due to a bug in xbuild. It looks exactly like the previous one I reported https://bugzilla.xamarin.com/show_bug.cgi?id=22981 but that is supposedly fixed in Mono 3.10. I have not spent much time investigating further.

Tool NuGet.exe execution started with arguments: pack /Users/travis/build/libgit2/libgit2sharp/NativeNuGet/NativeNuGet.nuspec -Version 0.21.3 -BasePath bin/Release/ -OutputDirectory bin/Release/ -NonInteractive -Prop Configuration="Release" -Prop Platform="AnyCPU" -NoPackageAnalysis 
/Users/travis/build/libgit2/libgit2sharp/packages/NuGet.for.MSBuild.1.4.3/build/NuGet.for.MSBuild.targets: error : Error executing tool 'NuGet.exe': ApplicationName='NuGet.exe', CommandLine='pack /Users/travis/build/libgit2/libgit2sharp/NativeNuGet/NativeNuGet.nuspec -Version 0.21.3 -BasePath bin/Release/ -OutputDirectory bin/Release/ -NonInteractive -Prop Configuration="Release" -Prop Platform="AnyCPU" -NoPackageAnalysis ', CurrentDirectory='/Users/travis/build/libgit2/libgit2sharp/NativeNuGet', Native error= Cannot find the specified file

@Therzok
Copy link
Member

Therzok commented Jan 3, 2015

By the looks of it, mono/mono@7439e99 doesn't seem to be in 3.10.

@Therzok
Copy link
Member

Therzok commented Jan 3, 2015

See this for reference.

@MicahZoltu
Copy link
Contributor Author

You are correct, my mistake. I'll go back to waiting then.

@Therzok
Copy link
Member

Therzok commented Jan 3, 2015

The fix is in 3.12 mono, so if this can wait until then, it's all perfect.

@nulltoken
Copy link
Member

Superseded by #984

@nulltoken
Copy link
Member

Cheers!

@nulltoken nulltoken closed this May 28, 2015
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.

3 participants