Skip to content
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

Support for msbuild /p:OutDir parameter #4

Open
MNF opened this issue Mar 8, 2017 · 1 comment
Open

Support for msbuild /p:OutDir parameter #4

MNF opened this issue Mar 8, 2017 · 1 comment

Comments

@MNF
Copy link

MNF commented Mar 8, 2017

We are using msbuild with output to different directory by specifying /p:OutDir="$binariesPath".

&"c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" WebApplication1.sln /target:Rebuild /p:RunOctoPack=true /p:OutDir="$binariesPath\"

It causes OctoPack.Precompile.targets to fail:

"C:\GitReposD\OctoPack.Precompile\Source\Test\WebApplication1\WebApplication1\WebApplication1.csproj" (Rebuild target) (2) ->
(OctoPackPrecompile target) ->
C:\GitReposD\OctoPack.Precompile\Source\OctoPack.Precompile.targets(45,24): error MSB4184: The expression ""C:\GitReposD\OctoPack.Precompile\Source\Binaries\roslyn\csc.exe".Substring(77)" cannot be evaluated. startIndex cannot be larger than length of string. Parameter name: startIndex [C:\GitReposD\OctoPack.Precompile\Source\Test\WebApplication1\WebApplication1\WebApplication1.csproj]

The problem is that msbuild command assumes that files have the same prefix as ProjectDir

    <!--
        Some of the collected file paths are full paths, but we need paths relative to the project so we can perform a recursive copy.
        Also it looks like NuGet doesn't like the packages.config inside the packages, so we skip it.
        http://help.octopusdeploy.com/discussions/problems/29208-packagesconfig-files-are-excluded-from-packages-created-by-octopack
      -->
      <NormalizedFiles Include="@(CollectedFiles->'%(FullPath)'->Substring($(ProjectDir.Length)))" Exclude="packages.config" />

Could you please suggest how to change the target to use OutDir (I haven't work with MSBuild for a while)?

You can see full test script in my fork https://github.com/MNF/OctoPack.Precompile/blob/master/Source/Test-OutDir.ps1

@MNF
Copy link
Author

MNF commented Mar 11, 2017

I've updated the target to support /p:OutDir. See pull request #5

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

No branches or pull requests

1 participant