Mike Mitterer
Mike Mitterer

Reputation: 7180

Gradle "flattens" directory in war

build.gradle:

...

configurations {
    dartLibrary
}

dependencies {
   // Dart - web has a lot of subdirs... (packages and so forth)
   dartLibrary fileTree(dir: 'src/main/dart/web')
}

war {
   into('/') {
      from configurations.dartLibrary
   }
}

This copies all the files form src/main/dart/web into my war but the problem is that it "flattens" the structure. Means all files from web and its subdirs are merged into the / of my war.

Pls. help :-)

Upvotes: 0

Views: 149

Answers (1)

Peter Niederwieser
Peter Niederwieser

Reputation: 123900

Configurations are flat FileCollections. You need to remove the indirection (and can also leave out the call to fileTree):

war {
    from "src/main/dart/web"
}

Upvotes: 1

Related Questions