我在哪里指定gradle要求的appIdproperty?

时间:2014-04-22 21:47:53

标签: android google-app-engine android-gradle build.gradle

我正在开发一个使用appengine作为后端的应用。我想使用gradle的命令行下载我的应用程序的后端服务器端代码。

我在命令提示符下键入gradlew appengineDownloadApp,这就是我得到的

  

失败:构建因异常而失败。

     
      
  • 出了什么问题:   在任务配置中发现了一个问题:app_server:appengineDownloadApp'。   没有为属性' appId'指定任何值。

  •   

我在哪里输入appId?我假设这是我的appengine帐户的项目ID,但我不确定在gradle中读取它的位置。

1 个答案:

答案 0 :(得分:2)

我一直在寻找答案,最后到了https://github.com/GoogleCloudPlatform/gradle-appengine-plugin#convention-properties页面:

The task appengineDownloadApp requires you to at least define the application ID and directory to write the files to. Define the tasks properties in the closure app:
  - id: The application ID.
  - version: The current application version (defaults to current default version).
  - outputDirectory: The directory where you wish to save the files (defaults to build/downloaded-app).

所以该物业" appId"在错误消息中有点误导......如插件自述文件中所述,您只需要添加到build.gradle:

appengine {
    app {
        id = 'your-app-id'
    }
}