Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Revert to 9a44fc3
Browse files Browse the repository at this point in the history
  • Loading branch information
msawczyn committed Sep 25, 2020
1 parent 13540dd commit 6311e30
Show file tree
Hide file tree
Showing 27 changed files with 456 additions and 876 deletions.
12 changes: 6 additions & 6 deletions src/UpdateTemplates.ps1 → UpdateTemplates.ps1
@@ -1,4 +1,4 @@
[regex]::Replace((get-content DslPackage\TextTemplates\EditingOnly\EF6Designer.cs -Raw), '(?s)^.+#region Template[\r\n]+(.+)#endregion Template.+$', '<#@ assembly name="System.Core"
[regex]::Replace((get-content src\DslPackage\TextTemplates\EditingOnly\EF6Designer.cs -Raw), '(?s)^.+#region Template[\r\n]+(.+)#endregion Template.+$', '<#@ assembly name="System.Core"
#><#@ assembly name="System.Data.Linq"
#><#@ assembly name="EnvDTE"
#><#@ assembly name="System.Xml"
Expand All @@ -10,9 +10,9 @@
#><#+
$1
#>
') | set-content DslPackage\TextTemplates\EF6Designer.ttinclude
') | set-content src\DslPackage\TextTemplates\EF6Designer.ttinclude

[regex]::Replace((get-content DslPackage\TextTemplates\EditingOnly\EFCoreDesigner.cs -Raw), '(?s)^.+#region Template[\r\n]+(.+)#endregion Template.+$', '<#@ assembly name="System.Core"
[regex]::Replace((get-content src\DslPackage\TextTemplates\EditingOnly\EFCoreDesigner.cs -Raw), '(?s)^.+#region Template[\r\n]+(.+)#endregion Template.+$', '<#@ assembly name="System.Core"
#><#@ assembly name="System.Data.Linq"
#><#@ assembly name="EnvDTE"
#><#@ assembly name="System.Xml"
Expand All @@ -24,9 +24,9 @@ $1
#><#+
$1
#>
') | set-content DslPackage\TextTemplates\EFCoreDesigner.ttinclude
') | set-content src\DslPackage\TextTemplates\EFCoreDesigner.ttinclude

[regex]::Replace((get-content DslPackage\TextTemplates\EditingOnly\EFDesigner.cs -Raw), '(?s)^.+#region Template[\r\n]+(.+)#endregion Template.+$', '<#@ assembly name="System.Core"
[regex]::Replace((get-content src\DslPackage\TextTemplates\EditingOnly\EFDesigner.cs -Raw), '(?s)^.+#region Template[\r\n]+(.+)#endregion Template.+$', '<#@ assembly name="System.Core"
#><#@ assembly name="System.Data.Linq"
#><#@ assembly name="EnvDTE"
#><#@ assembly name="System.Xml"
Expand All @@ -38,4 +38,4 @@ $1
#><#+
$1
#>
') | set-content DslPackage\TextTemplates\EFDesigner.ttinclude
') | set-content src\DslPackage\TextTemplates\EFDesigner.ttinclude
44 changes: 44 additions & 0 deletions UpdateVersion.ps1
@@ -0,0 +1,44 @@
$xml = (get-content src\Dsl\DslDefinition.dsl -Raw)

$major = 0
$minor = 0
$build = 0
$revision = 0

$m = $xml | Select-String -Pattern 'MajorVersion="(\d+)"'
if ($m.Matches.Success) { $major = $m.Matches.Groups[1].Value }
$m = $xml | Select-String -Pattern 'MinorVersion="(\d+)"'
if ($m.Matches.Success) { $minor = $m.Matches.Groups[1].Value }
$m = $xml | Select-String -Pattern 'Build="(\d+)"'
if ($m.Matches.Success) { $build = $m.Matches.Groups[1].Value }
$m = $xml | Select-String -Pattern 'Revision="(\d+)"'
if ($m.Matches.Success) { $revision = $m.Matches.Groups[1].Value }

$version = $major+'.'+$minor+'.'+$build+'.'+$revision

$assemblyInfo =
'src\Dsl\Properties\AssemblyInfo.cs',
'src\DslPackage\Properties\AssemblyInfo.cs',
'src\Utilities\ParsingModels\AssemblyInfo.cs'

foreach ($f in $assemblyInfo) {
[regex]::Replace((get-content $f -Raw), '\[assembly:\s*AssemblyVersion\("[\d\.]+"\)\]', '[assembly: AssemblyVersion("'+$version+'")]') | set-content $f
[regex]::Replace((get-content $f -Raw), '\[assembly:\s*AssemblyFileVersion\("[\d\.]+"\)\]', '[assembly: AssemblyFileVersion("'+$version+'")]') | set-content $f
}

$t4 =
'src\DslPackage\TextTemplates\EF6Designer.ttinclude',
'src\DslPackage\TextTemplates\EFCoreDesigner.ttinclude',
'src\DslPackage\TextTemplates\EFDesigner.ttinclude',
'src\DslPackage\TextTemplates\MultipleOutputHelper.ttinclude',
'src\DslPackage\TextTemplates\VSIntegration.ttinclude',
'src\DslPackage\TextTemplates\EditingOnly\EF6Designer.cs',
'src\DslPackage\TextTemplates\EditingOnly\EFCoreDesigner.cs',
'src\DslPackage\TextTemplates\EditingOnly\EFDesigner.cs',
'src\DslPackage\TextTemplates\EditingOnly\MultipleOutputHelper.cs',
'src\DslPackage\TextTemplates\EditingOnly\VSIntegration.cs'

foreach ($f in $t4) {
[regex]::Replace((get-content $f -Raw), '(\s*)// EFDesigner v[\d\.]+', '$1// EFDesigner v'+$version) | set-content $f
}

Binary file modified dist/Sawczyn.EFDesigner.EFModel.DslPackage.vsix
Binary file not shown.
24 changes: 8 additions & 16 deletions src/Dsl/DslDefinition.dsl
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Dsl xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="9987f227-3d05-49b7-b151-857879f5dfb8" Description="Entity Framework visual editor for EF6, EFCore and beyond." Name="EFModel" DisplayName="Entity Framework Visual Editor" Namespace="Sawczyn.EFDesigner.EFModel" MajorVersion="2" MinorVersion="1" Revision="2" ProductName="EFDesigner" CompanyName="Michael Sawczyn" PackageGuid="56bbe1ba-aaee-4883-848f-e3c8656f8db2" PackageNamespace="Sawczyn.EFDesigner.EFModel" xmlns="http://schemas.microsoft.com/VisualStudio/2005/DslTools/DslDefinitionModel">
<Dsl xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="9987f227-3d05-49b7-b151-857879f5dfb8" Description="Entity Framework visual editor for EF6, EFCore and beyond." Name="EFModel" DisplayName="Entity Framework Visual Editor" Namespace="Sawczyn.EFDesigner.EFModel" MajorVersion="2" MinorVersion="1" ProductName="EFDesigner" CompanyName="Michael Sawczyn" PackageGuid="56bbe1ba-aaee-4883-848f-e3c8656f8db2" PackageNamespace="Sawczyn.EFDesigner.EFModel" xmlns="http://schemas.microsoft.com/VisualStudio/2005/DslTools/DslDefinitionModel">
<Classes>
<DomainClass Id="95532cb8-3452-4b09-a654-aeb2e2d0b3ad" Description="" Name="ModelRoot" DisplayName="Entity Model" Namespace="Sawczyn.EFDesigner.EFModel">
<CustomTypeDescriptor>
Expand Down Expand Up @@ -748,16 +748,9 @@
<DomainEnumerationMoniker Name="PropertyAccessMode" />
</Type>
</DomainProperty>
<DomainProperty Id="59390752-b103-4f33-b4c1-bef6cda81562" Description="Normal persistant property, computed property or property computed at the database" Name="PropertyType" DisplayName="Property Type" DefaultValue="Normal" Category="Code Generation">
<Attributes>
<ClrAttribute Name="System.ComponentModel.TypeConverter">
<Parameters>
<AttributeParameter Value="typeof(PropertyTypeTypeConverter)" />
</Parameters>
</ClrAttribute>
</Attributes>
<DomainProperty Id="247afa44-837d-4472-94c7-74f319c10510" Description="How should this property be exposed in code?" Name="ExposeAs" DisplayName="Expose As" DefaultValue="Property" Category="Code Generation">
<Type>
<DomainEnumerationMoniker Name="PropertyType" />
<DomainEnumerationMoniker Name="PropertyExposure" />
</Type>
</DomainProperty>
</Properties>
Expand Down Expand Up @@ -1686,11 +1679,10 @@
<EnumerationLiteral Description="Enforces that all accesses to the property must go through the property getters and setters, even when new objects are being constructed. An exception will be thrown if this mode is set and it is not possible to read from or write to the property, for example because it is read-only." Name="Property" Value="2" />
</Literals>
</DomainEnumeration>
<DomainEnumeration Name="PropertyType" Namespace="Sawczyn.EFDesigner.EFModel" Description="Description for Sawczyn.EFDesigner.EFModel.PropertyType">
<DomainEnumeration Name="PropertyExposure" Namespace="Sawczyn.EFDesigner.EFModel" Description="How the code generator will present this property to Entity Framework (EFCore5+ only)">
<Literals>
<EnumerationLiteral Description="This is a normal persistant property" Name="Normal" Value="0" />
<EnumerationLiteral Description="This property is not persisted, but computed at runtime" Name="Computed" Value="1" />
<EnumerationLiteral Description="This property is readonly and created by the database" Name="DatabaseComputed" Value="2" />
<EnumerationLiteral Description="Generated code will create and use this attribute as a .NET property," Name="Property" Value="" />
<EnumerationLiteral Description="Generated code will create and use this attribute as a .NET field" Name="Field" Value="" />
</Literals>
</DomainEnumeration>
</Types>
Expand Down Expand Up @@ -2326,8 +2318,8 @@
<XmlPropertyData XmlName="propertyAccessMode">
<DomainPropertyMoniker Name="ModelAttribute/PropertyAccessMode" />
</XmlPropertyData>
<XmlPropertyData XmlName="propertyType">
<DomainPropertyMoniker Name="ModelAttribute/PropertyType" />
<XmlPropertyData XmlName="exposeAs">
<DomainPropertyMoniker Name="ModelAttribute/ExposeAs" />
</XmlPropertyData>
</ElementData>
</XmlClassData>
Expand Down

0 comments on commit 6311e30

Please sign in to comment.