# Build the same source tree using different plugins

**URL:** <https://discuss.gradle.org/t/build-the-same-source-tree-using-different-plugins/19548>\
**Category:** Help/Discuss\
**Created:** [September 15, 2016, 6:37am UTC](https://discuss.gradle.org/t/build-the-same-source-tree-using-different-plugins/19548 "2016-09-15T06:37:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ytai](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ytai/32/2469_2.png) [@ytai](https://discuss.gradle.org/u/ytai)\
**Post date:** [September 15, 2016, 6:37am UTC](https://discuss.gradle.org/t/build-the-same-source-tree-using-different-plugins/19548/1 "2016-09-15T06:37:27Z")

</div>

(Likely a n00b question, appreciate your patience!)

I’ve written a Java library that depends on a third party library (opencv), which is available for both Android and PC.  
I would like to make my library usable by either Android or PC (i.e. produce different artifacts depending on the circumstances). However, I cannot simply apply both the ‘com.android.library’ and the ‘java’ plugins and furthermore it is not clear to me how I can specify that the different artifacts (android/PC) depend on different variants of opencv.  
Seems like this should be a common enough problem. What is the best practice for doing something like that?

Thanks!
