icerockdev / moko-network

Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev
Apache License 2.0
151 stars 29 forks source link

Allow controlling to which sourceSet(s) the generated code is added #71

Closed dalewking closed 3 years ago

dalewking commented 3 years ago

The plugin automatically adds the generated source code as a srcDir to the commonMain sourceSet. For simple projects, that may be the only common sourceSet you have, but we are investigating dividing our code into sourceSets to enforce visibility along clean architecture lines and will not want the code added to the commonMain sourceSet and would like to instead use a different sourceSet. It would be nice to be able to specify that to the plugin.

Our alternative is to generate to a separate module, which is what we currently do.

Alex009 commented 3 years ago

https://github.com/icerockdev/moko-network/blob/e7398e841b768c9eeaa1f2d7027b86209638b381/network-generator/src/main/kotlin/dev/icerock/moko/network/MultiPlatformNetworkGeneratorDeprecatedPlugin.kt#L27

https://github.com/icerockdev/moko-network/blob/e7398e841b768c9eeaa1f2d7027b86209638b381/network-generator/src/main/kotlin/dev/icerock/moko/network/MultiPlatformNetworkGeneratorPlugin.kt#L28

source set name should be used here

Alex009 commented 3 years ago

will be available in 0.11.0