Skip to content

Commit 2df4fc1

Browse files
committed
Changed the dependency on C++# to use its NuGet package.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 17c8eaf commit 2df4fc1

File tree

5 files changed

+54
-24
lines changed

5 files changed

+54
-24
lines changed

QtSharp.CLI/Program.cs

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ public static int Main(string[] args)
202202
var libFile = qt.LibFiles[i];
203203
var libFileName = Path.GetFileNameWithoutExtension(libFile);
204204
if (Path.GetExtension(libFile) == ".exe" ||
205+
// QtDeclarative is obsolete and at the same time its headers cause conflicts with its successor of QtQuick
205206
libFileName == "QtDeclarative" || libFileName == "Qt5Declarative" ||
206207
// QtQuickTest is a QML module but has 3 main C++ functions and is not auto-ignored
207208
libFileName == "QtQuickTest" || libFileName == "Qt5QuickTest")

QtSharp.CLI/QtSharp.CLI.csproj

+21-10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<TargetFrameworkProfile>
1515
</TargetFrameworkProfile>
1616
<FileAlignment>512</FileAlignment>
17+
<NuGetPackageImportStamp>
18+
</NuGetPackageImportStamp>
1719
</PropertyGroup>
1820
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
1921
<PlatformTarget>x86</PlatformTarget>
@@ -61,23 +63,24 @@
6163
</PropertyGroup>
6264
<ItemGroup>
6365
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
64-
<SpecificVersion>False</SpecificVersion>
65-
<HintPath>..\References\CppSharp.dll</HintPath>
66+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.dll</HintPath>
67+
<Private>True</Private>
6668
</Reference>
6769
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
68-
<SpecificVersion>False</SpecificVersion>
69-
<HintPath>..\References\CppSharp.AST.dll</HintPath>
70+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.AST.dll</HintPath>
71+
<Private>True</Private>
7072
</Reference>
71-
<Reference Include="CppSharp.Generator">
72-
<HintPath>..\References\CppSharp.Generator.dll</HintPath>
73+
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
74+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Generator.dll</HintPath>
75+
<Private>True</Private>
7376
</Reference>
7477
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
75-
<SpecificVersion>False</SpecificVersion>
76-
<HintPath>..\References\CppSharp.Parser.CLI.dll</HintPath>
78+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Parser.CLI.dll</HintPath>
79+
<Private>True</Private>
7780
</Reference>
7881
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
79-
<SpecificVersion>False</SpecificVersion>
80-
<HintPath>..\References\CppSharp.Runtime.dll</HintPath>
82+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Runtime.dll</HintPath>
83+
<Private>True</Private>
8184
</Reference>
8285
<Reference Include="System" />
8386
<Reference Include="System.Core" />
@@ -101,8 +104,16 @@
101104
</ItemGroup>
102105
<ItemGroup>
103106
<None Include="app.config" />
107+
<None Include="packages.config" />
104108
</ItemGroup>
105109
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
110+
<Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" />
111+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
112+
<PropertyGroup>
113+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
114+
</PropertyGroup>
115+
<Error Condition="!Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets'))" />
116+
</Target>
106117
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
107118
Other similar extension points exist, see Microsoft.Common.targets.
108119
<Target Name="BeforeBuild">

QtSharp.CLI/packages.config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
4+
<package id="CppSharp" version="0.5.2" targetFramework="net451" developmentDependency="true" />
5+
</packages>

QtSharp/QtSharp.csproj

+25-14
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<TargetFrameworkProfile />
16+
<NuGetPackageImportStamp>
17+
</NuGetPackageImportStamp>
1618
</PropertyGroup>
1719
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1820
<DebugSymbols>true</DebugSymbols>
@@ -35,17 +37,25 @@
3537
<Prefer32Bit>false</Prefer32Bit>
3638
</PropertyGroup>
3739
<ItemGroup>
38-
<Reference Include="CppSharp">
39-
<HintPath>..\References\CppSharp.dll</HintPath>
40+
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.dll</HintPath>
42+
<Private>True</Private>
4043
</Reference>
41-
<Reference Include="CppSharp.AST">
42-
<HintPath>..\References\CppSharp.AST.dll</HintPath>
44+
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
45+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.AST.dll</HintPath>
46+
<Private>True</Private>
4347
</Reference>
44-
<Reference Include="CppSharp.Generator">
45-
<HintPath>..\References\CppSharp.Generator.dll</HintPath>
48+
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
49+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Generator.dll</HintPath>
50+
<Private>True</Private>
4651
</Reference>
47-
<Reference Include="CppSharp.Parser.CLI">
48-
<HintPath>..\References\CppSharp.Parser.CLI.dll</HintPath>
52+
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
53+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Parser.CLI.dll</HintPath>
54+
<Private>True</Private>
55+
</Reference>
56+
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
57+
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Runtime.dll</HintPath>
58+
<Private>True</Private>
4959
</Reference>
5060
<Reference Include="HtmlAgilityPack">
5161
<HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
@@ -99,19 +109,20 @@
99109
<Compile Include="QtInfo.cs" />
100110
<Compile Include="QtSharp.cs" />
101111
</ItemGroup>
102-
<ItemGroup>
103-
<None Include="..\References\CppSharp.CppParser.dll">
104-
<Link>CppSharp.CppParser.dll</Link>
105-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
106-
</None>
107-
</ItemGroup>
108112
<ItemGroup>
109113
<None Include="..\References\sqlite3.dll">
110114
<Link>sqlite3.dll</Link>
111115
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
112116
</None>
113117
</ItemGroup>
114118
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
119+
<Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" />
120+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
121+
<PropertyGroup>
122+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
123+
</PropertyGroup>
124+
<Error Condition="!Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets'))" />
125+
</Target>
115126
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
116127
Other similar extension points exist, see Microsoft.Common.targets.
117128
<Target Name="BeforeBuild">

QtSharp/packages.config

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
4+
<package id="CppSharp" version="0.5.2" targetFramework="net451" developmentDependency="true" />
35
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net451" />
46
<package id="zlib.net" version="1.0.4" targetFramework="net451" />
57
</packages>

0 commit comments

Comments
 (0)