0
votes

I try to create build steps in teamcity to build dart angular application. At first step I run command line script:

set https_proxy=http://myproxyaddress
pub get

Log looks like:

[Step 1/5] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script8119797236865524010.cmd
[18:23:36][Step 1/5] in directory: C:\TeamCity\buildAgent\work\4213686b1a2fc1c1\Soy.Warehouse.UI
[18:23:36][Step 1/5] Resolving dependencies...
[18:23:40][Step 1/5] Downloading angular 4.0.0-alpha...
[18:23:40][Step 1/5] Downloading analyzer 0.30.0+4...
[18:23:40][Step 1/5] Downloading angular_compiler 0.1.1...
[18:23:40][Step 1/5] Downloading angular_components 0.6.0-alpha...
[18:23:40][Step 1/5] Downloading args 0.13.7...
[18:23:40][Step 1/5] Downloading async 1.13.3...
[18:23:40][Step 1/5] Downloading barback 0.15.2+13...
[18:23:40][Step 1/5] Downloading browser 0.10.0+2...
[18:23:44][Step 1/5] Got dependencies!
[18:23:44][Step 1/5] Precompiling dependencies...
[18:23:44][Step 1/5] Loading source assets...
[18:23:46][Step 1/5] Loading angular/transform/codegen and dart_to_js_script_rewriter transformers...
[18:23:46][Step 1/5] Transformer library "package:angular/transform/codegen.dart" not found.
[18:23:46][Step 1/5] Process exited with code 0

There is a first problem:

Transformer library "package:angular/transform/codegen.dart" not found.

Next I try to buld:

pub build

And have error:

[Step 3/5] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script7686521311233408238.cmd
[18:23:46][Step 3/5] in directory: C:\TeamCity\buildAgent\work\4213686b1a2fc1c1\Soy.Warehouse.UI
[18:23:47][Step 3/5] Loading source assets...
[18:23:48][Step 3/5] Loading dart_to_js_script_rewriter and angular/transform/codegen transformers...
[18:23:49][Step 3/5] Unable to spawn isolate: Unhandled exception:
[18:23:49][Step 3/5] Could not import "package:$pub/transformer_isolate.dart" from "file:///C:/TeamCity/buildAgent/temp/buildTmp/pub_ac2ee8da-d521-11e7-80de-0050568337f8/runInIsolate.dart": Failure getting http://localhost:58353/packages/$pub/transformer_isolate.dart:
[18:23:49][Step 3/5]   504 Gateway Timeout
[18:23:49][Step 3/5] null
[18:23:49][Step 3/5] Process exited with code 1
[18:23:49][Step 3/5] Process exited with code 1
[18:23:49][Step 3/5] Step dart build (Command Line) failed

What I do wrong? How to build dart project in teamcity?

pubspec.yaml:

environment:
  sdk: '>=1.24.0 <2.0.0'

dependencies:
  angular: "4.0.0-alpha"
  angular_components: "^0.6.0-alpha"
  http: ^0.11.3+14
  uuid: ^0.5.3
  stream_transformers: ^0.3.0

dev_dependencies:
  browser: '^0.10.0+2'
  dart_to_js_script_rewriter: ^1.0.3

transformers:
- angular:
    entry_points:
    - web/main.dart
    - web_test/main.dart
- $dart2js:
    commandLineOptions: [--show-package-warnings]
- dart_to_js_script_rewriter

web:
  compiler:
    debug: dartdevc
2
Does it work eithout teamcity? What Angular version? What does the transformers section in pubspec.yaml look like?Günter Zöchbauer
Yes, it work without teamcity. angular: "4.0.0-alpha". Added pubspec.yaml.Cododoc

2 Answers

1
votes

The problem in the proxy setup.

set https_proxy=http://myproxyaddress

In a build process pub try to connect to localhost (I think) thro the proxy server. We need to declare no_proxy in system environment or in build / get steps like:

set no_proxy=localhost,127.0.0.0/8, <corporate addresses>

I changed step 1 to:

set https_proxy=http://myproxyaddress
set no_proxy=localhost,127.0.0.0/8, <corporate addresses>
pub get

And step 2 to:

set no_proxy=localhost,127.0.0.0/8, <corporate addresses>
pub build
0
votes

First I'd suggest to use 4.0.0 (final) instead of 4.0.0-alpha

Remove the codegen transformer in pubpsec.yaml.

The transformers sections should look like

transformers:
- sass_builder
- angular:
    entry_points: web/main.dart

See also https://github.com/dart-lang/angular_components_example/blob/master/pubspec.yaml