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

Build order is very inconvenient #124

Closed
WreckedAvent opened this issue Oct 8, 2015 · 9 comments
Closed

Build order is very inconvenient #124

WreckedAvent opened this issue Oct 8, 2015 · 9 comments

Comments

@WreckedAvent
Copy link

I am using web compiler with TFS 2013, in attempt to avoid checking in .css files when there are .less files checked in.

I noticed web compiler was compiling extremely late in the build process, and not getting included in the drop folder, so I decided to try and add a build target to the csproj to run after the build to try and capture the output. Unfortunately, this is still too early.

I saw #73, but the issue is still present for me using version 1.6.217. Here is the relevant parts of the build log:

         Copying file from "Scripts\<snip>" to "C:\Builds\1\<snip>".
       AfterBuild:
         Testing if web compile has run
       WebCompile:

         WebCompiler: Begin compiling compilerconfig.json
@WreckedAvent WreckedAvent changed the title Build error is very inconvenient Build order is very inconvenient Oct 8, 2015
@madskristensen
Copy link
Owner

Did you update the BuildWebCompiler NuGet package? I believe the issue has been fixed in the later versions

@WreckedAvent
Copy link
Author

I had the issue initially with 1.6.217. I have updated to 1.6.219, but the issue persists.

    17>GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
       CoreCompile:
         C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Csc.exe .. <snip> 
     9>AfterBuild:
         Testing if web compile has run
       WebCompile:         
         WebCompiler: Begin compiling compilerconfig.json
         WebCompiler installing updated versions of the compilers...

@madskristensen
Copy link
Owner

Are you sure you updated the nuget package and not just the extension?

@WreckedAvent
Copy link
Author

Here's what I did to update, through the nuget package manager in 2015:

image

@madskristensen
Copy link
Owner

Ok, you should be good then. In the package folder under BuildBundlerMinifier there should be a file calld BuildBundlerMinifier.targets under the build subfolder.

It has this in it:

<PropertyGroup>
    <BuildDependsOn>
        $(BuildDependsOn);
        BundleMinify
    </BuildDependsOn>
</PropertyGroup>

What it does is that it runs the BundleMinify task after the regular build tasks has run. Does it fix your problem if you switch them around like this?

<PropertyGroup>
    <BuildDependsOn>
        BundleMinify;
        $(BuildDependsOn)
    </BuildDependsOn>
</PropertyGroup>

I've been thinking of switching them but I'm not fully aware of the consequences for everybody using it.

@WreckedAvent
Copy link
Author

In \packages\BuildWebCompiler.1.6.219\build\ I was able to find a file called BuildWebCompiler.targets. I am not using the BuildBundlerMinifier, so I assume you meant to go to the BuildWebCompiler one.

Anyway, in that file I changed:

    <PropertyGroup>
        <BuildDependsOn>
            $(BuildDependsOn);
            WebCompile
        </BuildDependsOn>
    </PropertyGroup>

to

   <PropertyGroup>
        <BuildDependsOn>
            WebCompile;
            $(BuildDependsOn)
        </BuildDependsOn>
    </PropertyGroup>

This appears to correct the build order for my local building. That is, web compiler runs, then my AfterBuild task does. This would resolve my issue if put into an update.

I am unable to test it on the TFS build server since it just gets the packages from nuget and doesn't persist any changes I make to them.

@madskristensen
Copy link
Owner

Sorry, I meant BuildWebCompiler :)

That's great. I'll make the change to the targets file. Thanks for the help narrowing down the cause and fix

@madskristensen
Copy link
Owner

The updated NuGet package version 1.6.220 should be ready within the next couple of minutes with the fix

@WreckedAvent
Copy link
Author

Thanks for the fix!

As a happy side-effect, this appears to make web compiler run pretty early in the build process. On my TFS2013 build server, it now runs before TFS copies things to the drop folder, so I might be able to skip the after-build step entirely and just have the css files included in the csproj (but not checked into source).

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

2 participants