Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19859

Programmatically add resource folder to test compile/runtime classpath

$
0
0

Great, thanks for the suggestion. As it turns out, that’s exactly what I did, I just didn’t include the full context in my code snippet. Full context is:

subprojects{ proj ->
...
  proj.sourceSets {
    main {
      java {
        srcDirs = ['src']
      }
      resources {
        srcDirs = ['resources']
      }
    }
    def resdir = sprintf("%s\\resources", project(':Common').projectDir)
    test {
      java {
        srcDir 'test'
      }
      resources {
        srcDirs = ['test/testresources',resdir]
      }
    }
  }

Unfortunately, the dev team has already built a kingdom around using resources from one particular global “testing component” so I can’t resolve this by putting the resources in the conventional folder. I did change from allprojects to subprojects as you suggested but the resource path is still not showing up.


Viewing all articles
Browse latest Browse all 19859

Trending Articles