cake-build / resources

Contains different kind of resources such as bootstrappers and configuration files.
MIT License
55 stars 78 forks source link

Parent tasks do not support periods in the task name. #74

Closed siennathesane closed 5 years ago

siennathesane commented 5 years ago

What You Are Seeing?

More than one build script specified.

What is Expected?

Able to have a task name reflect a dotnet project name which contains a period; i.e. Project.Identifier.

What version of Cake are you using?

0.33.0

Are you running on a 32 or 64 bit system?

64-bit

What environment are you running on? Windows? Linux? Mac?

image

Are you running on a CI Server? If so, which one?

No, local with both PS Core and PS Framework.

// PS Framework
> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

//PS Core
> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.3
PSEdition                      Core
GitCommitId                    6.1.3
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

How Did You Get This To Happen? (Steps to Reproduce)

> Invoke-WebRequest https://cakebuild.net/download/bootstrapper/windows -OutFile build.ps1

> Invoke-WebRequest https://gist.github.com/mxplusb/fbfd448e58239271fac976573d887182 -OutFile build.cake

// expected for testing purposes.
> .\build.ps1
Preparing to run build script...
Running build script...
Error: One or more errors occurred.
        Argument 'target' was not set.

// "Welcome" target works as intended.
> .\build.ps1 -Target "Welcome"
Preparing to run build script...
Running build script...

========================================
Welcome
========================================
Welcome to the Project Build Environment.

Below is a list of built targets available. Read the details before compiling, it may matter. To build a given target, just call `build.ps1 -Target <T>`.
Happy coding.

Build Target                             Description
=================================================================================================================================================================================================
Project.DevServer                       - Compiles the Project Development Server, which can be easily used for quick and dirty local development.
Constants.Vault                          - Generates the necessary constants for building, and then resets the files. Not for direct use as it will generate the files then immediate reset them.

// will fail because of the period.
> .\build.ps1 -Target Project.DevServer
Preparing to run build script...
Running build script...
More than one build script specified.
For usage, use parameter --help

// rename "Project.DevServer" to "Project" in cakefile
> .\build.ps1 -Target "Project"
Preparing to run build script...
Running build script...

========================================
Constants.Vault
========================================

========================================
Project
========================================

Task                          Duration            
--------------------------------------------------
Constants.Vault               00:00:00.0092790    
Project                       00:00:00.0016905    
--------------------------------------------------
Total:                        00:00:00.0109695

### Output Log

