Code Monkey home page Code Monkey logo

octopack.precompile's People

Contributors

benmccallum avatar dlemstra avatar ypupo2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

octopack.precompile's Issues

Support for msbuild /p:OutDir parameter

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

Support for linked files

As part of the precompilation process, the OctoPack.Precompile.targets file has a NormalizedFiles step which takes all of the collected files and makes the paths relative to the project.

This works great until one of your included files is a linked file.

The script to perform the conversion is:

"@(CollectedFiles->'%(FullPath)'->Substring($(ProjectDir.Length)))

This assumes that the collected file resides in the project directory, and would work for the following include:

<Content Include="Locale\Web.config" />

but would not work for:

<Content Include="..\Web.Shared\Content\bootstrap-custom\css\bootstrap-theme.min.css">
   <Link>Content\bootstrap-custom\css\bootstrap-theme.min.css</Link>
</Content>

as the length of the path containing directory is different to ProjectDir.Length.

An example compiler error:

C:\[Redacted Path]\packages\OctoPack.Precompile.2.0.1\build\OctoPack.Precompile.targets(51,5): error MSB3030: Could not copy the file "nt\bootstrap-custom\css\bootstrap-theme.min.css" because it was not found. [[Redacted Path]]

Please could you advise if you're aware for a workaround to this? I'd love to use your library.

Dependent folders' names incorrectly truncated

We have a solution that contains several different projects. Only one of these projects needs to be precompiled prior to packaging by OctoPack. During the processing carried out by OctoPack.Precompile, a list of NormalizedFiles is created, from the @(CollectedFiles). However, this line in the OctoPack.Precompile.targets file is, I think, inadvertently truncating paths that are outside the project folder heirarchy:

<DestinationPath>$(OctoPackPrecompileIntermediateOutputPath)$([System.String]::Copy('%(FullPath)').Substring($(ProjectDir.Length)))</DestinationPath>

For example, my .csproj is dependent on other projects within our solution, and has project references such as:

    <ProjectReference Include="..\DSSCommon\DSSCommon.csproj">
      <Project>{1606CFDC-D60A-4920-8FEB-E5C09168AA54}</Project>
      <Name>DSSCommon</Name>
    </ProjectReference>

This results in files being copied into a directory such as obj\Release\PrecompiledIntermediate\mmon. I suspect the use of $(ProjectDir.Length) when making a relative path is the cause of this issue.

Support to control the version of aspnet_compiler

First of all really nice work with this.

I want to ask if it would be possible to force the Precompile to use the aspnet_compiler.exe from a diffrent path.
So for example if needed you can use the x64 version of it.
I tried this without the Precompile package and it works ok.

"PropertyGroup
AspnetCompilerPath$(windir)\Microsoft.NET\Framework64\v4.0.30319 /AspnetCompilerPath
/PropertyGroup"

but can't make it work with the package.
any help it is appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.