0

I am trying to make it so I can create a version of my java program where a paid flag is on in one build, and a free flag is on in the other using kotlin gradle.

I have tried to do this so far by splitting most of my program into a common subrepo, and then creating two new repos paid and free. Ideally, I want to be able to compile free and have it include all the contents of common in the resulting jar (including its libraries) as well as have the class I have defined in free override the corresponding class in common. (this has had various failed results, due to not including all the contents in the jar)

Any help would be much appreciated.

Xemor
  • 1
  • 1
  • 1
    You don't need multiple repositories, you can do what you want in a single project with [product flavors](https://developer.android.com/studio/build/build-variants#product-flavors). – gpunto Mar 10 '23 at 21:42
  • @gpunto How do you use product flavors on a project that isn't android development? I can't see any examples on the internet – Xemor Mar 12 '23 at 10:44
  • My bad, I assumed it was an Android project. Maybe check if similar questions like [this one](https://stackoverflow.com/questions/40659986/maven-profiles-equivalent-of-gradle) or [this one](https://stackoverflow.com/questions/34604986/equivalent-to-product-flavors-in-non-android-gradle) fit your use case. – gpunto Mar 12 '23 at 11:13

0 Answers0