Skip to content

Commit 2e065b3

Browse files
Fixed OnConfigChange.targets, updated gitignore, and added common.props for version property.
1 parent 98cb700 commit 2e065b3

File tree

10 files changed

+82
-44
lines changed

10 files changed

+82
-44
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*.userosscache
1111
*.sln.docstates
1212
[Rr]eleases/
13+
[Cc]onfigCache/
14+
/GfxControls.CLI/NetFramework
1315

1416
# User-specific files (MonoDevelop/Xamarin Studio)
1517
*.userprefs

Common.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
3+
<PropertyGroup>
4+
<VersionPrefix>0.1.1.0</VersionPrefix>
5+
</PropertyGroup>
6+
</Project>

ConfigCache/PreviousConfig.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

Examples/WPF/SharpDXExample/MainWindow.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
using Matrix = SharpDX.Matrix;
1818
using Point = System.Windows.Point;
1919
using Size = GfxControls.Size;
20-
using System.Runtime.InteropServices.JavaScript;
21-
using System.Windows.Interop;
2220

2321
//https://github.com/sharpdx/SharpDX-Samples/blob/master/Desktop/Direct3D11/MiniCube/Program.cs
2422
namespace Example1

GfxControls.CLI/AssemblyInfo.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,26 @@ using namespace System::Runtime::CompilerServices;
66
using namespace System::Runtime::InteropServices;
77
using namespace System::Security::Permissions;
88

9+
#ifndef VERSION_PREFIX
10+
#error VERSION_PREFIX is not defined.
11+
#else
12+
13+
#if UNICODE
14+
#define VERSION L_VERSION_PREFIX
15+
#else
16+
#define VERSION VERSION_PREFIX
17+
#endif
18+
#endif
19+
920
[assembly:AssemblyTitleAttribute(L"GfxControlsCLI")];
1021
[assembly:AssemblyDescriptionAttribute(L"")];
1122
[assembly:AssemblyConfigurationAttribute(L"")];
12-
[assembly:AssemblyCompanyAttribute(L"")];
23+
[assembly:AssemblyCompanyAttribute(L"Xorrupt")];
1324
[assembly:AssemblyProductAttribute(L"GfxControlsCLI")];
1425
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2024")];
1526
[assembly:AssemblyTrademarkAttribute(L"")];
1627
[assembly:AssemblyCultureAttribute(L"")];
1728

18-
[assembly:AssemblyVersionAttribute(L"0.1.1.0")];
29+
[assembly:AssemblyVersionAttribute(VERSION)];
1930

2031
[assembly:ComVisible(false)];

GfxControls.CLI/GfxControls.CLI.vcxproj

Lines changed: 39 additions & 26 deletions
Large diffs are not rendered by default.

GfxControls.CLI/OnConfigChange.targets

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PreviousConfigurationFile>$(SolutionDir)ConfigCache\PreviousConfig.txt</PreviousConfigurationFile>
66
</PropertyGroup>
77

8-
<Target Name="CLIOnConfigChangePreBuild" BeforeTargets="ResolvePackageAssets;ResolveNuGetPackageAssets">
8+
<Target Name="CLIOnConfigChangePreBuild" BeforeTargets="ResolvePackageAssets;ResolveNuGetPackageAssets;Clean">
99
<Message Text="Test" Importance="high"/>
1010

1111
<!-- Initialize configuration changed property -->
@@ -40,6 +40,9 @@
4040
<Exec Command="rmdir /s /q &quot;$(SolutionDir)bin\x86&quot;"
4141
Condition="'$(_IsConfigurationChanged)' == 'true'" />
4242

43+
<Exec Command="rmdir /s /q &quot;$(SolutionDir)bin\Win32&quot;"
44+
Condition="'$(_IsConfigurationChanged)' == 'true'" />
45+
4346

4447
<!-- Clean CLI Project-->
4548
<Message Text="Cleaning CLI intermediate directories"
@@ -52,9 +55,6 @@
5255
<Exec Command="rmdir /s /q &quot;$(SolutionDir)GfxControls.CLI\GfxControls.CLI&quot;"
5356
Condition="'$(_IsConfigurationChanged)' == 'true'" />
5457

55-
<Exec Command="rmdir /s /q &quot;$(SolutionDir)GfxControls.CLI\NetFramework&quot;"
56-
Condition="'$(_IsConfigurationChanged)' == 'true'" />
57-
5858
<Exec Command="rmdir /s /q &quot;$(SolutionDir)GfxControls.CLI\x64&quot;"
5959
Condition="'$(_IsConfigurationChanged)' == 'true'" />
6060

@@ -82,13 +82,17 @@
8282
<MSBuild Projects="$(SolutionDir)GfxControls.CLI\GfxControls.CLI.vcxproj" Targets="Restore"
8383
Condition="'$(_IsConfigurationChanged)' == 'true'"/>
8484

85-
<!--<Exec Command="&quot;$(VisualStudioCmdPrompt)&quot; x64 &amp;&amp; msbuild &quot;$(SolutionDir)GfxControls.CLI\GfxControls.CLI.vcxproj&quot; /t:Restore"
86-
Condition="'$(_IsConfigurationChanged)' == 'true'"/>-->
87-
</Target>
85+
<Exec Command="&quot;$(VisualStudioCmdPrompt)&quot; $(Platform) &amp;&amp; msbuild &quot;$(SolutionDir)GfxControls.CLI\GfxControls.CLI.vcxproj&quot; /t:Restore"
86+
Condition="'$(_IsConfigurationChanged)' == 'true'"
87+
ContinueOnError="true"/>
8888

89-
<Target Name="CLIOnConfigChangePostBuild" AfterTargets="Build">
9089
<!-- Write current configuration to PreviousConfigurationFile -->
9190
<WriteLinesToFile File="$(PreviousConfigurationFile)" Lines="$(Configuration)" Overwrite="true" />
9291
</Target>
92+
93+
<!--<Target Name="CLIOnConfigChangePostBuild" AfterTargets="Build">
94+
--><!-- Write current configuration to PreviousConfigurationFile --><!--
95+
<WriteLinesToFile File="$(PreviousConfigurationFile)" Lines="$(Configuration)" Overwrite="true" />
96+
</Target>-->
9397

9498
</Project>

GfxControls.Forms/GfxControls.Forms.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<Import Project="..\Common.props" />
4+
35
<PropertyGroup>
46
<TargetFramework>net8.0-windows</TargetFramework>
57
<Nullable>enable</Nullable>
@@ -19,9 +21,10 @@
1921
<RepositoryUrl>https://github.com/AddioElectronics/GfxControls</RepositoryUrl>
2022
<RepositoryType>git</RepositoryType>
2123
<PackageTags>WPF, DX, DirectX, D3D, D3D11, 11, DX11, Control, Host, Embed, Window, DXGI, GL, GFX, UI, OpenGL, SharpDX, OpenTK, Vulkan</PackageTags>
22-
<AssemblyVersion>0.1.1.0</AssemblyVersion>
24+
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
2325
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2426
<Product>GfxControls</Product>
27+
<FileVersion>$(VersionPrefix)</FileVersion>
2528
</PropertyGroup>
2629

2730
<!-- Target .NET 8 for Debug and Release -->

GfxControls.WPF/GfxControls.WPF.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<Import Project="..\Common.props" />
4+
35
<PropertyGroup>
46
<Nullable>enable</Nullable>
57
<UseWPF>true</UseWPF>
@@ -18,9 +20,10 @@
1820
<RepositoryUrl>https://github.com/AddioElectronics/GfxControls</RepositoryUrl>
1921
<RepositoryType>git</RepositoryType>
2022
<PackageTags>WPF, DX, DirectX, D3D, D3D11, 11, DX11, Control, Host, Embed, Window, DXGI, GL, GFX, UI, OpenGL, SharpDX, OpenTK, Vulkan</PackageTags>
21-
<AssemblyVersion>0.1.1.0</AssemblyVersion>
23+
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
2224
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2325
<Product>GfxControls</Product>
26+
<FileVersion>$(VersionPrefix)</FileVersion>
2427
</PropertyGroup>
2528

2629
<!-- Target .NET 8 for Debug and Release -->

GfxControls.sln

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WinForms", "WinForms", "{74
2121
EndProject
2222
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpDXExample", "Examples\WinForms\SharpDXExample\SharpDXExample.csproj", "{42E31408-AB08-4F8E-BCA8-21EE6C1AE6FA}"
2323
EndProject
24-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{8F298AB3-E6CC-4E52-8183-6F359E455C66}"
24+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{EB51E380-3C0E-4A7B-A69F-AF0DC5140405}"
2525
ProjectSection(SolutionItems) = preProject
26-
Scripts\cli-on-config-change.cmd = Scripts\cli-on-config-change.cmd
27-
Scripts\LastConfig.txt = Scripts\LastConfig.txt
26+
Common.props = Common.props
2827
EndProjectSection
2928
EndProject
3029
Global

0 commit comments

Comments
 (0)