Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add Interactive mode with target selection#1437

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Danielku15 wants to merge5 commits intonuke-build:develop
base:develop
Choose a base branch
Loading
fromDanielku15:feature/interactive-targets

Conversation

@Danielku15
Copy link
Contributor

I confirm that the pull-request:

  • Follows the contribution guidelines
  • Is based on my own work
  • Is in compliance with my employer

This PR contains a proposal how#1436 could be implemented. Structurally we should still discuss where what should go but it already gives a feeling on what a user gets with this change.

Current design decisions

  • I opted to the SpecterConsole as proposed in the issue.
  • I moved theInvokedTarget loading logic into theExecutableTargetFactory
  • I put the implementation of selecting targets intoNukeBuild to allow people overriding and customizing it.
  • I made theExecutableTargets public so custom implementations can use it.
  • For the sake of simplicity i did not move yet the console logic into theTerminal class.
  • I tried to keep the target selection output close to what a user sees when executing--help

Any feedback is welcome to complete this change.

Demo

rider64_xcwuHlW2Dh.mp4
classBuild:NukeBuild{publicstaticintMain()=>Execute<Build>();publicBuild(){Interactive=true;}publicTargetCompile=> t=>t.Description("Compiles the project").Executes(()=>Log.Information("Compile target execute"));publicTargetTest=> t=>t.DependsOn(Compile).Description("Executes all tests").Executes(()=>Log.Information("Test target execute"));publicTargetPrepareEnvironment=> t=>t.Before(Compile).Description("Prepares your development environment with all dependencies.").Executes(()=>Log.Information("PrepareEnvironment target execute"));}

voidReportSummary(Configure<Dictionary<string,string>>configurator=null);

internalIReadOnlyCollection<ExecutableTarget>ExecutableTargets{get;}
IReadOnlyCollection<ExecutableTarget>ExecutableTargets{get;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should be reverted

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

From my side this change was intentional. To properly be able to override and customizeOnNoTargetsSpecified() developers need access to the general list of targets which are there as option.

e.g. in some projects we'd like to only be able to have a "single target" selection as this fits the project setup better and would like to change the default "multi selection" implementation shipped in nuke.

As alternative I could pass the executableTargets a parameter toOnNoTargetsSpecified.

@matkochmatkochforce-pushed thedevelop branch 2 times, most recently from1131d5a todc902f8CompareNovember 5, 2024 09:00
@ITaluone
Copy link
Contributor

ITaluone commentedNov 8, 2024
edited
Loading

I wouldn't go for "automatically detect local terminal and execute the interactive mode when no parameters given".

I would rather add an option onnuke :setup as opt-in. Maybe not everyone wants to be forced into interactive mode, especially, when running.\build.cmd before runs the pipeline and suddenly it stays in interactive mode, waiting for user input.
(Can also be considered as a behavioral breaking change IMHO)

@Danielku15
Copy link
ContributorAuthor

I wouldn't go for "automatically detect local terminal and execute the interactive mode when no parameters given".

@ITaluone I agree and there are some considerations around that in the proposal. One important detail in this implementation is: there is an additional--interactive parameter (orbool Interactive {get;set;}) which is default unset. With the current implementation you have following options as a developer/user:

  • You set--interactive on the commandline to activate the mode.
  • You can setthis.Interactive = <your own check> in the constructor of your Build class to control things.
  • You can override theOnNoTargetsSpecified method and trigger any custom logic.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@matkochmatkochmatkoch left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Danielku15@ITaluone@matkoch

[8]ページ先頭

©2009-2025 Movatter.jp