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

Compressor fixes and improvements #72

Merged
merged 5 commits into from
May 19, 2016
Merged

Compressor fixes and improvements #72

merged 5 commits into from
May 19, 2016

Conversation

gentoo90
Copy link
Contributor

@gentoo90 gentoo90 commented May 19, 2016

New package structure:

packages
\-- RequireJsNet.Compressor.2.1.37
    +-- build
    │   \-- RequireJsNet.Compressor.targets
    \-- tools
        +-- EcmaScript.NET.dll
        +-- Jint.dll
        +-- Microsoft.Web.Infrastructure.dll
        +-- Newtonsoft.Json.dll
        +-- RequireJsNet.Compressor.dll
        +-- RequireJsNet.Compressor.pdb
        +-- RequireJsNet.dll
        +-- RequireJsNet.pdb
        +-- System.Web.Mvc.dll
        +-- System.Web.Razor.dll
        +-- System.Web.WebPages.Deployment.dll
        +-- System.Web.WebPages.Razor.dll
        +-- System.Web.WebPages.dll
        +-- Yahoo.Yui.Compressor.dll
        \-- YuiCompressor.NET.license.txt
  • RequireJsNet.Compressor.targets automatically included into the project.
  • No dlls are added to the project itself.
  • All dependencies are packed and with correct versions.

In simple case user only has to install the package and create ReqiureJS.json and bundles will compile. If other config files are needed they can be added by setting BuildAction to RequireJsNetConfig:
requirejsnetbuildaction

Inspired by RazorGenerator.MsBuild and LessMsbuildTasks

gentoo90 added 5 commits May 18, 2016 22:21
Make it a tool package. It's used on compile time only
and will not add dll references to a project itself.

Add RequireJsNet.Compressor.targets which is automatically
included into a project when package is installed.

Put nuspec alongside the project so nuget finds and uses it automatically.
This prevents them from being added to the nuget package dependencies.
@gentoo90
Copy link
Contributor Author

gentoo90 commented May 19, 2016

CC #71 This pull-request will make Compressor independent of projects dlls versions as package carries its own dlls.

@stefanprodan stefanprodan merged commit 9edefe3 into vtfuture:master May 19, 2016
@stefanprodan
Copy link
Contributor

This crashes the TeamCity NuGet publish job:

[16:42:26]Step 1/3: MSBuild (11s)
[16:42:30][Step 1/3] RequireJsNet\RequireJsNet.csproj.teamcity: Build target: Build (6s)
[16:42:37][RequireJsNet\RequireJsNet.csproj.teamcity] BuildPackage
[16:42:37][BuildPackage] Exec
[16:42:37][Exec] C:\BuildAgent1\work\1f08d78398aef0cc\.nuget\NuGet.targets(100, 9): Please specify a nuspec or project file to use.
[16:42:37][Exec] C:\BuildAgent1\work\1f08d78398aef0cc\.nuget\NuGet.targets(100, 9): error MSB3073: The command ""..\.nuget\NuGet.exe" pack "C:\BuildAgent1\work\1f08d78398aef0cc\RequireJsNet\RequireJsNet.csproj.teamcity" -Properties Configuration=Debug -NonInteractive  -OutputDirectory "C:\BuildAgent1\work\1f08d78398aef0cc\RequireJsNet\bin\Debug" -symbols" exited with code 1.
[16:42:38][Step 1/3] Step MSBuild failed

@gentoo90
Copy link
Contributor Author

pack "C:\BuildAgent1\work\1f08d78398aef0cc\RequireJsNet\RequireJsNet.csproj.teamcity"

Looks like project name should match nuspec name

@@ -7,7 +7,7 @@
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
<BuildPackage Condition=" '$(BuildPackage)' == '' ">true</BuildPackage>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to run nuget manually and it doesn't like .csproj with .teamcity extension.
I enabled nuget build here. So it probably should be disabled for teamcity.

@gentoo90
Copy link
Contributor Author

Also you'll probably need to check "Create tool package" checkbox
nuget6

@stefanprodan
Copy link
Contributor

You can see my TeamCity config using guest account here http://tcoss.veritech.io/project.html?projectId=RequireJSNet

@stefanprodan
Copy link
Contributor

I'm updating to latest VS.NET on the build server so I can switch to 2015 build tools, restarting server now. Create tool package doesn't fix the build.

@stefanprodan
Copy link
Contributor

Switching to MS Build 2015 didn't fixed the build.

@stefanprodan
Copy link
Contributor

I've also update the TeamCity NuGet to 3.4.3 but still crashes...

@gentoo90
Copy link
Contributor Author

gentoo90 commented May 19, 2016

I guess I've found it. Set BuildPackage to false in TeamCity build parameters (for all 4 projects):
teamcityparameter
It will be added to msbuild properties and disable additional nuget pack runned by msbuild itself. After that TeamCity nuget step will proceed.

In .nuget/NuGet.targets BuildPackage is set to true so users are able to build nuget package in Visual Studio.

@stefanprodan
Copy link
Contributor

Both packages are on NuGet. Thank you very much!

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.

2 participants