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

-cli commands Clarity needed for target options #322

Open
DevTKSS opened this issue Jan 6, 2025 · 11 comments
Open

-cli commands Clarity needed for target options #322

DevTKSS opened this issue Jan 6, 2025 · 11 comments

Comments

@DevTKSS
Copy link
Contributor

DevTKSS commented Jan 6, 2025

I would like to use uno in a restricted environment in the future and would still like to be able to use desktop target beside windows target. But it would not be allowed in that environment, to do wsl or similar setup.
In the -targets list and the cli commands available for uno.check there is no information provided to wsl

Please add this

Edit for clarity:

Image
marked the Targets that COULD be involved in the solution, but there is more clarity needed.

In an all targets setup we can choose from e.g. Windows Target, Desktop Target, IOS , Mac and so on.
The listed ones there do not providing the answer what to choose as command when it has to be only Windows and Desktop, but in a business environment where the IT maybe not allowes to install WSL or Hyper-V which is checked up and installed by Uno.Check by default, it's required to know what would enable this, or if its not possible, to use Desktop Target for example without this, please tell this clearly.
If it is possible, please tell about the correct things to choose.

in my opinion, target UWP is most likly outdated and only used for the uno template .Net 6 UPW while its recommended to use the Uno App template.
The SkiaWPF target next point, do not enable me to suggest which case this would be choosen, like: Is this Desktop target or is this also one of the not primary recommended templates?
Win32 Target might be Windows, BUT what if the target would be Windows + AnyCPU, or x64, which would not be 32 in my knowledge.

hope this made my point some clearer, so anyone could maybe tell about the solution?

@jeromelaban
Copy link
Member

Thanks for the question.

I do not understand the requirement. What do you mean by restricted environment?

@jeromelaban
Copy link
Member

I'm not entirely sure of the scenario, but if you only want to skip certain parts that would fail, you can use --skip parameter.

@DevTKSS
Copy link
Contributor Author

DevTKSS commented Jan 11, 2025

So if defining targets to be only desktop and windows that would be... None of them listed there explicitly and second, if you tell using --skip i should write --skip wsl --skip hyper-v --skip maui or how would that be reached?

@DevTKSS
Copy link
Contributor Author

DevTKSS commented Jan 22, 2025

Would lookup the repo to see possibilitys but I did not find the correct file/line where this would be able to see...

@DevTKSS DevTKSS changed the title -cli commands Add information about wsl for restricted environment setup -cli commands Clarity needed for target options Jan 26, 2025
@DevTKSS
Copy link
Contributor Author

DevTKSS commented Jan 26, 2025

Edited the initial request, so maybe someone can better understand what I would like to know and to be added

@DevTKSS
Copy link
Contributor Author

DevTKSS commented Feb 15, 2025

reviewed this file:

UnoCheck/TargetPlatform.cs
and this file: UnoCheck/TargetPlatformHelper.cs on the Method GetTargetPlatformFromFlags

Required to be updated parts:

  1. the uno.check --help output description for --target is outdated
  2. the told available targets in the documentation are outdated
  3. GetTargetPlattformFromFlags Method:
public static TargetPlatform GetTargetPlatformFromFlag(string flag)
		{
			switch (flag.ToLowerInvariant())
			{
				case "webassembly": // missing return for this case, but listed in the flags list, potential error source if tryed to be used
				case "wasm":
					return TargetPlatform.WebAssembly;
				case "ios":
					return TargetPlatform.iOS;
				case "android": // missing return for this case, but listed in the flags list, potential error source if tryed to be used
				case "droid": // maybe better move to the android case?
					return TargetPlatform.Android;
				case "macos":
					return TargetPlatform.macOS;
				case "skiadesktop":
					return TargetPlatform.SkiaDesktop;
                case "windows": // missing return for this case, potential error source if tryed to be used
                case "wasdk": // not listed in the flags like this => change to the actual flag enum member name
					return TargetPlatform.WinAppSDK;
                case "win32desktop": // missing return for this case and this case is not included in the flags, so maybe delete it here, potential error source if tryed to be used
                case "win32": // could maybe moved to the actual windows case, which is actually included in the flags list, while win32 is not!
                    return TargetPlatform.Windows;
				case "skia":
					return TargetPlatform.SkiaDesktop;
				case "linux":
					return TargetPlatform.SkiaDesktop;
				case "web":
					return TargetPlatform.WebAssembly;

				case "all":
					return TargetPlatform.All;

				default:
					return TargetPlatform.None;
			}
		}

Generally optional improvement: formatting of intendings in this method code should be fixed

@jeromelaban researched the code in the repository and tryed to make the required updates clearer. Would you please check the added comments above and tell about possibilitys of changes?

@jeromelaban
Copy link
Member

Indeed, we're missing documentation on those options, this could be done in a contribution.

@DevTKSS
Copy link
Contributor Author

DevTKSS commented Feb 18, 2025

Would you or someone else of the team be able to have a look on the comments I added and tell which are realistic or not? Otherwise its pure guessing game😅

@jeromelaban
Copy link
Member

I'm sorry, I missed the comments, it's not particularly common to do this :) PRs are better.

Fall through cases are accepted in C#, so there's no problem for case "windows". For the rest, they're only aliases that could be added to the documentation.

@DevTKSS
Copy link
Contributor Author

DevTKSS commented Feb 19, 2025

Hello Jerome,
No that has not should be the actual PR, more thought to be the pre step to enabled one..

like you might do a kick off in a project or task to exchange possible ideas, getting the opinion of ones who are more experienced in these things, like in this case you and the other members of the actual UNO Team, to
maybe see that some of the initial points like those I added above in the comments, has maybe not been realistic but also possibly enable collecting points to add to the future task list, to even enhance the derrived PR. 👍
Like you have the last header in the GitHub issue form, where you are asking about the missing things that resulted in raising this issue instead of doing a PR.

@jeromelaban
Copy link
Member

Those are simple documentation and help messages changes, it's not a problem to open a PR and discuss there.

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

2 participants