Merge pull request #151 from microsoft/versionStamping

Version stamping
This commit is contained in:
Alexander Sklar 2021-11-07 13:00:22 -08:00 коммит произвёл GitHub
Родитель 034cf1904e 2390a5794a
Коммит 45a12c5843
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
32 изменённых файлов: 778 добавлений и 111 удалений

Просмотреть файл

@ -1,7 +0,0 @@
{
"type": "patch",
"comment": "Introduce MenuFlyoutPriority",
"packageName": "react-native-xaml",
"email": "asklar@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"profiles": {
"Codegen": {
"commandName": "Project",
"commandLineArgs": "-verbose -winmd ..\\..\\..\\..\\..\\example\\windows\\packages\\Microsoft.UI.Xaml.2.6.0\\lib\\uap10.0\\Microsoft.UI.Xaml.winmd"
}
}
}

Просмотреть файл

@ -1,6 +1,36 @@
{
"name": "react-native-xaml",
"entries": [
{
"date": "Fri, 05 Nov 2021 22:29:53 GMT",
"tag": "react-native-xaml_v0.0.50",
"version": "0.0.50",
"comments": {
"patch": [
{
"author": "asklar@microsoft.com",
"package": "react-native-xaml",
"commit": "2708706eb210e395c5681016f518ef66e2e23a6b",
"comment": "Include version information in the DLL"
}
]
}
},
{
"date": "Fri, 05 Nov 2021 17:42:39 GMT",
"tag": "react-native-xaml_v0.0.49",
"version": "0.0.49",
"comments": {
"patch": [
{
"author": "asklar@microsoft.com",
"package": "react-native-xaml",
"commit": "7c1e9025625f1901c3c60952a644f2b19a4a4083",
"comment": "Introduce MenuFlyoutPriority"
}
]
}
},
{
"date": "Fri, 05 Nov 2021 16:43:47 GMT",
"tag": "react-native-xaml_v0.0.48",

Просмотреть файл

@ -1,9 +1,25 @@
# Change Log - react-native-xaml
This log was last generated on Fri, 05 Nov 2021 16:43:47 GMT and should not be manually modified.
This log was last generated on Fri, 05 Nov 2021 22:29:53 GMT and should not be manually modified.
<!-- Start content -->
## 0.0.50
Fri, 05 Nov 2021 22:29:53 GMT
### Patches
- Include version information in the DLL (asklar@microsoft.com)
## 0.0.49
Fri, 05 Nov 2021 17:42:39 GMT
### Patches
- Introduce MenuFlyoutPriority (asklar@microsoft.com)
## 0.0.48
Fri, 05 Nov 2021 16:43:47 GMT

Просмотреть файл

@ -74,6 +74,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>TSTypes.tt</DependentUpon>
</Compile>
<Compile Update="VersionHeader.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>VersionHeader.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@ -109,6 +114,10 @@
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TSTypes.cs</LastGenOutput>
</None>
<None Update="VersionHeader.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>VersionHeader.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,4 +1,5 @@
using MiddleweightReflection;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@ -131,5 +132,10 @@ namespace Codegen
public ViewManagerPropertyType VM { get; set; }
public string TS { get; set; }
}
public partial class VersionHeader
{
public Version Version { get; set; }
}
}

Просмотреть файл

@ -25,7 +25,7 @@ namespace Codegen
return context.GetType(type).GetProperties().First(x => x.GetName() == prop);
}
private void DumpTypes()
private void DumpTypes(Version version)
{
var start = DateTime.Now;
Config = JsonDocument.Parse(File.ReadAllText(ConfigFileName), new JsonDocumentOptions() { AllowTrailingCommas = true, CommentHandling = JsonCommentHandling.Skip });
@ -344,6 +344,7 @@ namespace Codegen
var tsEnumsGen = new TSEnums().TransformText();
var eventsGen = new TypeEvents(events, syntheticEvents).TransformText();
var eventPropsGen = new EventArgsTypeProperties(eventArgProps).TransformText();
var versionGen = new VersionHeader() { Version = version }.TransformText();
PrintVerbose("Updating files");
if (!Directory.Exists(generatedDirPath))
@ -356,6 +357,8 @@ namespace Codegen
UpdateFile(Path.Join(generatedDirPath, "EventArgsTypeProperties.g.h"), eventPropsGen);
UpdateFile(Path.Join(generatedDirPath, "TypeEnums.g.h"), enumsGen);
UpdateFile(Path.Join(generatedDirPath, "Version.g.h"), versionGen);
UpdateFile(Path.Join(packageSrcPath, "Enums.ts"), tsEnumsGen);
UpdateFile(Path.Join(packageSrcPath, "Props.ts"), propsGen);
UpdateFile(Path.Join(packageSrcPath, "Types.tsx"), typesGen);
@ -580,7 +583,7 @@ namespace Codegen
throw new ArgumentException($"Unknown option {args[i]}");
}
}
p.DumpTypes();
p.DumpTypes(Version.Parse(version));
}
}
}

