Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--single-target is not working #594

Closed
mynkow opened this issue Nov 17, 2014 · 15 comments
Closed

--single-target is not working #594

mynkow opened this issue Nov 17, 2014 · 15 comments

Comments

@mynkow
Copy link

mynkow commented Nov 17, 2014

It always execute the dependencies. I have tried all possible combinations.

@forki
Copy link
Member

forki commented Nov 17, 2014

do you have mini repro?

@mynkow
Copy link
Author

mynkow commented Nov 17, 2014

test.cmd

@echo off

".\tools\NuGet\NuGet.exe" "install" "FAKE" "-OutputDirectory" ".\bin\tools" "-ExcludeVersion" "-Prerelease"
".\tools\Nuget\NuGet.exe" "install" "FSharp.Formatting.CommandTool" "-OutputDirectory" ".\bin\tools" "-ExcludeVersion" "-Prerelease"
".\tools\Nuget\NuGet.exe" "install" "SourceLink.Fake" "-OutputDirectory" ".\bin\tools" "-ExcludeVersion"

SET TARGET="Build"

IF NOT [%1]==[](set TARGET="%1")

".\bin\tools\FAKE\tools\Fake.exe" "test.fsx" "target=%TARGET%" -st applicationName=MyApp

PAUSE

test.fsx

#I @"./bin/tools/FAKE/tools/"
#r @"./bin/tools/FAKE/tools/FakeLib.dll"
#load @"./bin/tools/SourceLink.Fake/tools/SourceLink.fsx"

open Fake
open Fake.Git
open Fake.FSharpFormatting
open Fake.AssemblyInfoFile
open Fake.ReleaseNotesHelper
open System
open System.IO

let applicationName = getBuildParamOrDefault "applicationName" ""

Target "Clean" (fun _ -> trace "Clean...")

Target "Build" (fun _ ->
trace "Build..."
)

Target "RestorePackages" (fun _ ->
trace "RestorePackages..."
)

Target "CreateNuGet" (fun _ ->
trace "CreateNuGet..."
)

// Dependencies
"Clean"
==> "RestorePackages"
==> "Build"
==> "CreateNuGet"

// start build
RunParameterTargetOrDefault "target" "Build"

@cdroulers
Copy link

Works for me in version 3.27.5 with both -st and --single-target

@Stift
Copy link
Contributor

Stift commented May 28, 2015

I can confirm the problem. Normally -st is working, but when I define an extra build parameter it is executed in the target order and -st is ignored.

@jussimattila
Copy link

I confirm the problem too. Easily reproducable by calling e.g. FAKE.exe Build -st param=1.

@smoothdeveloper
Copy link
Contributor

also hitting this issue whenever I specify a parameter it ignores -st, is there a workaround?

@cdroulers
Copy link

--single-target works great for me
On 22 Dec 2015 3:12 p.m., "Gauthier Segay" [email protected] wrote:

also hitting this issue whenever I specify a parameter it ignores -st, is
there a workaround?


Reply to this email directly or view it on GitHub
#594 (comment).

@smoothdeveloper
Copy link
Contributor

@cdroulers Am I doing something wrong?

> build -v
FakePath: C:\work\gitsvnclone\packages\FAKE\tools\FakeLib.dll
FAKE - F# Make "4.11.0"
> build generatecode buildMode=Debug --single-target
Building project with version: LocalBuild
Shortened DependencyGraph for Target generatecode:
<== generatecode
   <== buildshared
   <== buildresources
   <== warmuplocaldatabase

The resulting target order is:
 - buildshared
 - buildresources
 - warmuplocaldatabase
 - generatecode
Starting Target: buildshared
...

the build.cmd file is like this:

..\packages\FAKE\tools\FAKE.exe build.fsx %* 

@cdroulers
Copy link

No idea. I use fake.exe and --single-target and it works. But with -st, it
doesn't work.
On 22 Dec 2015 9:26 p.m., "Gauthier Segay" [email protected] wrote:

@cdroulers https:/cdroulers Am I doing something wrong?

