Skip to content

[Bug] Cake Build (.cake) Files Not Supported #2243

Closed

Description

@RehanSaeed

I have a build.cake file that I am trying to do replacements in:

//#if (AppVeyor)
var foo = 1;
//#endif

#if (AppVeyor)
var bar = 2;
#endif

A Cake build file is essentially a C# .cs file. When I run dotnet new nuget --appveyor=true or dotnet new nuget --appveyor=false, the output I always get is:

var foo = 1;

var bar = 2;

My understanding is that unsupported file types fall back to using # for the comments (which is why I also tried it above). In this case that doesn't seem true. Can support be added?

Activity

  1. added
    triaged
    and removed on Mar 20, 2020
  2. added this to the July Sprint milestone on Apr 28, 2021
  3. added
    help-wanted
    on Jun 29, 2021
  4. vlada-shubina commented on Jun 29, 2021

    @vlada-shubina
    Member

    We're planning to work on this a bit later, let us know if anyone start working on it, so we don't work on this in parallel.

  5. vlada-shubina commented on Aug 17, 2021

    @vlada-shubina
    Member

    @RehanSaeed

    I've checked the scenario above, and //# syntax work for .cake. I'm adding also support for C# syntax.
    Probably the reason why it doesn't work for you, is option syntax - options are case-sensitive, so probably it should be dotnet new nuget --AppVeyor=true (unless you added the synonyms in dotnetcli.host json).

  6. added 7 commits that reference this issue on Aug 17, 2021
    2e3569b
    a257acc
    23b57e6
    48422f3
    c48675b
    b596388
    9f3575a
  7. added 2 commits that reference this issue on Aug 19, 2021
    524feee
    4ce1119
  8. added a commit that references this issue on Aug 31, 2021
    c6c078b
  9. added a commit that references this issue on Jun 7, 2022
    71c25be
  10. added a commit that references this issue on Jun 21, 2022
    d0974f5
  11. added a commit that references this issue on Jul 11, 2022
    26a580e
  12. added a commit that references this issue on Jul 16, 2026
    8b90fc7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help-wantedsize:2.0triaged

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions