0

我正在将应用程序迁移到 Dart 2 和 AngularDart 5。我曾经使用“pub build”(SDK 的一部分)在 Jenkins 服务器上构建应用程序。我在项目中包含了 3 个 SDK(Windows、Mac 和 Linux 各一个),并且能够使用 Maven 独立构建操作系统(请参阅下面的 Maven 片段)。

这个工具现在被替换了,我被告知要使用 webdev。该工具在我的笔记本电脑上运行良好,但我不确定如何以独立于操作系统的方式使用它。欢迎任何想法!

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.5.0</version>
  <executions>
    <execution>
      <id>get</id>
      <phase>initialize</phase>
      <goals>
        <goal>exec</goal>
      </goals>
      <configuration>
        <executable>${dart.bin}</executable>
        <commandlineArgs>get</commandlineArgs>
      <workingDirectory>${project.basedir}/src/main/dart/</workingDirectory>
        <environmentVariables>
          <PUB_CACHE>${project.build.directory}/pub-cache</PUB_CACHE>
        </environmentVariables>
      </configuration>
    </execution>
    <execution>
      <id>build</id>
      <phase>compile</phase>
      <goals>
        <goal>exec</goal>
      </goals>
      <configuration>
        <executable>${dart.bin}</executable>
        <commandlineArgs>build --output="${project.build.directory}/webapp" </commandlineArgs>
         <workingDirectory>${project.basedir}/src/main/dart</workingDirectory>
        <environmentVariables>
          <PUB_CACHE>${project.build.directory}/pub-cache</PUB_CACHE>
        </environmentVariables>
      </configuration>
    </execution>
  </executions>
</plugin>

4

1 回答 1

1

webdev工具只是一个带有“二进制”(名为webdev)的 Dart 项目。从 pub 获取它:https ://pub.dartlang.org/packages/webdev

$ pub global activate webdev

如果你安装了 Dart,那么你就可以运行webdev.

于 2018-08-13T20:50:04.083 回答