Coder Social home page Coder Social logo

cake-contrib / cake.buildsystems.module Goto Github PK

View Code? Open in Web Editor NEW
30.0 30.0 16.0 368 KB

:cake: :wrench: A simple Cake module to enhance running from a TF Build environment

Home Page: https://cakebuild.net/extensions/cake-buildsystems-module/

License: MIT License

C# 99.28% PowerShell 0.42% Shell 0.29%
build-automation cake cake-build cake-module hacktoberfest teamcity tfs travis-ci vsts

cake.buildsystems.module's People

Contributors

agc93 avatar ap0llo avatar augustoproiete avatar bdukes avatar blythmeister avatar dependabot[bot] avatar flcdrg avatar gep13 avatar github-actions[bot] avatar juergenrb avatar kcamp avatar micsco avatar nils-a avatar renovate[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

cake.buildsystems.module's Issues

Remove net461 target, leaving only netstandard2.0

To be aligned with new guidance/best practices on developing Modules for Cake:

ยง2.6 Avoid targeting additional frameworks such as net461 or net5.0.

Why? Due to current limitations on how modules are loaded, Cake attempts to load all assemblies included in the NuGet package of the module (of all targets) which causes warnings to be displayed and the impression that the module was not loaded and/or is not working.
Once those limitations are fixed, we'll update this recommendation to align with the recommendations for Cake Addins.

Module cannot be initialized

Hey,

I've found an issue where after addition of packages.config with just Cake.BuildSystems.Module to ./tools/Modules is breaking the Cake build process.

packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
    <package id="Cake.BuildSystems.Module" version="0.3.0" />
</packages>

Error with Diagnostic output:

Preparing to run build script...
Running build script...
Verifying assembly 'Cake.MyGet.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.TeamCity.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.TFBuild.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.TravisCI.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.MyGet.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.TeamCity.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.TFBuild.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.TravisCI.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Registering module Cake.MyGet.Module.MyGetModule...
Registering module Cake.TeamCity.Module.TeamCityModule...
Registering module Cake.TFBuild.Module.TFBuildModule...
Registering module Cake.TravisCI.Module.TravisCIModule...
Registering module Cake.MyGet.Module.MyGetModule...
Registering module Cake.TeamCity.Module.TeamCityModule...
Registering module Cake.TFBuild.Module.TFBuildModule...
Registering module Cake.TravisCI.Module.TravisCIModule...
Error: System.TypeLoadException: Method 'RunTargetAsync' in type 'Cake.MyGet.Module.MyGetEngine' from assembly 'Cake.MyGet.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at Cake.MyGet.Module.MyGetModule.Register(ICakeContainerRegistrar registrar)
   at Cake.Composition.ModuleLoader.LoadModules(IContainer container, CakeOptions options)
   at Cake.Program.Main()

The problem with module exists in Cake 0.29.0 only. The module is working fine with Cake 0.28.1 or older.

Please update for compatibility with Cake 0.22.x

Error: The assembly 'Cake.MyGet.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.19.4).
This assembly need to reference at least Cake.Core version 0.22.0.
Another option is to downgrade Cake to an earlier version.
It's not recommended, but you can explicitly opt-out of assembly verification
by configuring the Skip Verification setting to true
(i.e. command line parameter "--settings_skipverification=true",
envrionment variable "CAKE_SETTINGS_SKIPVERIFICATION=true",
read more about configuration at https://cakebuild.net/docs/fundamentals/configuration)

TeamCityLog is not escaping text correctly

Service messages need to have particular characters escaped, otherwise they can be misinterpreted by TeamCity. See https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-Escapedvalues for details.

Here's an example of this not being done:

##teamcity[buildProblem description='An error occurred when executing task 'Compile'.']
[03:14:55]
Property value not found
Valid property list format is (name( )*=( )*'escaped_value'( )*)* where escape symbol is "|"

Start supporting Cake 3.0.0

We upgraded Cake.BuildSystems.Module to 4.2.0, Cake.Frosting to 3.0.0 and Cake.Issues to 2.0.0, and are now getting a build error:

Unhandled exception. System.TypeLoadException: Method 'WriteLifeCycleStep' in type 'Cake.AzurePipelines.Module.AzurePipelinesReportPrinter' from assembly 'Cake.AzurePipelines.Module, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at Cake.AzurePipelines.Module.AzurePipelinesModule.Register(ICakeContainerRegistrar registrar)
at Cake.Frosting.ServiceCollectionExtensions.UseModule[TModule](IServiceCollection services)
at Cake.Frosting.CakeHostExtensions.<>c__8`1.<UseModule>b__8_0(IServiceCollection services)
at Cake.Frosting.CakeHost.ConfigureServices(Action`1 services)
at Cake.Frosting.CakeHostExtensions.UseModule[TModule](CakeHost host)
at DotNetNuke.Build.Program.Main(String[] args) in D:\a\1\s\build\Program.cs:line 26

No particular rush on the upgrade, just wanted to make sure you were aware and/or we didn't miss anything we needed to do with the upgrade. Thanks!

TeamCity module not working on the first run

Hey,

I added Cake.BuildSystems.Module to tools/Modules/packages.config as described.
The first run on TeamCity the module is not working. If I run it the second time it is.
So whenever a new Branch "runs" on the TeamCity server the module is not working since you "run" the branch a second time. The Cake.BuildSystems.Module folder and its content itself I did not check into source control. What am I doing wrong?

Start supporting Cake v2.0.0-rc0001

Cake v2.0.0-rc0001 has been released and the current version of Cake.BuildSystems.Module is incompatible with it.

The error raised is:

The assembly 'Cake.AzurePipelines.Module, Version=3.0.3.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (1.0.0).
For best compatibility it should target Cake.Core version 2.0.0.
The assembly 'Cake.MyGet.Module, Version=3.0.3.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (1.0.0).
For best compatibility it should target Cake.Core version 2.0.0.
The assembly 'Cake.TeamCity.Module, Version=3.0.3.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (1.0.0).
For best compatibility it should target Cake.Core version 2.0.0.
The assembly 'Cake.TravisCI.Module, Version=3.0.3.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (1.0.0).
For best compatibility it should target Cake.Core version 2.0.0.
Error: Method 'add_BeforeSetup' in type 'Cake.AzurePipelines.Module.AzurePipelinesEngine' from assembly 'Cake.AzurePipelines.Module, Version=3.0.3.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

The problem here is that Cake.BuildSystems.Module provides its own implementation of ICakeEngine, which had a breaking change in cake-build/cake#3152.

Suport Azure DevOps Server & cake 0.38

Could you please clarify, is it support Azure DevOps Server & cake 0.38?
I installed Cake.BuildSystems.Module 0.3.2 version, but any changes on the build definition result

Error: Method 'RunTargetAsync' does not have an implementation.

On Cake 0.23, and Cake.BuildSystems.Module 0.1.5, I am now getting this output:

Error: Method 'RunTargetAsync' in type 'Cake.TravisCI.Module.TravisCIEngine' from assembly 'Cake.TravisCI.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

I have no issues with this on TFS, only when running via command line on my dev machine where Travis is not in the picture.

CakeModules should be public classes

MyGetModule, TeamCityModule and TravisCIModule are all declared private class.
While this works when using Cake.exe and Cake.Tool, it does not work when using Cake.Frosting.

Cake.Frosting usage

Hi, can you please update your readme how to use this module with Cake.Frosting?
I tried it multiple times differently and I couldn't find out how to make this module working.
Until I found .UseModule extension on CakeHost so this works:

            return new CakeHost()
                .InstallTool(new Uri("nuget:?package=xunit.runner.console&version=2.4.1"))
                .UseModule<TeamCityModule>()
                .UseContext<BuildContext>()
                .Run(args);

Agent.WorkingDirectory appears not to be writable when run from inside a container

Not exactly sure why, but when I run Cake from within a Linux Container (Ubuntu / .NET Core) as part of an Azure Pipelines build, the directory pointed at by Agent.WorkFolder (aka TFBuild.Environment.Agent.WorkingDirectory ) is not writable, such that Cake.TFBuild.Module.TFBuildReportPrinter.WriteToMarkdown is failing to create the tasksummary.md file.

This results in the following error:

========================================
Default
========================================
##[debug]Processed: ##vso[task.logdetail finishtime=02/25/2019 05:00:15;progress=100;result=Succeeded;id=3f293bfc-27b1-42cf-af56-139f503340c8;]update
##[debug]Processed: ##vso[task.logdetail finishtime=02/25/2019 05:00:15;progress=100;state=Completed;result=Succeeded;id=0ffa0556-53ab-4a01-8f8a-c7dd226e3a15;]update
Error: One or more errors occurred. (Access to the path "/__w/tasksummary.md" is denied.)
	Access to the path "/__w/tasksummary.md" is denied.
##[debug]Exit code 1 received from tool '/bin/bash'

(I wasn't having this problem when I was building in a non-container Ubuntu hosted agent)

Error trying to load module with #module directive

Getting this error when loading the loading using a #module directive instead of using packages.config

Error: Method 'get_Tasks' in type 'Cake.MyGet.Module.MyGetEngine' from assembly 'Cake.MyGet.Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Teamcity build failure after upgrading from 3.0.3 to 4.1.0

We updated our cake build script to use 4.1.0 instead of 3.0.3 and now our build is bombing out with an error but it's only happening when the teamcity agent kicks of the build. Connecting to the same machine and running the same commandline as the teamcity agent causes the build to work perfectly fine. We tried restarting the teamcity build agent along with doing a git clean -dfx and we have had no luck. We could use some help on this. Below is the error we see from our teamcity agent logs for the failed build

TeamCity Agent Build Logs
image

Cake Build Script

I have only pasted the module pragma.

// modules
#module nuget:?package=Cake.BuildSystems.Module&version=4.1.0

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.24.0. Please upgrade to 0.28.0
  • You are currently referencing Cake.Common 0.24.0. Please upgrade to 0.28.0
  • The Cake.Core reference should be private. Specifically, your addin's .csproj should have a line similar to this: <PackageReference Include="Cake.Core" Version="0.28.0" PrivateAssets="All" />
  • The Cake.Common reference should be private. Specifically, your addin's .csproj should have a line similar to this: <PackageReference Include="Cake.Common" Version="0.28.0" PrivateAssets="All" />
  • Your addin should target netstandard2.0. Please note that there is no need to multi-target, netstandard2.0 is sufficient.
  • The nuget package for your addin should use the cake-contrib icon. Specifically, your addin's .csproj should have a line like this: <PackageIconUrl>https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</PackageIconUrl>.
  • There should be a YAML file describing your addin on the cake web site. Specifically, you should add a .yml file in this repo

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.org and in the project on github.

CodeQL show a warning on every run

1 issue was detected with this workflow: git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.

Add cake-module tag to Cake.BuildSystems.Module NuGet package

The NuGet Gallery will soon include a "Cake" tab with instructions on how to use NuGet packages in Cake build scripts. I'd like to suggest that you include the tag cake-module in the NuGet package of this module, so that the NuGet Gallery can display the correct instructions to install this module.

The UI will look similar to this:

image

Documentation on best practices on tags for Cake modules: https://cakebuild.net/docs/extending/modules/best-practices#tags

Would it be possible to use the Cake Contrib Icon for your NuGet Package?

Thanks again for creating this Cake Addin, we really appreciate the effort that you have put in to creating it.

We, the Cake Team, recently announced a new Cake Contrib Icon, details of which can be found here:

http://cakebuild.net/blog/2017/06/new-cake-contrib-icon

Would you consider changing the nuspec file for your NuGet Package to use this new Cake Contrib Icon? If so, the recommended URL to use is:

https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png

Details of the above URL can be found in the repository here:

https://github.com/cake-contrib/graphics

Please let me know if you have any questions.

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.