8000 Ease deployment of LibGit2Sharp based web sites #597 by sitereactor · Pull Request #705 · libgit2/libgit2sharp · GitHub
[go: up one dir, main page]

Skip to content

Ease deployment of LibGit2Sharp based web sites #597 #705

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 5 commits into from
Closed

Ease deployment of LibGit2Sharp based web sites #597 #705

wants to merge 5 commits into from

Conversation

sitereactor
Copy link
Contributor

Replaces PR #700 as I messed up the second update 😒

… bin for projects as well as referencing projects.

Adding props for collecting native binaries as part of a web publish.
@sitereactor
Copy link
Contributor Author

The nuspec file now has the correct framework version.

The updated targets file should now be much more solid in ensuring that the NativeBinaries are copied between projects in a solution depending on project references.
I have tested this in a single project Web Application with the nuget installed and it correct copied the NativeBinaries to the bin folder, and when doing a build with "deploy on build":
msbuild mysln.sln /p:DeployOnBuild=true /p:PublishProfile=<profile-name>
I have found that when doing a right-click Publish in Visual Studio 2012 that you need to explicitly add the PropertyGroup and Target to the PublishProfile xml for collecting the NativeBinaries files.

I have also tested the new targets in a range of other project combinations:

  • Web Application referencing a Class Library with the nuget installed
  • Web Application referencing a Class Library with the nuget installed, and refencing another Class Library
  • Class Library with the nuget installed
  • Class Library referencing another Class Library with the nuget installed
  • Class Library referencing two other Class Libraries where one has the nuget installed

I have added a props file as well, which is mostly for compatibility with MsDeploy / WebDeploy. Also, if someone needs the PropertyGroup and Target for the PublishProfile xml they can simply grap it from the files that are included with the nuget.

So all in all I think its pretty solid. The only thing remaining is to figure out how to avoid the hardcoded version and/or path to the nuget package.
I tried with the following snippet from #425 but that didn't give me the right location:

<CreateItem Include="$(MSBuildThisFileDirectory)..\lib\net40\NativeBinaries\**\*.*">
  <Output TaskParameter="Include" ItemName="NativeBinaries" />
</CreateItem>

@@ -23,6 +23,8 @@
<file src="..\LICENSE.md" target="App_Readme\LibGit2Sharp.LICENSE.md" />
<file src="..\CHANGES.md" target="App_Readme\LibGit2Sharp.CHANGES.md" />
<file src="..\nuget.package\Tools\*.*" target="Tools" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we're now leveraging targets and props, do we still need the Tools folder and the *.ps1 files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they should just be removed. Forgot to ask if its okay to just go ahead and delete all those powershell scripts from the repository?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay to just go ahead and delete all those powershell scripts from the repository?

💀 them with 🔥

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 done 😉

@martinwoodward
Copy link
Member

@davidfowl - apart from the hard-coded reference to the bin path, this looking good to you? The idea is to help the libgit2sharp nuget package play nicely with the Publishing mechanism that's used by web apps (and also leveraged as part of kudu deployment) while only leveraging .targets and .props file (ie. without requiring powershell scripts hooked in the post-build event)

@sitereactor
Copy link
Contributor Author

Almost forgot to update this, but I figured out that $(MSBuildThisFileDirectory) can in fact be used for this in order to avoid the hardcoded reference (with version) to the NativeBinaries. I had made a few tests by added the targets directly in the csproj, which of course didn't give the right path to the nuget package directory. I only realized after posting my previous comment.

I updated the pull request with the use of $(MSBuildThisFileDirectory) so hopefully its a bit more solid now.

@nulltoken
Copy link
Member

@martinwoodward Still interested in giving a hand and review this PR? I'd really like to benefit from your expertise on this one 🙏 ❤️

@nulltoken
Copy link
Member

Superseded by #821.

Thanks!

@nulltoken nulltoken closed this Sep 19, 2014
@nulltoken nulltoken added this to the UnmergedOrDoNotRequireAFix milestone Sep 19, 2014
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
0