```powershell
> .\build.ps1 -Target "Project" -Verbosity Diagnostic
Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing P:/aperture/keystone/build.cake...
Processing build script...
Installing addins...
Found package 'Cake.FileHelpers 3.2.0' in 'P:/aperture/keystone/tools/Addins'.
Package Cake.FileHelpers.3.2.0 has already been installed.
Successfully installed 'Cake.FileHelpers 3.2.0' to P:/aperture/keystone/tools/Addins
Executing nuget actions took 29.23 ms
The addin Cake.FileHelpers will reference Cake.FileHelpers.dll.
Verifying assembly 'Cake.FileHelpers, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null'.
Adding assembly reference to mscorlib.dll...
Adding assembly reference to System.Core.dll...
Adding assembly reference to Cake.Core.dll...
Adding assembly reference to Cake.Common.dll...
Adding assembly reference to Cake.exe...
Adding assembly reference to System.dll...
Adding assembly reference to System.Xml.dll...
Adding assembly reference to System.Xml.Linq.dll...
Adding assembly reference to System.Data.dll...
Adding assembly reference to System.Runtime.dll...
Adding assembly reference to System.Collections.dll...
Adding assembly reference to netstandard.dll...
Adding assembly reference to Cake.FileHelpers.dll...
Importing namespace Cake.Common...
Importing namespace Cake.Common.Build...
Importing namespace Cake.Common.Build.AppVeyor...
Importing namespace Cake.Common.Build.AppVeyor.Data...
Importing namespace Cake.Common.Build.Bamboo...
Importing namespace Cake.Common.Build.Bamboo.Data...
Importing namespace Cake.Common.Build.BitbucketPipelines...
Importing namespace Cake.Common.Build.BitbucketPipelines.Data...
Importing namespace Cake.Common.Build.Bitrise...
Importing namespace Cake.Common.Build.Bitrise.Data...
Importing namespace Cake.Common.Build.ContinuaCI...
Importing namespace Cake.Common.Build.ContinuaCI.Data...
Importing namespace Cake.Common.Build.GitLabCI...
Importing namespace Cake.Common.Build.GitLabCI.Data...
Importing namespace Cake.Common.Build.GoCD...
Importing namespace Cake.Common.Build.GoCD.Data...
Importing namespace Cake.Common.Build.Jenkins...
Importing namespace Cake.Common.Build.Jenkins.Data...
Importing namespace Cake.Common.Build.MyGet...
Importing namespace Cake.Common.Build.TeamCity...
Importing namespace Cake.Common.Build.TFBuild...
Importing namespace Cake.Common.Build.TFBuild.Data...
Importing namespace Cake.Common.Build.TravisCI...
Importing namespace Cake.Common.Build.TravisCI.Data...
Importing namespace Cake.Common.Diagnostics...
Importing namespace Cake.Common.IO...
Importing namespace Cake.Common.IO.Paths...
Importing namespace Cake.Common.Net...
Importing namespace Cake.Common.Security...
Importing namespace Cake.Common.Solution...
Importing namespace Cake.Common.Solution.Project...
Importing namespace Cake.Common.Solution.Project.Properties...
Importing namespace Cake.Common.Solution.Project.XmlDoc...
Importing namespace Cake.Common.Text...
Importing namespace Cake.Common.Tools...
Importing namespace Cake.Common.Tools.Cake...
Importing namespace Cake.Common.Tools.Chocolatey...
Importing namespace Cake.Common.Tools.Chocolatey.ApiKey...
Importing namespace Cake.Common.Tools.Chocolatey.Config...
Importing namespace Cake.Common.Tools.Chocolatey.Download...
Importing namespace Cake.Common.Tools.Chocolatey.Features...
Importing namespace Cake.Common.Tools.Chocolatey.Install...
Importing namespace Cake.Common.Tools.Chocolatey.New...
Importing namespace Cake.Common.Tools.Chocolatey.Pack...
Importing namespace Cake.Common.Tools.Chocolatey.Pin...
Importing namespace Cake.Common.Tools.Chocolatey.Push...
Importing namespace Cake.Common.Tools.Chocolatey.Sources...
Importing namespace Cake.Common.Tools.Chocolatey.Uninstall...
Importing namespace Cake.Common.Tools.Chocolatey.Upgrade...
Importing namespace Cake.Common.Tools.DotCover...
Importing namespace Cake.Common.Tools.DotCover.Analyse...
Importing namespace Cake.Common.Tools.DotCover.Cover...
Importing namespace Cake.Common.Tools.DotCover.Merge...
Importing namespace Cake.Common.Tools.DotCover.Report...
Importing namespace Cake.Common.Tools.DotNetCore...
Importing namespace Cake.Common.Tools.DotNetCore.Build...
Importing namespace Cake.Common.Tools.DotNetCore.BuildServer...
Importing namespace Cake.Common.Tools.DotNetCore.Clean...
Importing namespace Cake.Common.Tools.DotNetCore.Execute...
Importing namespace Cake.Common.Tools.DotNetCore.MSBuild...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Delete...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Push...
Importing namespace Cake.Common.Tools.DotNetCore.Pack...
Importing namespace Cake.Common.Tools.DotNetCore.Publish...
Importing namespace Cake.Common.Tools.DotNetCore.Restore...
Importing namespace Cake.Common.Tools.DotNetCore.Run...
Importing namespace Cake.Common.Tools.DotNetCore.Test...
Importing namespace Cake.Common.Tools.DotNetCore.Tool...
Importing namespace Cake.Common.Tools.DotNetCore.VSTest...
Importing namespace Cake.Common.Tools.DupFinder...
Importing namespace Cake.Common.Tools.Fixie...
Importing namespace Cake.Common.Tools.GitLink...
Importing namespace Cake.Common.Tools.GitReleaseManager...
Importing namespace Cake.Common.Tools.GitReleaseManager.AddAssets...
Importing namespace Cake.Common.Tools.GitReleaseManager.Close...
Importing namespace Cake.Common.Tools.GitReleaseManager.Create...
Importing namespace Cake.Common.Tools.GitReleaseManager.Export...
Importing namespace Cake.Common.Tools.GitReleaseManager.Label...
Importing namespace Cake.Common.Tools.GitReleaseManager.Publish...
Importing namespace Cake.Common.Tools.GitReleaseNotes...
Importing namespace Cake.Common.Tools.GitVersion...
Importing namespace Cake.Common.Tools.ILMerge...
Importing namespace Cake.Common.Tools.ILRepack...
Importing namespace Cake.Common.Tools.InnoSetup...
Importing namespace Cake.Common.Tools.InspectCode...
Importing namespace Cake.Common.Tools.MSBuild...
Importing namespace Cake.Common.Tools.MSpec...
Importing namespace Cake.Common.Tools.MSTest...
Importing namespace Cake.Common.Tools.NSIS...
Importing namespace Cake.Common.Tools.NuGet...
Importing namespace Cake.Common.Tools.NuGet.Add...
Importing namespace Cake.Common.Tools.NuGet.Init...
Importing namespace Cake.Common.Tools.NuGet.Install...
Importing namespace Cake.Common.Tools.NuGet.List...
Importing namespace Cake.Common.Tools.NuGet.Pack...
Importing namespace Cake.Common.Tools.NuGet.Push...
Importing namespace Cake.Common.Tools.NuGet.Restore...
Importing namespace Cake.Common.Tools.NuGet.SetApiKey...
Importing namespace Cake.Common.Tools.NuGet.SetProxy...
Importing namespace Cake.Common.Tools.NuGet.Sources...
Importing namespace Cake.Common.Tools.NuGet.Update...
Importing namespace Cake.Common.Tools.NUnit...
Importing namespace Cake.Common.Tools.OctopusDeploy...
Importing namespace Cake.Common.Tools.OpenCover...
Importing namespace Cake.Common.Tools.ReportGenerator...
Importing namespace Cake.Common.Tools.ReportUnit...
Importing namespace Cake.Common.Tools.Roundhouse...
Importing namespace Cake.Common.Tools.SignTool...
Importing namespace Cake.Common.Tools.SpecFlow...
Importing namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport...
Importing namespace Cake.Common.Tools.SpecFlow.TestExecutionReport...
Importing namespace Cake.Common.Tools.TextTransform...
Importing namespace Cake.Common.Tools.VSTest...
Importing namespace Cake.Common.Tools.VSWhere...
Importing namespace Cake.Common.Tools.VSWhere.All...
Importing namespace Cake.Common.Tools.VSWhere.Latest...
Importing namespace Cake.Common.Tools.VSWhere.Legacy...
Importing namespace Cake.Common.Tools.VSWhere.Product...
Importing namespace Cake.Common.Tools.WiX...
Importing namespace Cake.Common.Tools.WiX.Heat...
Importing namespace Cake.Common.Tools.XBuild...
Importing namespace Cake.Common.Tools.XUnit...
Importing namespace Cake.Common.Xml...
Importing namespace Cake.Core...
Importing namespace Cake.Core.Diagnostics...
Importing namespace Cake.Core.IO...
Importing namespace Cake.Core.Scripting...
Importing namespace Cake.FileHelpers...
Importing namespace System...
Importing namespace System.Collections.Generic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Text...
Importing namespace System.Threading.Tasks...
Compiling build script...

========================================
Constants.Vault
========================================
Executing task: Constants.Vault
Finished executing task: Constants.Vault

========================================
Project
========================================
Executing task: Project
Finished executing task: Project

Task                          Duration            
--------------------------------------------------
Constants.Vault               00:00:00.0057305    
Project                       00:00:00.0012355    
--------------------------------------------------
Total:                        00:00:00.0069660    
Roadrunner67 commented 5 years ago

@devlead Where is the best place to put a unit test with a custom build.cake to provoke this issue?

patriksvensson commented 5 years ago

@Roadrunner67 Try quoting the target: .\build.ps1 -Target "Project.DevServer" and see if it works. Looks like the command line arguments sent to the program sees Project.DevServer as two arguments.

Roadrunner67 commented 5 years ago

Quotes don't help. The VS Code Cake extension already quotes the targets BTW.

Roadrunner67 commented 5 years ago

OK, the problem lies with build.ps1 if I call cake.exe directly it is a non-issue.

Roadrunner67 commented 5 years ago

Build.ps1 line 246:

$cakeArguments = @("$Script"); if ($Target) { $cakeArguments += "-target=""$Target""" } if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }

..instead of..

$cakeArguments = @("$Script"); if ($Target) { $cakeArguments += "-target=$Target" } if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }

.. fixes the problem - not sure where build. ps1 lives though

devlead commented 5 years ago

@Roadrunner67 the bootstrappers reside in the https://github.com/cake-build/resources/ repo.

Roadrunner67 commented 5 years ago

@devlead my PR #79 fails on AppVeyor, but I have no clue what the problem is.

devlead commented 5 years ago

Looks like it fails if no script is supplied.

Roadrunner67 commented 5 years ago

@devlead ok, got it - ready for approval

devlead commented 5 years ago

fixed by #80