eastwater
eastwater

Reputation: 5620

gradle remove main source set

src
  main/java
  test/java

The test does not depend on main for compiling. Tying to compile and run test on another library replacing main.

sourceSets {
   remove main
}

gradle test 

It will always compile the main source set.

Upvotes: 1

Views: 3078

Answers (1)

patrungel
patrungel

Reputation: 841

You can try sourceSets.remove(sourceSets.main)

as sourcesets {} delegates to https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/SourceSetContainer.html

Upvotes: 2

Related Questions