cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.92k stars 731 forks source link

Define directive does not work with other directive #3646

Open soroshsabz opened 3 years ago

soroshsabz commented 3 years ago

Prerequisites

Cake runner

Cake .NET Tool, Cake runner for .NET Core

Cake version

1.30

Operating system

Linux, Windows

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

ITNOA

I have below code

#if (HOO)

#tool "nuget:?package=NUnit.ConsoleRunner&version=3.11.1"
#tool "nuget:?package=vswhere&version=2.8.4"

#addin nuget:?package=Cake.EntityFramework&version=0.3.0

#endif

As you can see HOO is define anywhere.

but Cake.EntityFramework installed anyway. :(

What is expected?

I expect if HOO does not define, all directive in #if statement does not run.

Steps to Reproduce

  1. Create simple cake file
  2. Add #if directive on undefined symbol
  3. Add one addin in #if scope

Output log

No response

soroshsabz commented 3 years ago

related to #1860

soroshsabz commented 3 years ago

related to https://github.com/dotnet/roslyn/issues/57467#issue-1039501645

soroshsabz commented 3 years ago

related to #1766