build -v
FakePath: C:\work\gitsvnclone\packages\FAKE\tools\FakeLib.dll
FAKE - F# Make "4.11.0"
build generatecode buildMode=Debug --single-target
Building project with version: LocalBuild
Shortened DependencyGraph for Target generatecode:
<== generatecode
<== buildshared
<== buildresources
<== warmuplocaldatabase

The resulting target order is:

  • buildshared
  • buildresources
  • warmuplocaldatabase
  • generatecode
    Starting Target: buildshared
    ...


Reply to this email directly or view it on GitHub
#594 (comment).

@mynkow
Copy link
Author

mynkow commented Dec 23, 2015

Can you hive us working sample?

-----Original Message-----
From: "Christian Droulers" [email protected]
Sent: ‎23/‎12/‎2015 04:30 AM
To: "fsharp/FAKE" [email protected]
Cc: "mynkow" [email protected]
Subject: Re: [FAKE] --single-target is not working (#594)

No idea. I use fake.exe and --single-target and it works. But with -st, it
doesn't work.
On 22 Dec 2015 9:26 p.m., "Gauthier Segay" [email protected] wrote:

@cdroulers https:/cdroulers Am I doing something wrong?

build -v
FakePath: C:\work\gitsvnclone\packages\FAKE\tools\FakeLib.dll
FAKE - F# Make "4.11.0"
build generatecode buildMode=Debug --single-target
Building project with version: LocalBuild
Shortened DependencyGraph for Target generatecode:
<== generatecode
<== buildshared
<== buildresources
<== warmuplocaldatabase

The resulting target order is:

  • buildshared
  • buildresources
  • warmuplocaldatabase
  • generatecode
    Starting Target: buildshared
    ...


Reply to this email directly or view it on GitHub
#594 (comment).


Reply to this email directly or view it on GitHub.

@bentayloruk
Copy link
Contributor

I think this will work for you if you change the command line to use the "modern" options. Your current usage is a mix of the two. This should work.

.\bin\tools\FAKE\tools\Fake.exe test.fsx %TARGET% -st -ev applicationName MyApp

There are some docs here too.

bentayloruk added a commit to bentayloruk/FAKE that referenced this issue Jan 19, 2016
Print a warning when fail to parse command line args with Argu.  We
still fall back to try and run with the pre-2.1.8 argument style.

Extracted exception formatting from the traceException function, so it
could be used when tracing an exception as a warning.

This should help avoid confusion, as witnessed in fsprojects#1072 and fsprojects#594.
bentayloruk added a commit to bentayloruk/FAKE that referenced this issue Jan 20, 2016
Print a warning when fail to parse command line args with Argu.  We
still fall back to try and run with the pre-2.1.8 argument style.

Extracted exception formatting from the traceException function, so it
could be used when tracing an exception as a warning.

This should help avoid confusion, as witnessed in fsprojects#1072 and fsprojects#594.
bentayloruk added a commit to bentayloruk/FAKE that referenced this issue Jan 20, 2016
Print a warning when fail to parse command line args with Argu.  We
still fall back to try and run with the pre-2.1.8 argument style.

Extracted exception formatting from the traceException function, so it
could be used when tracing an exception as a warning.

This should help avoid confusion, as witnessed in fsprojects#1072 and fsprojects#594.
bentayloruk added a commit to bentayloruk/FAKE that referenced this issue Jan 20, 2016
Print a warning when fail to parse command line args with Argu.  We
still fall back to try and run with the pre-2.1.8 argument style.

Extracted exception formatting from the traceException function, so it
could be used when tracing an exception as a warning.

This should help avoid confusion, as witnessed in fsprojects#1072 and fsprojects#594.
@dsyme
Copy link
Collaborator

dsyme commented Apr 14, 2016

@mynkow can we close this issue?

@smoothdeveloper
Copy link
Contributor

It seems #1301 will finally solve this 😄

@forki forki closed this as completed Jul 14, 2016
@mynkow
Copy link
Author

mynkow commented Jul 19, 2016

I've just tested this. It is working now. Thank you.

@sdluxeon
Copy link

That escalated quickly 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants