Haha TTpro
Haha TTpro

Reputation: 5566

Gradle how to build extra source sourceSets?

I ask the command to build class in extra part of source set.

Here is the build.gradle in question.

// Configure build targets
sourceSets {
  main {
    java.srcDirs = ['src/' ]
    resources.srcDirs = ['resources/']
  }
  test {
    java.srcDirs = ['test/']
    resources.srcDirs = ['test-resources/','src-cc']
  }
  extra {
    java.srcDirs = ['src-extra/']
    resources.srcDirs = ['resources/']
  }
}

I need class that in src-extra. However, run gradle installDist produce a jar in build/libs that does not contain any class in src-extra.

How should I get to build those extra class ? Which command I should type in my Terminal in order to build those source code in src-extra.

Upvotes: 2

Views: 4161

Answers (1)

Haha TTpro
Haha TTpro

Reputation: 5566

Use gradle task --all to list all task.

You may see:

compileExtraJava - Compiles extra Java source.

So, the command to build extra is

 gradle compileExtraJava

Upvotes: 1

Related Questions