Why does Project.configure(SourceDirectorySet) not work?


(Christian Ciach) #1

Quick question:

  def lala = project.configure(objects.sourceDirectorySet('xproperties', 'xproperties')) {
    srcDirs = ['src/main/java']
    includes = ["**/*.properties"]
  }
  println lala.srcDirTrees

This prints the empty list: []

But without using configure(..), it works as expected:

def lala = project.objects.sourceDirectorySet('xproperties', 'xproperties')
lala.srcDirs = ['src/main/java']
lala.includes = ["**/*.properties"]
println lala.srcDirTrees

This prints: [directory '/../MyProject/src/main/java' include '**/*.properties']

I am clearly missing something, but what?