gradle-native icon indicating copy to clipboard operation
gradle-native copied to clipboard

Demonstrate how to create ad-hoc variant of native component

Open lacasseio opened this issue 5 years ago • 2 comments

There are a lot of different ways to create variant of a component in native and not all of them comes in pairs (debug/release). We also don't want to provide "easy" escape hatch that would prevent the native plugins from evolving toward a simple and clean DSL. However, the reality is many use cases requires complex wiring that ah-hoc variant would help solve in a cleaner fashion than fighting with the current modeling to accomplish. It would be more like using the current plugin and add your custom variant side-by-side while reusing the model when needed.

The ad-hoc aspect and custom wiring is all about showing how the internal of the native plugins is done using strictly public APIs and without modeling. It would be similar to how you can create a custom JavaCompile with your own configuration instead of using the source set container.

lacasseio avatar Nov 25 '19 19:11 lacasseio

The most internal API that may be required to use is the tool chain selection API. However, the ah-hoc variant could be reacting to the presence of certain other variant hence skipping the tool chain selection and using the one that is selected for each tasks.

lacasseio avatar Nov 25 '19 19:11 lacasseio

is #1054 related to this?

HarrisDePerceptron avatar Nov 26 '19 05:11 HarrisDePerceptron