Skip to content

Add windows support. #3

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

Closed
DjToMeK30 opened this issue Nov 2, 2022 · 12 comments
Closed

Add windows support. #3

DjToMeK30 opened this issue Nov 2, 2022 · 12 comments
Labels
enhancement New feature or request

Comments

@DjToMeK30
Copy link

I tried everything in https://buijs.dev/klutter-2/ for setting up my project but I get an error on latest flutter/dart
when running
flutter pub run klutter:producer init

I tried alot of stuff but the problem remains the same

` ════════════════════════════════════════════
KLUTTER (v0.2.4)
════════════════════════════════════════════

This might take a while. Just a moment please...
Unhandled exception:
FileSystemException: Exists failed, path = '\D:\flutter\test_klutter\lib' (OS Error: The filename, directory name, or volume label syntax is incorrect.
, errno = 123)
#0 _Directory.existsSync (dart:io/directory_impl.dart:94:7)
#1 FileUtil.maybeDelete (package:klutter/src/common/utilities.dart:60:9)
#2 _extension#0.setupRoot (package:klutter/src/cli/task_producer_init.dart:53:27)
#3 ProducerInit.toBeExecuted (package:klutter/src/cli/task_producer_init.dart:41:7)
#4 Task.execute (package:klutter/src/cli/task.dart:52:7)
#5 execute (package:klutter/src/cli/cli.dart:107:27)
#6 main (file:///D:/flutter/flutter_windows_3.3.6-stable/flutter/.pub-cache/hosted/pub.dartlang.org/klutter-0.2.4/bin/producer.dart:40:24)
#7 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
pub finished with exit code 255`

@buijs-dev
Copy link
Owner

What OS do you work on? I see flutter windows in the log so I presume you're using windows?

@DjToMeK30
Copy link
Author

DjToMeK30 commented Nov 3, 2022

Yes, windows
I just started Flutter development last week. Yesterday it asked me to update Flutter, so I did
Then I tried your example and this happens.

Lib folder is there and working. Tried also running with Admin(cmd), and checked that I ran pub get in both example and parent folder but this always happens on running with that command

Edit:
I don't know if that had any difference, but first I created a project and added klutter v0.2.3 and ran pub get. Then I just changes in .yaml file to v0.2.4 and ran pub get again. I did that before running "pub run klutter:producer init"

@buijs-dev
Copy link
Owner

That should not make a difference. I have not tested Klutter on windows myself because you won't be able to do the iOS development on windows. I will see if I reproduce this issue later today but I think it's as simple as an invalid windows path (e.g. / VS ).

@DjToMeK30
Copy link
Author

Oh ok thank you. I just wanted to try Android side on Windows to see if it is viable option and to test Android code and later try on MAC for iOS Side
I can also try on some other MAC machine when I get to it

@buijs-dev
Copy link
Owner

buijs-dev commented Nov 3, 2022

Yes please try on a mac and let me know! Thank you. :)

@charliebudd
Copy link

Seeing the same thing, I had assumed it was a windows issue from the path displayed in the error message. I think windows support would be a nice addition. Even if most people would use a mac to build and publish for IOS many people do there development in windows/linux.

@buijs-dev
Copy link
Owner

Okay noted. If there's enough interest I can look into it. For now I'm focussing on the 2023 beta release and I'm not sure how much time I will have beyond that (this year).

@charliebudd
Copy link

I may be able to find some time to help get it working on windows. In fact it seams the main issue here is that the _substitute method assumes the platform of the user and forces paths to begin with a /. I can open a PR adding a platform check here if you want to review it.

return path.startsWith(Platform.pathSeparator)
? path
: Platform.pathSeparator + path;

@buijs-dev
Copy link
Owner

Ah good find! Maybe it's enough to replace every forward slash with Platform.sep in that code. I'll have a look tomorrow.

@charliebudd
Copy link

Got the producer init command to run successfully but it isn't pretty...

changes can be seen here https://github.com/charliebudd/klutter/tree/windows-support

@buijs-dev buijs-dev changed the title lib not found Add windows support. May 7, 2023
@buijs-dev buijs-dev added the enhancement New feature or request label Oct 5, 2023
@buijs-dev
Copy link
Owner

I'm looking into this for next release.

@buijs-dev
Copy link
Owner

The dart side is done (1.0.0). There's work to be done in the Gradle Plugin e.a. because using global flutter on windows does not work well. It will be fixed by this issue where I'm working on right now.

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

No branches or pull requests

3 participants