Skip to content

Commit 78fc807

Browse files
committed
VS support for new .NET in client project and Npgsql upgrade
Allow compiling .NET client with Nuget package. Use Revenj instead of legacy Npgsql to support SCRAM.
1 parent dd5d60b commit 78fc807

File tree

10 files changed

+43
-30
lines changed

10 files changed

+43
-30
lines changed

VisualStudioPlugin/2010/DSLPlatform.2010.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<DebugType>pdbonly</DebugType>
2828
<Optimize>true</Optimize>
2929
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
30+
<DefineConstants>TRACE;VS2010</DefineConstants>
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
3333
<RunCodeAnalysis>false</RunCodeAnalysis>
@@ -88,15 +88,15 @@
8888
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0">
8989
<HintPath>..\Dependencies\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
9090
</Reference>
91-
<Reference Include="Mono.Security">
92-
<HintPath>..\Dependencies\Mono.Security.dll</HintPath>
93-
</Reference>
94-
<Reference Include="Npgsql">
95-
<HintPath>..\Dependencies\Npgsql.dll</HintPath>
96-
</Reference>
9791
<Reference Include="Oracle.ManagedDataAccess">
9892
<HintPath>..\Dependencies\Oracle.ManagedDataAccess.dll</HintPath>
9993
</Reference>
94+
<Reference Include="Revenj.Core">
95+
<HintPath>..\Dependencies\Revenj.Core.dll</HintPath>
96+
</Reference>
97+
<Reference Include="Revenj.Core.Interface">
98+
<HintPath>..\Dependencies\Revenj.Core.Interface.dll</HintPath>
99+
</Reference>
100100
<Reference Include="System" />
101101
<Reference Include="System.ComponentModel.Composition" />
102102
<Reference Include="System.Configuration" />

VisualStudioPlugin/ChunkedMemoryStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public override long Seek(long offset, SeekOrigin origin)
6060
CurrentPosition += (int)offset;
6161
break;
6262
default:
63-
CurrentPosition = TotalSize - (int)offset;
63+
CurrentPosition = TotalSize + (int)offset;
6464
break;
6565
}
6666
return CurrentPosition;

VisualStudioPlugin/DSLPlatform.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,17 @@
266266
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
267267
<HintPath>packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
268268
</Reference>
269-
<Reference Include="Mono.Security">
270-
<HintPath>..\..\..\..\..\..\Projects\dsl-compiler-client\VisualStudioPlugin\Dependencies\Mono.Security.dll</HintPath>
271-
</Reference>
272-
<Reference Include="Npgsql">
273-
<HintPath>..\..\..\..\..\..\Projects\dsl-compiler-client\VisualStudioPlugin\Dependencies\Npgsql.dll</HintPath>
274-
</Reference>
275269
<Reference Include="Oracle.ManagedDataAccess">
276270
<HintPath>..\..\..\..\..\..\Projects\dsl-compiler-client\VisualStudioPlugin\Dependencies\Oracle.ManagedDataAccess.dll</HintPath>
277271
</Reference>
278272
<Reference Include="PresentationCore" />
279273
<Reference Include="PresentationFramework" />
274+
<Reference Include="Revenj.Core">
275+
<HintPath>Dependencies\Revenj.Core.dll</HintPath>
276+
</Reference>
277+
<Reference Include="Revenj.Core.Interface">
278+
<HintPath>Dependencies\Revenj.Core.Interface.dll</HintPath>
279+
</Reference>
280280
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
281281
<EmbedInteropTypes>False</EmbedInteropTypes>
282282
</Reference>
61.5 KB
Binary file not shown.
1.44 MB
Binary file not shown.

VisualStudioPlugin/Gui/CompileTargets.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ internal class CompileTargets
1616
}
1717
private static List<LibraryInfo.Nuget> RevenjStandard()
1818
{
19-
return new List<LibraryInfo.Nuget>(new[] { new LibraryInfo.Nuget { Project = "revenj", Version = "1.5.1" } });
19+
return new List<LibraryInfo.Nuget>(new[] { new LibraryInfo.Nuget { Project = "revenj", Version = "1.6.1" } });
20+
}
21+
private static List<LibraryInfo.Nuget> RevenjClient()
22+
{
23+
return new List<LibraryInfo.Nuget>(new[] { new LibraryInfo.Nuget { Project = "revenj.client", Version = "0.9.0" } });
2024
}
2125

