google / streamy-dart

Apache License 2.0
60 stars 23 forks source link

apigen step fails (from README.md instructions on how to try the library) #293

Open aam opened 7 years ago

aam commented 7 years ago
> dart bin/apigen.dart \
    --discovery-file=urlshortener.json \
    --client-file-name=urlshortener \
    --output-dir=urlshortener
Unhandled exception:
Could not import "package:streamy/generator.dart" from "file:///usr/local/home/aam/dart/streamy-dart/bin/apigen.dart": Could not resolve a package location for base at file:///usr/local/google/home/aam/dart/streamy-dart/bin/apigen.dart
null

That sounds easy to fix - you need to run pub get first.

But then the command seems to be outdated as it refers to outdated options. However even after you update parameters, you still get an error:

Transform StreamyYaml on streamy|lib/raw.streamy.yaml threw error: 'package:streamy/generator/ir.dart': error: line 140 pos 25: redirection constructor 'TypeRef' must be const
  const TypeRef.any() : this('any');
                        ^

You get the same error by simply running pub build:

$ pub build
Loading source assets... 
Loading smoke/src/default_transformer and streamy transformers... (1.0s)
Building streamy... 
Build error:
Transform StreamyYaml on streamy|lib/raw.streamy.yaml threw error: 'package:streamy/generator/ir.dart': error: line 140 pos 25: redirection constructor 'TypeRef' must be const
  const TypeRef.any() : this('any');
                        ^
$ pub version
Pub 1.21.0-dev.11.1