how to enable --enable-experimental-mirrors in dart build? - dart

My build of my projects are failing because they rely on mirrors and dart build out put tells me to use --enable-experimental-mirrors to try to use mirrors in dart2js code as it is. so if I run pub build --enable-experimental-mirrors all I get is Could not find an option named "enable-experimental-mirrors". Any hints much appreciated.

I haven't tried this myself yet but maybe you can pass it as a command line option in the transformer config
transformers:
- $dart2js:
commandLineOptions: [--enable-experimental-mirrors]

Related

Travis CI - Mono: 5.4.0.201

I need to be using version 5.4.0.201 of mono in order for netstandard to work correctly (as per: https://github.com/cake-build/cake/issues/2063)
In my travis.yml I tried specifying: mono: 5.4.0.201 however travis doesn't seem to recognise that as a valid mono version. What is the best / easiest way (if any) to overcome this? This is an open source project https://travis-ci.org/GitTools/GitVersion/jobs/362727450
Try changing Travis yml mono segment to
mono:
- 5.4.1
- latest

Is it possible to change the default build directory in Dart?

When I run pub build, pub puts the compiled app into build/web. Is it possible to configure my pubspec.yaml file to change the default output directory to, say, prod?
EDIT: I'm trying to avoid having to use the --output switch each time.
You can use pub build --output=someOtherDir
See also pub help build

How do I set the dart2js --minify option from the command line when executing `pub build`?

For my release process I need several different "modes." However, if I use the --mode option for pub build and set it to any value other than release, it forces un-minified javascript.
I know I can configure the dart2js transformer in my pubspec.yaml, but if I set minify: true under the $dart2js heading in my pubspec.yaml I am then forcing them to be minified, and then cannot produce un-minified debug builds.
What I'm really looking for is a way to configure arbitrary dart2js options (minified, checked, etc.) in pub build via the CLI (so that I don't have to hardcode in pubspec.yaml), or, failing that, to be able to specify additional arbitrary flags from the pub build CLI so that I can reserve --mode for debug and release. The asPlugin() transformer constructor takes a BarbackSettings object, but I can't see how to see arbitrary params in that via the command line.
I have never seen anything like that mentioned (for example in any of the bug reports) and I'm pretty sure this is not supported. I suggest to just create a feature request at http://dartbug.com.
One way I can think of is to create a script which manipulates the pubspec.yaml file before executing pub build. This should be easy using the https://pub.dartlang.org/packages/yaml package.

Can you pass compiler flags to dart2js via Dart Editor

I want to run a no minify build but not from Terminal. Can I do it form the Dart Editor IDE itself?
Under Run -> Manage Launches you can create a new Dart2js launch and pass in whatever compiler flags you want.
Dart2JS can be configured using pubspec.yaml Configuring the Built-in dart2js Transformer.
You also need a custom launch configuration until DartEditor's internal web server is replaced by pub serve which is work in progress.

How to specify the output directory for Dart's "pub deploy"?

With Dart's "pub" tool and its "deploy" command, you can create a deployable version of your Dart web application. The output is written to the "deploy" directory. I want to know if there's a way to specify a different output directory?
I searched the internet for a command-line option, but found no mention of it. Running "pub help deploy" shows no options for the deploy command.
If "pub deploy" has no output directory option, I want to find the pub.dart source code. I'll create a customized version that accepts an output directory option. Unfortunately, I can't find pub.dart in the SDK. I found the pub shell script. It calls pub.dart.snapshot, which is 100 thousand lines of unintelligible Dart bytecode. Is there a human readable pub.dart file? Is it in the SDK?
Your help is appreciated.
For now, this is not configurable. The source folder is always /web and the output folder is always /deploy.
The source is available at http://code.google.com/p/dart/source/browse/trunk/dart/sdk/lib/_internal/pub/lib/src/command/deploy.dart#33 .
A simple workaround is just to rename deploy once generated.

Resources