2226
private static readonly string[] PocoDependencies = new[] {
@@ -100,7 +104,7 @@ private static Version NoVersion(LibraryInfo library)
100104
false,
101105
PocoDependencies,
102106
NoDependencies(),
103-
BuildTypes.LegacyDotNet,
107+
BuildTypes.DotNetStandard,
104108
".cs",
105109
BuildTypes.LegacyDotNet, BuildTypes.DotNetStandard);
106110
public readonly LibraryInfo PocoLibrary = PocoLibraryDefault.Clone();
@@ -112,9 +116,10 @@ private static Version NoVersion(LibraryInfo library)
112116
NoVersion,
113117
true,
114118
PocoDependencies,
115-
NoDependencies(),
116-
BuildTypes.LegacyDotNet,
117-
".cs");
119+
RevenjClient(),
120+
BuildTypes.DotNetStandard,
121+
".cs",
122+
BuildTypes.LegacyDotNet, BuildTypes.DotNetStandard);
118123
public readonly LibraryInfo ClientLibrary = ClientLibraryDefault.Clone();
119124
private LibraryInfo oldPortableLibrary;
120125
public static readonly LibraryInfo PortableLibraryDefault =
@@ -282,7 +287,7 @@ public Either<List<string>> Compile(List<string> dsls)
282287
{
283288
if (!t.TargetExists)
284289
return Either<List<string>>.Fail("Could not find " + t.Type + " target folder: " + t.Target);
285-
if (t.RequireDependenciesLegacy && !t.DependenciesExists)
290+
if (t.RequireDependenciesLegacy && !t.DependenciesExists && t.BuildType == BuildTypes.LegacyDotNet)
286291
return Either<List<string>>.Fail("Could not find " + t.Type + " dependencies folder: " + t.Dependencies);
287292
var result = RunCompiler(CompilerPath, t, dsls);
288293
if (!result.Success)

VisualStudioPlugin/Gui/ServerActions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
using System.Xml.Linq;
1010
using EnvDTE;
1111
using Ionic.Zip;
12-
using Npgsql;
1312
using Oracle.ManagedDataAccess.Client;
13+
using Revenj.DatabasePersistence.Postgres.Npgsql;
1414

1515
namespace DSLPlatform
1616
{
@@ -554,15 +554,15 @@ private static DbInfo ReadInfoFromOracle(DatabaseInfo dbInfo)
554554

555555
private static DbInfo ReadInfoFromPostgres(DatabaseInfo dbInfo)
556556
{
557-
var postgresVersion = new Version(9, 3);
557+
var postgresVersion = new Version(11, 0);
558558
try
559559
{
560560
using (var conn = new NpgsqlConnection(dbInfo.ConnectionString))
561561
{
562562
var com = conn.CreateCommand();
563563
conn.Open();
564564
if (!Version.TryParse(conn.ServerVersion, out postgresVersion))
565-
postgresVersion = new Version(9, 3);
565+
postgresVersion = new Version(11, 0);
566566
IDataReader dr;
567567
try
568568
{
@@ -607,10 +607,10 @@ private static void ApplyPostgresMigration(Stream stream, bool force, DatabaseIn
607607
{
608608
if (!force)
609609
CheckForce(stream);
610-
using (var conn = new Npgsql.NpgsqlConnection(dbInfo.ConnectionString))
610+
using (var conn = new NpgsqlConnection(dbInfo.ConnectionString))
611611
{
612612
conn.Open();
613-
var com = new Npgsql.NpgsqlCommand(stream);
613+
var com = new NpgsqlCommand(stream);
614614
com.Connection = conn;
615615
com.ExecuteNonQuery();
616616
conn.Close();

VisualStudioPlugin/Gui/View/ConfigurationClientControl.xaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,21 @@ DSL Platform libraries are BSD licensed and source is available on GitHub.
4040
ToolTip="Target folder is used to place compiled library."
4141
Foreground="{Binding Path=ClientLibrary.TargetColor}"/>
4242
</DockPanel>
43-
<DockPanel Margin="5" Visibility="{Binding Path=ClientLibrary.LegacyVisibility}">
43+
<DockPanel Margin="5">
4444
<Button Content="Dependency path" Width="120"
4545
Command="{Binding ChangeDependencies}" CommandParameter="Client" />
4646
<TextBox Text="{Binding Path=ClientLibrary.Dependencies}"
4747
ToolTip="Dependencies for specialized library are used during compilation process."
4848
Foreground="{Binding Path=ClientLibrary.DependenciesColor}" />
4949
</DockPanel>
50+
<DataGrid Visibility="{Binding Path=ClientLibrary.NetStandardVisibility}"
51+
ItemsSource="{Binding Path=ClientLibrary.Nugets}"
52+
AutoGenerateColumns="False" CanUserAddRows="True" CanUserResizeColumns="True" CanUserDeleteRows="True">
53+
<DataGrid.Columns>
54+
<DataGridTextColumn Header="Nuget package" Binding="{Binding Project}" Width="*"/>
55+
<DataGridTextColumn Header="Version" Binding="{Binding Version}" Width="*"/>
56+
</DataGrid.Columns>
57+
</DataGrid>
5058
<CheckBox IsChecked="{Binding Path=ClientLibrary.WithActiveRecord}"
5159
Content="Active record"
5260
Margin="5"

VisualStudioPlugin/Gui/View/ConfigurationPocoControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Build C# classes based on DSL definition
3333
ToolTip="Target folder is used to place compiled library."
3434
Foreground="{Binding Path=PocoLibrary.TargetColor}"/>
3535
</DockPanel>
36-
<DockPanel Margin="5" Visibility="{Binding Path=PocoLibrary.LegacyVisibility}">
36+
<DockPanel Margin="5">
3737
<Button Content="Dependency path" Width="120"
3838
Command="{Binding ChangeDependencies}" CommandParameter="Poco" />
3939
<TextBox Text="{Binding Path=PocoLibrary.Dependencies}"

VisualStudioPlugin/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[assembly: AssemblyConfiguration("")]
1212
[assembly: AssemblyCompany("N.G.S.")]
1313
[assembly: AssemblyProduct("DDD for DSL Platform")]
14-
[assembly: AssemblyCopyright("Copyright © N.G.S. 2019")]
14+
[assembly: AssemblyCopyright("Copyright © N.G.S. 2022")]
1515
[assembly: AssemblyTrademark("")]
1616
[assembly: AssemblyCulture("")]
1717
[assembly: ComVisible(false)]
@@ -28,8 +28,8 @@
2828
// You can specify all the values or you can default the Revision and Build Numbers
2929
// by using the '*' as shown below:
3030

31-
[assembly: AssemblyVersion("1.9.0.*")]
32-
[assembly: AssemblyFileVersion("1.9.0.0")]
31+
[assembly: AssemblyVersion("2.0.0.*")]
32+
[assembly: AssemblyFileVersion("2.0.0.0")]
3333

3434

3535

0 commit comments

Comments
 (0)