How to reference another sourceDirectorySet from a sourceDirectorySet?

(now_feel) #1

I’m using gradle 1.11

sourceSets {
    sourceSetA {
         java {
            srcDir 'src/ui/src'
            exclude 'org/test/ui/'
            exclude 'org/test/ui/'
            exclude 'org/test/ui/core/'
    main {
        manifest.srcFile 'src/myPackage/app/AndroidManifest.xml'
        java {
            srcDir 'src/myPackage/app/src'
            srcDir 'src/myPackage/content/java'
            srcDir 'src/myPackage/base/ui/java'
            srcDir 'src/myPackage/components/java'
            // I want to reference sourceDirectorySet in sourceSet A

I saw

source SourceDirectorySet source(SourceDirectorySet source)

Adds the given source to this set. Parameters:source - The source to add.Returns:this

when i build by ‘gradle build’ i got an error like below

  • Where: Build file ‘/home/myaccout/myPackage/build.gradle’ line: xxx

  • What went wrong: A problem occurred evaluating root project ‘myPackage’. > Could not find method source() for arguments on source set main.