您如何在 Gradle Liquibase 插件的 runList 字段中包含多个活动?

Dav*_*ave 2 testing plugins liquibase gradle

我在带有 Java 8 的 Mac Yosemite 上使用 Gradle 2.7。我正在使用 Liquibase 1.1.1 插件并想用它来做一些活动(构建一个测试数据库并构建我的普通数据库)。所以我有

liquibase {
  activities {
    main {
      File propsFile = new File("${project.rootDir}/src/main/resources/liquibase.properties")
      Properties properties = new Properties()
      properties.load(new FileInputStream(propsFile))
      changeLogFile 'src/main/resources/db.changelog-master.xml'
      url properties['url']
      username properties['username']
      password properties['password']
    }
    test {
        url 'jdbc:h2:file:target/testdb'
        username 'sa'
    }
    runList = (
        "test"
        "main"
    )
  }
}
Run Code Online (Sandbox Code Playgroud)

但我无法弄清楚 runList 的正确语法。运行上述程序时出现错误...

* Where:
Build file '/Users/myuser/Dropbox/cb_workspace/cbmyproject/build.gradle' line: 163

* What went wrong:
Could not compile build file '/Users/myuser/Dropbox/cb_workspace/cbmyproject/build.gradle'.
> startup failed:
  build file '/Users/myuser/Dropbox/cb_workspace/cbmyproject/build.gradle': 163: expecting ')', found 'main' @ line 163, column 2.
        "main"  
      ^

  1 error


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
Run Code Online (Sandbox Code Playgroud)

Nao*_*aoj 5

根据其中一个示例,runList必须放在活动块之后:

liquibase {
  activities {
    main {
      File propsFile = new File("${project.rootDir}/src/main/resources/liquibase.properties")
      Properties properties = new Properties()
      properties.load(new FileInputStream(propsFile))
      changeLogFile 'src/main/resources/db.changelog-master.xml'
      url properties['url']
      username properties['username']
      password properties['password']
    }
    test {
        url 'jdbc:h2:file:target/testdb'
        username 'sa'
    }
  }

  runList = 'test, main'
}
Run Code Online (Sandbox Code Playgroud)

请参阅此处的示例。

希望这可以帮助。