Просмотреть файл

@ -28,8 +28,11 @@ namespace Codegen
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n/*************************************************************\r\nTHIS FILE WAS A" +
"UTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************************" +
"******************************/\r\n\r\n");
#line 6 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 11 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var enumType in Util.enumsToGenerateConvertersFor) {
var ns = Util.GetTSNamespace(enumType);
if (ns != "") {
@ -38,118 +41,118 @@ if (ns != "") {
#line hidden
this.Write("export namespace ");
#line 9 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write("Enums {\r\n");
#line 10 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("export enum ");
#line 11 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(enumType)));
#line default
#line hidden
this.Write(" {\r\n");
#line 12 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var value in enumType.GetFields().Skip(1)) {
#line default
#line hidden
this.Write(" ");
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.GetName()));
#line default
#line hidden
this.Write(" = ");
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((int)value.GetConstantValue(out System.Reflection.Metadata.ConstantTypeCode typeCode)));
#line default
#line hidden
this.Write(",\r\n");
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("}\r\n");
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
if (ns != "") {
#line default
#line hidden
this.Write("}\r\n\r\n");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 23 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 24 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("\r\n\r\n");
#line 22 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 27 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var enumType in Util.fakeEnums) {
#line default
#line hidden
this.Write("export enum ");
#line 23 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 28 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumType.Name));
#line default
#line hidden
this.Write(" {\r\n");
#line 24 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 29 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var value in enumType.Values) {
#line default
#line hidden
this.Write(" ");
#line 25 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Key));
#line default
#line hidden
this.Write(" = ");
#line 25 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Value));
#line default
#line hidden
this.Write(",\r\n");
#line 26 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 31 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("}\r\n\r\n");
#line 29 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
#line 34 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default

Просмотреть файл

@ -3,6 +3,11 @@
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var enumType in Util.enumsToGenerateConvertersFor) {
var ns = Util.GetTSNamespace(enumType);
if (ns != "") { #>

Просмотреть файл

@ -18,7 +18,7 @@ namespace Codegen
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TSProps : TSPropsBase
{
@ -28,7 +28,12 @@ namespace Codegen
/// </summary>
public virtual string TransformText()
{
this.Write(@"import type { ViewProps, NativeSyntheticEvent, ColorValue } from 'react-native';
this.Write(@"
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type { ViewProps, NativeSyntheticEvent, ColorValue } from 'react-native';
import type * as Enums from './Enums';
export type Thickness = number | { left?: number, top?: number, right?: number, bottom?: number };
@ -39,14 +44,14 @@ export type CornerRadius = number | { topLeft?: number, topRight?: number, botto
");
#line 15 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
var derived = Util.GetDerivedTypes(Types);
foreach (var type in Types) {
#line default
#line hidden
#line 17 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 22 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
var ns = Util.GetTSNamespace(type);
if (ns != "") {
@ -54,35 +59,35 @@ if (ns != "") {
#line hidden
this.Write("export namespace Native");
#line 19 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 24 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(" {\r\n");
#line 20 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 25 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
#line default
#line hidden
this.Write("export interface Native");
#line 21 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 26 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props extends ");
#line 21 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 26 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetBaseClassProps(type)));
#line default
#line hidden
this.Write(" {\r\n");
#line 22 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 27 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
var typeProp = Util.GetJsTypeProperty(type, derived);
if (typeProp != "") {
@ -90,14 +95,14 @@ if (typeProp != "") {
#line hidden
this.Write(" type: ");
#line 24 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 29 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeProp));
#line default
#line hidden
this.Write(";\r\n");
#line 25 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
foreach (var prop in type.GetProperties().Where(p => Util.ShouldEmitPropertyMetadata(p))) {
@ -105,21 +110,21 @@ foreach (var prop in type.GetProperties().Where(p => Util.ShouldEmitPropertyMeta
#line hidden
this.Write(" ");
#line 27 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 32 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(prop)));
#line default
#line hidden
this.Write("?: ");
#line 27 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 32 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetTypeScriptType(prop)));
#line default
#line hidden
this.Write(";\r\n");
#line 28 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 33 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
foreach (var prop in FakeProps.Where(p => type == p.DeclaringType)) {
@ -127,21 +132,21 @@ foreach (var prop in FakeProps.Where(p => type == p.DeclaringType)) {
#line hidden
this.Write(" ");
#line 30 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 35 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(prop)));
#line default
#line hidden
this.Write("?: ");
#line 30 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 35 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetTypeScriptType(prop)));
#line default
#line hidden
this.Write("; // synthetic property\r\n");
#line 31 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 36 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) {
@ -149,28 +154,28 @@ foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) {
#line hidden
this.Write(" /**\r\n * ");
#line 34 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 39 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(prop.Comment));
#line default
#line hidden
this.Write("\r\n */\r\n ");
#line 36 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 41 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(prop.Name)));
#line default
#line hidden
this.Write("?: ");
#line 36 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 41 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetTypeScriptType(prop)));
#line default
#line hidden
this.Write("; // synthetic property\r\n");
#line 37 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 42 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
foreach (var attachedDP in Util.AttachedProperties.Where(p => Properties.Any(sp => sp.Property == p && sp.DeclaringType == type))) {
@ -178,21 +183,21 @@ foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) {
#line hidden
this.Write(" ");
#line 39 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 44 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(attachedDP)));
#line default
#line hidden
this.Write("?: ");
#line 39 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 44 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetTypeScriptType(attachedDP)));
#line default
#line hidden
this.Write("; // attached property\r\n");
#line 40 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 45 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
foreach (var evt in type.GetEvents()) {
@ -200,14 +205,14 @@ foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) {
#line hidden
this.Write(" on");
#line 42 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 47 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("?: (event: NativeSyntheticEvent<undefined>) => void;\r\n");
#line 43 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 48 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
foreach (var evt in SyntheticEvents.Where(e => type == e.DeclaringType)) {
@ -215,48 +220,48 @@ foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) {
#line hidden
this.Write(" on");
#line 45 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 50 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.Name));
#line default
#line hidden
this.Write("?: (event: NativeSyntheticEvent<");
#line 45 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 50 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetTypeScriptType(evt)));
#line default
#line hidden
this.Write(">) => void;\r\n");
#line 46 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 51 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
#line default
#line hidden
this.Write("}\r\n");
#line 48 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 53 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
if (ns != "") {
#line default
#line hidden
this.Write("}\r\n");
#line 50 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 55 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
#line default
#line hidden
#line 51 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 56 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
#line default
#line hidden
this.Write("\r\nexport type XamlControlProps =");
#line 53 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 58 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
var first = true; foreach (var type in Types) {
if (Util.HasCtor(type) || !type.IsSealed) {
if (!first)
@ -265,7 +270,7 @@ foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) {
#line hidden
this.Write(" | ");
#line 55 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 60 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
;
first = false;
@ -275,14 +280,14 @@ foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) {
#line hidden
this.Write(" ");
#line 58 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 63 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetNativePropsName(type)));
#line default
#line hidden
this.Write("\r\n\t");
#line 59 "F:\react-native-xaml\package\Codegen\TSProps.tt"
#line 64 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSProps.tt"
}
}

Просмотреть файл

@ -3,6 +3,11 @@
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type { ViewProps, NativeSyntheticEvent, ColorValue } from 'react-native';
import type * as Enums from './Enums';

Просмотреть файл

@ -28,44 +28,46 @@ namespace Codegen
/// </summary>
public virtual string TransformText()
{
this.Write("import type {\r\n");
this.Write("\r\n/*************************************************************\r\nTHIS FILE WAS A" +
"UTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************************" +
"******************************/\r\n\r\nimport type {\r\n");
#line 7 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 12 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var type in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) == "")) {
#line default
#line hidden
this.Write(" ");
#line 8 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetNativePropsName(type)));
#line default
#line hidden
this.Write(",\r\n");
#line 9 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("} from \'./Props\';\r\n\r\n");
#line 12 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var ns in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) != "").Select(t => Util.GetTSNamespace(t)).Distinct()) {
#line default
#line hidden
this.Write("import type { Native");
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(" } from \'./Props\';\r\n");
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
@ -73,7 +75,7 @@ namespace Codegen
this.Write("\r\nimport React from \'react\';\r\nimport { NativeXamlControl } from \'./NativeXamlCont" +
"rol\';\r\n\r\n\r\n");
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 25 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var type in Types.Where(t => Util.HasCtor(t))) {
var ns = Util.GetTSNamespace(type);
@ -83,76 +85,76 @@ if (ns != "") {
#line hidden
this.Write("export namespace ");
#line 24 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 29 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(" {\r\n");
#line 25 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("export type ");
#line 26 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 31 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props = Omit<");
#line 26 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 31 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetNativePropsName(type)));
#line default
#line hidden
this.Write(", \'type\'>;\r\n\r\nexport const ");
#line 28 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 33 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write(": React.FC<");
#line 28 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 33 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props> = (props: ");
#line 28 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 33 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props) => {\r\n return (\r\n <NativeXamlControl type=\"");
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 35 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(type.GetFullName()));
#line default
#line hidden
this.Write("\" {...props} />\r\n );\r\n};\r\n");
#line 33 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 38 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
if (ns != "") {
#line default
#line hidden
this.Write("}\r\n");
#line 35 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 40 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
#line 36 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
#line 41 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default

Просмотреть файл

@ -3,6 +3,11 @@
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type {
<# foreach (var type in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) == "")) { #>
<#= Util.GetNativePropsName(type) #>,

Просмотреть файл

@ -18,7 +18,7 @@ namespace Codegen
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TypeEnums : TypeEnumsBase
{
@ -28,51 +28,53 @@ namespace Codegen
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n");
this.Write("#pragma once\r\n/*************************************************************\r\nTHI" +
"S FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************" +
"******************************************/\r\n\r\n");
#line 8 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 12 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
foreach (var p in Util.fakeEnums.Where(p => p.Name.EndsWith("Priority"))) {
#line default
#line hidden
this.Write("enum class ");
#line 9 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));
#line default
#line hidden
this.Write(" {\r\n");
#line 10 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
foreach (var value in p.Values) {
#line default
#line hidden
this.Write(" ");
#line 11 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Key));
#line default
#line hidden
this.Write(" = ");
#line 11 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Value));
#line default
#line hidden
this.Write(",\r\n");
#line 12 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
}
#line default
#line hidden
this.Write("};\r\n\r\n");
#line 15 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEnums.tt"
}
#line default

Просмотреть файл

@ -4,6 +4,10 @@
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".h" #>
#pragma once
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var p in Util.fakeEnums.Where(p => p.Name.EndsWith("Priority"))) { #>
enum class <#= p.Name #> {

Просмотреть файл

@ -28,7 +28,8 @@ namespace Codegen
/// </summary>
public virtual string TransformText()
{
this.Write(@"#include ""pch.h""
this.Write(@"#pragma once
#include ""pch.h""
#include ""XamlMetadata.h""
#include ""Serialize.h""
#include ""Crc32Str.h""
@ -40,28 +41,28 @@ THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
");
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var ns in Events.Select(p => p.DeclaringType.GetNamespace()).Distinct()) {
#line default
#line hidden
this.Write("#include <winrt/");
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(".h>\r\n");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
this.Write("#include <winrt/");
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(XamlNames.XamlNamespace));
#line default
@ -91,14 +92,14 @@ THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
"AsFE, args);\r\n });\r\n }\r\n};\r\n\r\n/*static*/ const EventInfo EventInfo::xamlEv" +
"entMap[] = {\r\n");
#line 57 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 58 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var evt in Events) {
#line default
#line hidden
this.Write(" {\"");
#line 58 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 59 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
@ -106,21 +107,21 @@ THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
this.Write("\", [](const EventAttachInfo& eai, bool isWrapped, winrt::event_token token) noexc" +
"ept {\r\n if (const auto& c = DoTheTypeChecking<");
#line 59 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 60 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTType(evt.DeclaringType)));
#line default
#line hidden
this.Write(">(eai.obj, isWrapped)) {\r\n if (!token) {\r\n return c.");
#line 61 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 62 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("([eai] (");
#line 61 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 62 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTEventSignature(evt)));
#line default
@ -128,7 +129,7 @@ THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
this.Write(") noexcept {\r\n DispatchTheEvent(eai, sender, args);\r\n });\r\n " +
" } else {\r\n c.");
#line 65 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 66 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
@ -136,34 +137,34 @@ THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
this.Write("(token);\r\n return winrt::event_token{ -1 };\r\n }\r\n }\r\n return wi" +
"nrt::event_token{0};\r\n } },\r\n");
#line 71 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 72 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
#line 72 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 73 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var evt in SyntheticEvents) {
#line default
#line hidden
this.Write(" {\"");
#line 73 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 74 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.Name));
#line default
#line hidden
this.Write("\", nullptr /* synthetic event */},\r\n");
#line 74 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 75 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
this.Write("};\r\n\r\nstatic_assert(ARRAYSIZE(EventInfo::xamlEventMap) == ");
#line 77 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
#line 78 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Events.Count() + SyntheticEvents.Count()));
#line default

Просмотреть файл

@ -3,6 +3,7 @@
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Serialize.h"

Просмотреть файл

@ -0,0 +1,341 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class VersionHeader : VersionHeaderBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("#pragma once\r\n\r\n/*************************************************************\r\nT" +
"HIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n******************" +
"********************************************/\r\n\r\n#define VERSION_MAJOR " +
" ");
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Major));
#line default
#line hidden
this.Write("\r\n#define VERSION_MINOR ");
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Minor));
#line default
#line hidden
this.Write("\r\n#define VERSION_REVISION ");
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Revision == -1 ? 0 : Version.Revision));
#line default
#line hidden
this.Write("\r\n#define VERSION_BUILD ");
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Build));
#line default
#line hidden
this.Write("\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class VersionHeaderBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}

Просмотреть файл

@ -0,0 +1,16 @@
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".h" #>
#pragma once
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
#define VERSION_MAJOR <#= Version.Major #>
#define VERSION_MINOR <#= Version.Minor #>
#define VERSION_REVISION <#= Version.Revision == -1 ? 0 : Version.Revision #>
#define VERSION_BUILD <#= Version.Build #>

Просмотреть файл

@ -1,13 +1,13 @@
{
"name": "react-native-xaml",
"title": "React Native Xaml",
"version": "0.0.48",
"version": "0.0.50",
"description": "Allows using XAML directly, inside of a React Native Windows app",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc -b",
"codegen": "dotnet run -p codegen"
"codegen": "dotnet run -p codegen -verbose -winmd ..\\example\\windows\\packages\\Microsoft.UI.Xaml.2.6.0\\lib\\uap10.0\\Microsoft.UI.Xaml.winmd"
},
"repository": {
"type": "git",

Просмотреть файл

@ -1,3 +1,8 @@
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
export enum Stretch {
None = 0,
Fill = 1,

Просмотреть файл

@ -1,3 +1,8 @@
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type { ViewProps, NativeSyntheticEvent, ColorValue } from 'react-native';
import type * as Enums from './Enums';

Просмотреть файл

@ -1,3 +1,8 @@
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type {
NativeContentControlProps,
NativeAppBarProps,

Просмотреть файл

@ -1,3 +1,7 @@
#pragma once
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
enum class NavigationViewItemPriority {
MenuItem = 0,

Просмотреть файл

@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Serialize.h"

Просмотреть файл

@ -0,0 +1,10 @@
#pragma once
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
#define VERSION_MAJOR 0
#define VERSION_MINOR 0
#define VERSION_REVISION 0
#define VERSION_BUILD 50

Просмотреть файл

@ -0,0 +1,102 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "Version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILE_VERSION
PRODUCTVERSION VER_PRODUCT_VERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Microsoft"
VALUE "FileDescription", VER_FILE_DESCRIPTION_STR
VALUE "FileVersion", VER_FILE_VERSION_STR
VALUE "InternalName", "ReactNativeXaml.dll"
VALUE "LegalCopyright", VER_COPYRIGHT_STR
VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCT_VERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Просмотреть файл

@ -119,6 +119,18 @@
<Link>
<GenerateDebugInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">DebugFull</GenerateDebugInformation>
</Link>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
@ -144,12 +156,25 @@
<LinkTimeCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|x64'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<EnableCOMDATFolding Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</EnableCOMDATFolding>
</Link>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Codegen\EventArgsTypeProperties.g.h" />
<ClInclude Include="Codegen\TypeEnums.g.h" />
<ClInclude Include="Codegen\TypeEvents.g.h" />
<ClInclude Include="Codegen\TypeProperties.g.h" />
<ClInclude Include="Codegen\Version.g.h" />
<ClInclude Include="Crc32Str.h" />
<ClInclude Include="JSValueXaml_local.h" />
<ClInclude Include="ReactPackageProvider.h">
@ -157,8 +182,10 @@
</ClInclude>
<ClInclude Include="ReactNativeModule.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Serialize.h" />
<ClInclude Include="Styling.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="Wrapper.h">
<DependentUpon>Wrapper.idl</DependentUpon>
<SubType>Code</SubType>
@ -203,6 +230,9 @@
<None Include="packages.config" />
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ReactNativeXaml.rc" />
</ItemGroup>
<Import Project="$(SolutionDir)\ReactNativeXaml.Imports.props" Condition="Exists('$(SolutionDir)\ReactNativeXaml.Imports.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ReactNativeWindowsTargets">

Просмотреть файл

@ -40,6 +40,11 @@
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="JSValueXaml_local.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Codegen\Version.g.h">
<Filter>Codegen</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
@ -68,4 +73,7 @@
<UniqueIdentifier>{5c572e8a-9a91-412d-8a35-4bd65c3cfa2b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ReactNativeXaml.rc" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,29 @@
#pragma once
#include "Codegen/Version.g.h"
#define STRINGIZE2(s) #s
#define STRINGIZE(s) STRINGIZE2(s)
#define VER_FILE_DESCRIPTION_STR "React Native XAML View Manager for React Native for Windows"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD
#define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \
"." STRINGIZE(VERSION_MINOR) \
"." STRINGIZE(VERSION_REVISION) \
"." STRINGIZE(VERSION_BUILD) \
#define VER_PRODUCTNAME_STR "React Native XAML"
#define VER_PRODUCT_VERSION VER_FILE_VERSION
#define VER_PRODUCT_VERSION_STR VER_FILE_VERSION_STR
#define VER_ORIGINAL_FILENAME_STR "ReactNativeXaml.dll"
#define VER_INTERNAL_NAME_STR VER_ORIGINAL_FILENAME_STR
#define VER_COPYRIGHT_STR "© Microsoft Corporation. All rights reserved."
#ifdef _DEBUG
#define VER_VER_DEBUG VS_FF_DEBUG
#else
#define VER_VER_DEBUG 0
#endif
#define VER_FILEOS VOS_NT_WINDOWS32
#define VER_FILEFLAGS VER_VER_DEBUG
#define VER_FILETYPE VFT_APP

Просмотреть файл

@ -88,7 +88,6 @@ FrameworkElement XamlMetadata::GetFlyoutTarget(winrt::Windows::Foundation::IInsp
return parent.as<FrameworkElement>();
}
return nullptr;
//return wrapper.as<winrt::ReactNativeXaml::Wrapper>().DataContext().as<xaml::FrameworkElement>();
}
// FlyoutBase.IsOpen is read-only but we need a way to call ShowAt/Hide, so this hooks it up

Просмотреть файл

@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ReactNativeXaml.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif