Additional logger to MSBuild.

reg's Avatar

reg

23 Jan, 2015 11:52 AM

Can I upload our logger in some directory (e.g. in C:\loggers) instead of adding to repository - i.e. upload file/s manually in settings panel ?

Why it's needed:

I developer of X tool for Visual studio (build/events etc.), in new version this tool should work also through msbuild for CI support and any custom build steps.
Also planned use CI for our project with AppVeyor. However, this project also uses self assembly and needed our lib & script for building...

On some our server with TeamCity(for example) of course we can manually place a some tool, but for web CI services this possible only with repository...

I already tested with AppVeyor - all works well :) especially thanks for VSSDK references ! AppVeyor won with this item... it's very easy for our project :)

so, for example:

  • I added our library in cloned repo
  • In settings of AppVeyor I set next script for build with our logger (CI.MSBuild.dll):

_

nuget restore vsSolutionBuildEvent_2013.sln 
   & "C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "vsSolutionBuildEvent_2013.sln" /verbosity:detailed 
       /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" 
       /l:"C:\projects\ci-cfg-vssbe-naost\Build\bin\CI.MSBuild.dll" /m

And... result:

Build started
git clone -q --branch=ci https://bitbucket.org/3F/ci_cfg_vssbe.git C:\projects\ci-cfg-vssbe-naost
git checkout -qf b71f4a57f682082e1072ee9515fca103b979ae34
nuget restore vsSolutionBuildEvent_2013.sln & "C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "vsSolutionBuildEvent_2013.sln" /verbosity:detailed /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /l:"C:\projects\ci-cfg-vssbe-naost\Build\bin\CI.MSBuild.dll" /m
Installing 'UDE.CSharp 1.1.0'.
Installing 'AvalonEdit 5.0.2'.
Installing 'Newtonsoft.Json 6.0.6'.
Installing 'Moq 4.2.1409.1722'.
Installing 'NLog 3.1.0.0'.
Successfully installed 'AvalonEdit 5.0.2'.
Successfully installed 'Moq 4.2.1409.1722'.
Successfully installed 'UDE.CSharp 1.1.0'.
Successfully installed 'NLog 3.1.0.0'.
Successfully installed 'Newtonsoft.Json 6.0.6'.
Microsoft (R) Build Engine version 12.0.31101.0
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.

============================================================
[[ vsSolutionBuildEvent CI.MSBuild ]] Welcomes You!
============================================================
Feedback: [email blocked]
____________________________________________________________
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 1/23/2015 10:29:27 AM.
1/23/2015 10:29:43 AM [WARN]: Context of build action: Disabled for current Environment.
Library: loaded from 'C:\projects\ci-cfg-vssbe-naost\Build\bin\' :: v0.10.1.288593 [1cdb39b] /'develop':170
1/23/2015 10:29:45 AM [INFO]: Loaded settings (v0.9): 'C:\projects\ci-cfg-vssbe-naost\'

Ready:

1 / 1] Pre-Build :: [!]
0 / 1] Post-Build :: [X]
0 / 1] Cancel-Build :: [X]
0 / 1] Warnings-Build :: [X]
0 / 1] Errors-Build :: [X]
0 / 1] Output-Build :: [X]
0 / 1] Transmitter :: [X]
---
1/23/2015 10:29:46 AM [INFO]: vsSBE tool pane: View -> Other Windows -> Solution Build-Events
1/23/2015 10:29:46 AM [INFO]: Launching action 'Updating version' :: Configuration - 'Debug|Mixed Platforms'
1/23/2015 10:29:46 AM [INFO]: Use Script Mode
1/23/2015 10:30:04 AM [INFO]: [Pre] finished SBE: Updating version
Project "C:\projects\ci-cfg-vssbe-naost\vsSolutionBuildEvent_2013.sln" on node 1 (default targets).
....
Build succeeded.

"C:\projects\ci-cfg-vssbe-naost\vsSolutionBuildEvent_2013.sln" (default target) (1) ->
"C:\projects\ci-cfg-vssbe-naost\vsSolutionBuildEventTest\vsSolutionBuildEventTest_2013.csproj" (default target) (8) ->
(ResolveAssemblyReferences target) ->
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [C:\projects\ci-cfg-vssbe-naost\vsSolutionBuildEventTest\vsSolutionBuildEventTest_2013.csproj]

1 Warning(s)
0 Error(s)

Time Elapsed 00:01:46.64
Discovering tests...OK
vstest.console /logger:Appveyor "C:\projects\ci-cfg-vssbe-naost\vsSolutionBuildEventTest\bin\Debug\vsSolutionBuildEventTest.dll"
Microsoft (R) Test Execution Command Line Tool Version 12.0.30723.0 
Copyright (c) Microsoft Corporation. All rights reserved. 

Starting test execution, please wait... 
...
Total tests: 233. Passed: 233. Failed: 0. Skipped: 0.
Test Run Successful. 
Test execution time: 5.9147 Seconds 
Build success

so, all works... but i not planned store this lib with sources... because CI it's additional story

If this feature not available at this time - please add any variants for simple adding any files in some directory for a custom build. I think it will be helpful for any cases...
or i can access to vm with shell ? where to look ? maybe also exists ftp access ?

i think later i'll also test variants with your webservice ~ submodules/subtree/subprojects... need to think, but

Anyway, Thanks for your great service.

ah yes., key to msbuild - '/m' probably not working, i have a notice:

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.

o_O

  1. Support Staff 1 Posted by Feodor Fitsner on 23 Jan, 2015 09:13 PM

    Feodor Fitsner's Avatar

    Great, thanks for the detailed use case!

    I think NuGet is what you need! :) Really, it's an "official" way to wrap any binaries into packages and use as dependencies.

    And provided you have packaged your logger into NuGet package you can upload it to AppVeyor account NuGet feed and use it from there.

    Let me know if you have any questions.

  2. 2 Posted by reg on 24 Jan, 2015 04:36 PM

    reg's Avatar

    hmm, I see :) AppVeyor also provides the NuGet private hosting... great news!

    I already tested, all works well! for example:

    nuget install CI.MSBuild -OutputDirectory C:\projects\ci-cfg-vssbe-naost\Build\bin\ -Source https://ci.appveyor.com/nuget/<id> 
    & nuget restore vsSolutionBuildEvent_2013.sln 
    & "C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" 
        "vsSolutionBuildEvent_2013.sln" /verbosity:detailed 
        /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" 
        /l:"C:\projects\ci-cfg-vssbe-naost\Build\bin\CI.MSBuild.1.0.0\lib\CI.MSBuild.dll" /m
    

    Thanks for really great service!

    Also, will be helpful if you add the simple web-shell for executing command to test of the AppVeyor settings etc. i.e. really not convenient a wait ~5-15 min if we in process of configuring, especially for non-standard configurations (as our lib above :))

    Thanks,

  3. Support Staff 3 Posted by Feodor Fitsner on 24 Jan, 2015 08:08 PM

    Feodor Fitsner's Avatar

    OK, great!

    Web-shell is nice idea. Will add a new item for that.

  4. 4 Posted by reg on 24 Jan, 2015 09:36 PM

    reg's Avatar

    Web-shell is nice idea. Will add a new item for that.

    cool :) Thanks!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac