0

谁能告诉我为什么我的复制任务不起作用,我在这里看到了一些类似的问题,但没有一个提供灵魂...

    def outputJar = "${buildDir}/intermediates/jar"

// Define some tasks which are used in the build process
task copyCompiledClasses(type: Copy, dependsOn: 'assemble') {
    // get directory for current namespace
    println "Copy compiled classes..."
    mkdir Paths.get(outputJar,'classes')
    mkdir Paths.get(outputJar,'bin')
    from fileTree(dir: 'build/intermediates/javac/debug/classes/', exclude : '**/BuildConfig.class')
    into outputJar+'/classes'
}

源文件夹中有类,并且正在创建我的目标文件夹,但实际复制没有发生!!!!呸呸呸!

4

1 回答 1

0

认为源规范是错误的。

task copyCompiledClasses(type: Copy, dependsOn: assemble) {
    def outputDir = "${buildDir}/intermediates/jar"
    mkdir "${outputDir}/classes"
    mkdir "${outputDir}/bin"
    from fileTree("${buildDir}/intermediates/javac/debug/classes") {
        include '**/*'
        exclude '**/BuildConfig.class'
    }
    into "${outputDir}/classes"
}
于 2020-06-17T00:37:46.780 回答