0

我想从 sourceSets 中排除具体文件,但我的代码不起作用:

  for (module in subprojects) {
    sourceSets module.sourceSets.main
  }

  sourceSets[0].allSource.excludes = ['/media/machine/hdd/learnGradle/learn10/src/main/java/com/self/api/Application.java']

  println(sourceSets[0].allSource.excludes)

  sourceSets[0].allSource.each {
    println(it)
  }

2个 println() 方法后的结果:

[/media/machine/hdd/learnGradle/learn10/src/main/java/com/self/api/Application.java]
/media/machine/hdd/learnGradle/learn10/src/main/java/com/self/api/Application.java

怎么了?

4

0 回答 0