Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

The Dart protoc plug-in is not supported on Windows #10

Closed
unicomp21 opened this issue Sep 7, 2013 · 7 comments
Closed

The Dart protoc plug-in is not supported on Windows #10

unicomp21 opened this issue Sep 7, 2013 · 7 comments

Comments

@unicomp21
Copy link

lots of errors in the latest dart editor, also, can this be built on Windows? or just Linux?

@sgjesse
Copy link
Contributor

sgjesse commented Sep 11, 2013

Currently the protoc plug-in is only tested on Linux. The tests run on drone.io (https://drone.io/github.com/dart-lang/dart-protoc-plugin). The plug-in created (out/protoc-gen-dart) is a script file which might work on Windows in MinGW or cygwin.

@albertog
Copy link

please add windows support

@osstekz
Copy link

osstekz commented Mar 26, 2014

YES, PLEASE add windows support

@dss539
Copy link

dss539 commented Mar 11, 2018

It appears the only thing hindering Windows support is that one bash script.
You can work around this by creating a file named protoc-gen-dart.bat alongside the existing protoc-gen-dart shell script.
Inside the bat file, add this content...

@echo off
pushd %~dp0
set BINDIR=%CD%
popd
dart "%BINDIR%\protoc_plugin.dart" -c "%*"

When you invoke protoc, use these args:

protoc ^^my_message.proto^^ --plugin=protoc-gen-dart=^^C:\dart-protoc-plugin\bin^^\protoc-gen-dart.bat --dart_out=.

replace sections enclosed by ^^ with your own filename/path

@sigurdm
Copy link
Contributor

sigurdm commented Sep 11, 2018

After protocolbuffers/protobuf#5105 has come into a release you should be able to pub global activate protoc_plugin, add the pub cache to your path and run protoc --dart_out=....

@sigurdm sigurdm closed this as completed Sep 11, 2018
@letmefly
Copy link

please support windows platform, ths

@sigurdm
Copy link
Contributor

sigurdm commented Mar 29, 2019

@letmefly could you elaborate on what you are trying, what versions you are using and what goes wrong?
Windows should be supported now.

I have just tried out the combination of protoc-3.7.1, dart 2.2.0 and protoc_plugin v. 16.0.1 on windows-server-2016.
I installed dart protoc_plugin with:

pub global activate protoc_plugin

Make sure C:\Users<username>\AppData\Roaming\Pub\Cache\bin is in your %path.

And ran:

protoc-3.7.1-win64\bin\protoc.exe --dart_out=. -Iprotos test.proto

And everything seemed to work.

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

No branches or pull requests

7 participants