VIPR T4 Template Writer
Source code writers for VIPR utilizing T4 templates. The T4TemplateWriter receives an OdcmModel from VIPR and uses it to fill in a T4 template.
Currently the following target languages are supported by this writer:
- Java for JVM
- Objective-C for iOS
This project uses git submodules to integrate upstream dependencies, specifically Vipr. This repo will point to msopentech/vipr/int-msot by default; if you need an alternate branch to include special fixes you'll need to check that out manually within the submodule.
For the solution to open properly, ensure submodules are updated before opening it in Visual Studio. When initially cloning this repo, use
git clone --recursive to update submodules at the same time. Later, run
git submodule update to manually update submodules. If you don't use the
--recursive switch when cloning, run
git submodule init first to initialize the submodule.
Once setup is complete, you can work with the vipr-t4templatewriter solution as usual. If you encounter problems, make sure NuGet packages and project references are all up-to-date.
Note: We will consider integrating Vipr via public NuGet packages when these become available.
For more information on submodules read this chapter from the Git book and search the Web.
Using Vipr with this Writer
- Build the solution in Visual Studio.
- Go to the
src\T4TemplateWriter\bin\debugfolder to find all compiled components.
- In that folder, modify
.config\TemplateWriterSettings.jsonto specify target language - either "java" or "objectivec".
- Open a command prompt as administrator in the same folder and run
Vipr.exe <path-or-url-to-metdata> --writer="T4TemplateWriter".
By default, output source code will be put in a folder named "output" next to the Vipr executable.
Using generated code
Generated code depends on an underlying HTTP client and other services. These are available for Android and JVM (odata-engine-core, odata-engine-android-impl, odata-engine-jvm-impl) and iOS (office365_odata_base)
Before we can accept your pull request, you'll need to electronically complete Microsoft Open Tech's Contributor License Agreement. If you've done this for other Microsoft Open Tech projects, then you're already covered.
Why a CLA? (from the FSF)
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the MIT license.