SourceryForRetrofire is a tool used to provide annotations similar to Java/Kotlin and is just a modified version of Sourcery from Krzysztof Zabłocki. Even if this library can be used on its own, this usage is HEAVILY DISCOURAGED! Use the official Sourcery if you need to generate some boilerplate! This library has been created with the only purpose of creating RetrofireSwift, a type-safe HTTP client for Swift, inspired by Retrofit.
Right now the only official way to install this library is by using CocoaPods; you can of course build the binary on your own or download the prebuilt one from GitHub (which should always be aligned) but I won't be able to help you in case of any issue.
-
Add
pod 'SourceryForRetrofire'
to yourPodfile
and runpod update SourceryForRetrofire
. This will download the latest release binary and will put it in your project's CocoaPods path so you will run it with$PODS_ROOT/SourceryForRetrofire/bin/sourcery
Since this project uses Sourcery plus a couple of lines you can refer to the official Sourcery documentation here.
Usage is the same of sourcery, so you can refer to its docs;
$ $PODS_ROOT/SourceryForRetrofire/sourcery --sources <sources path> --templates <templates path> --output <output path>
Note for the future me:
- Download the project
- Edit whatever you need to edit
- Set the version in the Xcode project and in the SourceryForRetrofire.podspec file
- Run
rake release:new_sfr
and enjoy
SourceryForRetrofire is available under the MIT license. See LICENSE for more information.
This tool is powered by
- SourceKitten by JP Simard
- Stencil and few other libs by Kyle Fuller
- Sourcery by Krzysztof Zabłocki