Closed serpro69 closed 6 months ago
From https://github.com/serpro69/kotlin-faker/commit/637498b781e1405f8cb2644ba603f73831d9f873 (release v2.0.0-rc.2
onwards), each kotlin-faker-*
module is versioned separately (ref: #225), and released only when the corresponding submodule has changes between last version and next release. This means that at a given time kotlin-faker-books:2.1.0
and kotlin-faker-tvshows:2.3.0
might be latest versions, respectively, while koltin-faker
could also be a different version (minor and patch only!)
2.0.0
, all the submodules should compatible with the same major version of "core" kotlin-faker
library, meaning that e.g. it should be possible to use kotlin-faker:2.\d+.\d+
with kotlin-faker-tvshows:2.3.0
and kotlin-faker-books:2.1.0
, and so on.
This issue describes breaking changes that are coming in the next major version of kotlin-faker for easier migration.
Multi-Faker Implementation
Currently, the most notable change is described in #217 and implemented in #219 , which can break compilation for many calls to
Faker
.In short, if you've been using a lot of different data providers from
Faker
, it is likely that some of them won't be there anymore in the "core faker" implementation. This includes data providers in the domains like books, tv shows, movies, music, sports and many others.To keep using those, you will need to add one or more extra fakers via new dependencies and fix the imports and add new faker objects to access those providers.
Below is the list of all available fakers' dependencies (note that the default faker is needed for others to work as they won't pull it as a transitive dependency):
If you have been using
faker {}
dsl function to create instances ofFaker
, each faker implementation also has such a function with the same name. Mind the package names though if using multiple ones in the same file.Below is a simple example of using all the available fakers: