【问题标题】:How to copy a file to an empty directory through gradle如何通过gradle将文件复制到空目录
【发布时间】:2014-05-23 19:06:04
【问题描述】:

我正在编写一个 Javafx 应用程序,我必须在其中包含一个 fxml 文件以从源代码复制到构建目录。这是我的任务。

task copyRequiredFiles(type: Copy) {
    from '/src/com/indywiz/game/ui/view/Game2048.fxml'
    into 'build/classes/main/com/indywiz/game/ui'
}

task (runui, dependsOn: ['classes', 'copyRequiredFiles'], type: JavaExec) {

    main = 'com.indywiz.game.ui.Main'
    classpath = sourceSets.main.runtimeClasspath
}

如果我运行 runui 任务,我会得到Skipping task ':copy Required Files' as it has no source files.

出了什么问题?如果您需要更多信息,请告诉我。

下面是我的文件夹结构:

【问题讨论】:

    标签: javafx gradle build.gradle


    【解决方案1】:

    您为 from 提供了绝对部分,但它必须是相对路径(即没有前导 /)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-22
      • 1970-01-01
      • 2013-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多