Skip to content

Commit 60f50cf

Browse files
committed
Merge master
2 parents fed2f72 + e6bf1f5 commit 60f50cf

File tree

58 files changed

+450
-497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+450
-497
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.user
99
*.userosscache
1010
*.sln.docstates
11+
*.vs/
1112

1213
# Build results
1314
**/[Dd]ebug/

.nuget/packages.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="xunit.runners" version="1.9.2" />
4-
</packages>
4+
</packages>
5+
6+

GraphODataTemplateWriter.sln

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25123.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{6ACF6CEE-A594-4DFE-9286-C7154E91738B}"
77
ProjectSection(SolutionItems) = preProject
@@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{6ACF6C
1212
EndProject
1313
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphODataTemplateWriter", "src\GraphODataTemplateWriter\GraphODataTemplateWriter.csproj", "{E6B5202F-4F66-428A-AB92-0AAA11BA81DE}"
1414
EndProject
15+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Templates", "Templates\Templates.csproj", "{5F526973-F69E-4C26-B8AD-612590A17A9E}"
16+
EndProject
1517
Global
1618
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1719
Debug|Any CPU = Debug|Any CPU
@@ -22,6 +24,8 @@ Global
2224
{E6B5202F-4F66-428A-AB92-0AAA11BA81DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
2325
{E6B5202F-4F66-428A-AB92-0AAA11BA81DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
2426
{E6B5202F-4F66-428A-AB92-0AAA11BA81DE}.Release|Any CPU.Build.0 = Release|Any CPU
27+
{5F526973-F69E-4C26-B8AD-612590A17A9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28+
{5F526973-F69E-4C26-B8AD-612590A17A9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
2529
EndGlobalSection
2630
GlobalSection(SolutionProperties) = preSolution
2731
HideSolutionNode = FALSE

LICENSE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2222
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2323
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2424
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25-
SOFTWARE.
25+
SOFTWARE.
26+
27+

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ The type of template.
109109
To set the name of the template using the `Name` format string. You can insert `<Class>`, `<Property>`, `<Method>`, and `<Container>` the values will be replaced by the names of the corresponding object. If you insert an item that doesn't exist it will be replaced with an empty string.
110110
Note: You can also set the template name from inside the template by : `host.SetTemplateName("foo");`
111111

112+
#### Template Editing
113+
114+
The solution contains a non-building project to host the actual T4 templates and make browsing/editing them easier. New template files will be automatically discovered by this project.
115+
112116
#### Includes/Excludes
113117

114118
There may be specific times when you want to exclude or only process certain objects from the SubProcessor. To Do this you can either set a semicolon delimited list of objects you wanted to include : `Include : foo;bar`. This will only process objects whose names are foo or bar. The opposite of this is the exclude setting where the SubProcessor will include all objects except for those whose names are in the exclude list, exclude and include can not be used together.

Templates/Android/BaseModel.template.tt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
if (c is OdcmMethod) {
2020
return ((OdcmMethod)c).Class.Name.ToUpperFirstChar() + c.Name.Substring(c.Name.IndexOf(".") + 1).ToUpperFirstChar();
2121
} else if (c is OdcmProperty && c.AsOdcmProperty().IsCollection) {
22-
return c.AsOdcmProperty().Type.Name.ToUpperFirstChar();
23-
} else if (c is OdcmProperty && c.AsOdcmProperty().Type is OdcmPrimitiveType) {
24-
return ClassTypeName(c) + c.AsOdcmProperty().Type.Name.ToUpperFirstChar();
22+
return c.AsOdcmProperty().Projection.Type.Name.ToUpperFirstChar();
23+
} else if (c is OdcmProperty && c.AsOdcmProperty().Projection.Type is OdcmPrimitiveType) {
24+
return ClassTypeName(c) + c.AsOdcmProperty().Projection.Type.Name.ToUpperFirstChar();
2525
} else if (c is OdcmProperty) {
26-
return c.AsOdcmProperty().Type.Name.ToUpperFirstChar();
26+
return c.AsOdcmProperty().Projection.Type.Name.ToUpperFirstChar();
2727
}
2828
return c.Name.ToUpperFirstChar();
2929
}
@@ -394,7 +394,7 @@
394394
if (c is OdcmMethod) {
395395
return c.AsOdcmMethod().Class.Name.ToUpperFirstChar();
396396
} else if (c is OdcmProperty && c.AsOdcmProperty().Class is OdcmServiceClass) {
397-
return c.AsOdcmProperty().Type.Name.ToUpperFirstChar();
397+
return c.AsOdcmProperty().Projection.Type.Name.ToUpperFirstChar();
398398
} else if (c is OdcmProperty) {
399399
return c.AsOdcmProperty().Class.Name.ToUpperFirstChar();
400400
}
@@ -584,7 +584,7 @@ public {1} {2}{3}{4} {{";
584584

585585
";
586586

587-
foreach (var property in properties.Where(p => !p.Type.Name.Equals("Stream")))
587+
foreach (var property in properties.Where(p => !p.Projection.Type.Name.Equals("Stream")))
588588
{
589589
var propertyName = property.Name.ToUpperFirstChar();
590590
var propertyType = "";

Templates/Android/generated/BaseClient.java.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ foreach (var prop in model.EntityContainer.Properties)
6565
/**
6666
* Gets <#=TypeRequestBuilder(c)#>.
6767
*
68-
* @return the <#=prop.Type.GetTypeString()#>.
68+
* @return the <#=prop.Projection.Type.GetTypeString()#>.
6969
*/
7070
public <#=ITypeRequestBuilder(prop)#> get<#=propertyName#>() {
7171
return new <#=TypeRequestBuilder(prop)#>(getServiceRoot() + "/<#=prop.Name#>", (<#=IClientType(c)#>)this, null);

Templates/Android/generated/BaseEntityStreamRequestBuilder.java.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if (c.AsOdcmClass() != null)
8989
#>
9090

9191
<#
92-
foreach (var prop in c.AsOdcmClass().Properties.Where(x => x.Type is OdcmMediaClass))
92+
foreach (var prop in c.AsOdcmClass().Properties.Where(x => x.Projection.Type is OdcmMediaClass))
9393
{
9494
var propName = prop.Name.ToCheckedCase();
9595
#>

Templates/Android/generated/IBaseClient.java.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ foreach (var prop in model.EntityContainer.Properties)
3838
/**
3939
* Gets <#=TypeRequestBuilder(c)#>.
4040
*
41-
* @return the <#=prop.Type.GetTypeString()#>.
41+
* @return the <#=prop.Projection.Type.GetTypeString()#>.
4242
*/
4343
<#=ITypeRequestBuilder(prop)#> get<#=propertyName#>();
4444
<#

Templates/Android/generated/IBaseEntityStreamRequestBuilder.java.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if (c.AsOdcmClass() != null)
6565
#>
6666

6767
<#
68-
foreach (var prop in c.AsOdcmClass().Properties.Where(x => x.Type is OdcmMediaClass))
68+
foreach (var prop in c.AsOdcmClass().Properties.Where(x => x.Projection.Type is OdcmMediaClass))
6969
{
7070
var propName = prop.Name.ToCheckedCase();
7171
#>

0 commit comments

Comments
 (0)