Dart, Pub and Cygwin

While I do most of my development on linux, I need to perform some testing on Windows where the result are sometimes different for io applications. To share some scripts between windows and linux, I tend to use bash scripts, which means using cygwin on Windows, however the current dart sdk (1.11.1 as of now) does not play well with cygwin. I used the the new chocolatey tool to install dart and dartium on windows (https://www.dartlang.org/downloads/windows.html) where they ended up in c:\tools

$ dart --version
Dart VM version: 1.11.0 (Wed Jun 24 06:44:48 2015) on "windows_x64"

$ pub
sh.exe": pub: command not found

Ouch! It seems that due to https://github.com/dart-lang/pub/issues/1120, pub is not supported on cygwin.

A simple script named pub solved the issue (added to my global path)

#!/bin/bash
SNAPSHOT="/c/tools/dart-sdk/bin/snapshots/pub.dart.snapshot"
dart "$SNAPSHOT" "$@"

I can now run pub run test without issues. however using -p dartium, it does not work properly (i'll try content-shell later)

Here the solution, like on linux is to have a dartium executable and add its folder to the global path

$ ln -s /c/tools/dartium/chrome.exe /c/tools/dartium/dartium.exe
export PATH=${PATH}:/c/tools/dartium

I can now properly run all my tests on windows

Popular posts from this blog

Fixing "DerInputStream.getLength(): lengthTag=109, too big" in Android Studio

Simple Samba setup on Lubuntu

Solving: insufficient permissions for device: user in plugdev group; are your udev rules wrong