Add Travis Badge
Generates Swift NSManagedObject subclasses.
Why is it better than Xcode generation?
Why is it better than Mogenerator?
Additionally it allows to generate one file for whole model, e.g. you need list of entity names
Install MotoSwift by downloading MotoSwift.pkg from the latest GitHub release and running it.
From sources.
Clone or download project.
Run make install
make install
If you need all components in one folder run make bundle. Now you can copy whole motoswift folder, and run motoswift/bin/motoswift from any place
make bundle
motoswift
motoswift/bin/motoswift
motoswift human [OPTIONS] MODEL_PATH - generate human code for your model. Does not overwrite file, if file already exists
Options:
motoswift machine [OPTIONS] MODEL_PATH - generate machine code for your model. Overwrites file every time
motoswift model [OPTIONS] MODEL_PATH - generate code for your model
motoswift human --template ./Templates/xcode/class.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataClass.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
motoswift machine --template ./Templates/xcode/properties.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataProperties.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Xcode
motoswift human --template ./Templates/mogenerator/human.stencil --output ./SampleOutput/Mogenerator/Human --file-mask "{{class}}.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Mogenerator/Human
motoswift machine --template ./Templates/mogenerator/machine.stencil --output ./SampleOutput/Mogenerator/Machine --file-mask "_{{class}}.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Mogenerator/Machine
motoswift model --template ./Templates/model.stencil --output ./SampleOutput/Model/Model.swift ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Model/Model.swift
make test
make .package
MotoSwift uses Stencil as template language
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
MotoSwift. Managed Objects to Swift.
Generates Swift NSManagedObject subclasses.
Benefits
Why is it better than Xcode generation?
Why is it better than Mogenerator?
Additionally it allows to generate one file for whole model, e.g. you need list of entity names
Installation
Install MotoSwift by downloading MotoSwift.pkg from the latest GitHub release and running it.
From sources.
Clone or download project.
Run
make install
If you need all components in one folder run
make bundle
. Now you can copy wholemotoswift
folder, and runmotoswift/bin/motoswift
from any placeUsage
motoswift human [OPTIONS] MODEL_PATH - generate human code for your model. Does not overwrite file, if file already exists
Options:
motoswift machine [OPTIONS] MODEL_PATH - generate machine code for your model. Overwrites file every time
Options:
motoswift model [OPTIONS] MODEL_PATH - generate code for your model
Options:
Examples
motoswift human --template ./Templates/xcode/class.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataClass.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
motoswift machine --template ./Templates/xcode/properties.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataProperties.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Xcode
motoswift human --template ./Templates/mogenerator/human.stencil --output ./SampleOutput/Mogenerator/Human --file-mask "{{class}}.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Mogenerator/Human
motoswift machine --template ./Templates/mogenerator/machine.stencil --output ./SampleOutput/Mogenerator/Machine --file-mask "_{{class}}.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Mogenerator/Machine
motoswift model --template ./Templates/model.stencil --output ./SampleOutput/Model/Model.swift ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Model/Model.swift
Tests
make test
Releasing
make .package
Additional documentation
MotoSwift uses Stencil as template language