lholman / OneBuild

Convention based PowerShell build for .NET http://lholman.github.io/OneBuild/
Apache License 2.0
17 stars 2 forks source link

RunOctoPack=true specified when compiling the solution #31

Closed Recodify closed 9 years ago

Recodify commented 9 years ago

This enables one build to support projects with the OcotoPack target installed. It is a potential solution to providing a convention based approach to generated nuget packages.

In addition to this flag, we probably don't want to run the current New-Packages task, but not 100% sure on this, perhaps both are useful to have. The convention can be:

solution level nuspec, then custom package output in BuildOutput no solution level nuspect but octopack target in csproj, then ocotopacked output in obj.

lholman commented 9 years ago

@samshiles Thanks for this, I need to think about this a bit more and ask some more questions before we merge this. I think it also will require some integration style tests to actually run some compilations against some different VS solutions, so we can be sure we're not breaking msbuild execution.

lholman commented 9 years ago

Hey @samshiles, I'd like to get this merged in today but just need to check all is well if the Octopack target can't be found, after speaking to @awanoodle earlier we're sure msbuild will be fine but I just want to confirm manually for now. I'll also update the documentation post this merge before merging in any further PRs

lholman commented 9 years ago

@samshiles (and @awanoodle as I know you're interested) I may need some investigation from you here to proceed.

  1. Pulled your branch locally and created a bog standard Console application proj and solution (VS 2012, .NET 4.5)
  2. Ran OneBuild, using C:\>OneBuild.bat and I get success.

image

However, when I install OctoPack it's a different story.

  1. Installed OctoPack in to the solution, using Install-Package OctoPack
Installing 'OctoPack 3.0.41'.
Successfully installed 'OctoPack 3.0.41'.
Adding 'OctoPack 3.0.41' to ConsoleApplication3.
Successfully added 'OctoPack 3.0.41' to ConsoleApplication3.
  1. The when I run OneBuild, using C:\>OneBuild.bat I get a failure.

image

I had a look over at https://github.com/OctopusDeploy/OctoPack#what-is-packaged and see that "OctoPack...will package all of the output files in the bin\Release folder (assuming you have done a release build)"

  1. So I ran OneBuild again, this time forcing a release configuration build C:\>OneBuild.bat -configuration Release but still no luck, same error in fact.

Note: OneBuild uses a different convention of a common output folder, regardless of configuration so as to make Unit Test execution easy, but I have not yet applied that in the test project, more detail here

As soon as I uninstall OctoPack all is good again, it would seem that OctoPack is NOT creating a default .nuspec file as expected and documented, however this all works when run on a vanilla project not using OneBuild, so I imagine it must be with how we're calling msbuild. I need to investigate this a bit further as the stack trace isn't particularly useful, but have you got any ideas?

lholman commented 9 years ago

This is actually an issue with pulling in #34 where I modified the way we write out from New-CompiledSolution.psm1. Fix on the way.

lholman commented 9 years ago

@samshiles I've closed this PR as I needed to fix the issue introduced as a combination of #24 and this change. I grabbed your branch and created another PR over at https://github.com/lholman/OneBuild/pull/36