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

Target Alias #1052

Closed
pms1969 opened this issue Dec 21, 2015 · 4 comments
Closed

Target Alias #1052

pms1969 opened this issue Dec 21, 2015 · 4 comments

Comments

@pms1969
Copy link

pms1969 commented Dec 21, 2015

Is there a way to alias a target in Fake?

For instance,
- I have a target called "UpdateNugetPackages", and I'd like to call it as "up"
- I have a set of targets that I'd like to alias as 1 call. "ENV"==> "SOMETHINGELSE" ==> "LAST_THING" aliased as "doit"

for both these scenarios at present I use another target, set the build chain in there and pipe thru run. i.e.
Target "up" (fun _ -> "up" ==> "UpdateNugetPackages" |> Run)

It's not really an issue, but this method means I get 2 build summaries, 1 for the inside build chain, and then 1 for the alias. It just looks a bit weird, and the alias thing kind of makes sense.

Thoughts?

@forki
Copy link
Member

forki commented Dec 21, 2015

Target "up" (fun _ -> "up" ==> "UpdateNugetPackages" |> Run)

I don't think that's a good idea since it will mess with FAKE's internal target managment stuff.

Better:

Target "up" DoNothing
"UpdateNugetPackages" ==> "up"

for the second case:

Target "doit" DoNothing
"ENV" ==> "SOMETHINGELSE" ==> "LAST_THING" ==> "doit"

@pms1969
Copy link
Author

pms1969 commented Dec 21, 2015

Thanks.

The problem for me is that I don't want LAST_THING to always be dependent on SOMETHINGELSE or ENV. Is there a way of dealing with that?

I use the wrapper to prevent the chains from firing every time, and set up dynamic build chains for various calls. It has worked well so far, but I appreciate that it's unsupported. In my case, there are no target chains except those set up in the aliases. (actually, that's not quite true, but they are very small chains, and only a couple of them)

I've had a rumage around the code, and have an idea for the alias. If there's no current way to support the requirement for the dependency chain to be transient in the way I describe above, I'll see if I can implement something and supply a pull request.

@forki
Copy link
Member

forki commented Dec 21, 2015

Maybe you can use =?> which allows you to have conditional dependencies.
On Dec 21, 2015 18:51, "Paul Saunders" notifications@github.com wrote:

Thanks.

The problem for me is that I don't want LAST_THING to always be dependent
on SOMETHINGELSE or ENV. Is there a way of dealing with that?

I use the wrapper to prevent the chains from firing every time, and set up
dynamic build chains for various calls. It has worked well so far, but I
appreciate that it's unsupported. In my case, there are no target chains
except those set up in the aliases.

I've had a rumage around the code, and have an idea for the alias. If
there's no current way to support the requirement for the dependency chain
to be transient in the way I describe above, I'll see if I can implement
something and supply a pull request.


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

@pms1969
Copy link
Author

pms1969 commented Dec 21, 2015

possible, I hadn't thought of that, because I already have conditional dependencies depending on my context (alias). That could get quite complicated quite quickly. I've managed to make some changes. I'll commit and give you a pull request. look it over and if it's suitable, then good. If not, no problem, I'm sure I can just keep my fork in sync with master and use the changes as they stand for my work.

@dsyme dsyme closed this as completed Oct 6, 2016
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

3 participants