Skip to content

Commit a88f1b1

Browse files
committed
It can be pack to nuget now
1 parent 6388b74 commit a88f1b1

9 files changed

Lines changed: 167 additions & 17 deletions

AdvancedSharpAdbClient.WinRT.Tests/AdvancedSharpAdbClient.WinRT.Tests.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Keyword>Win32Proj</Keyword>
1212
<RootNamespace>AdvancedSharpAdbClient.WinRT.Tests</RootNamespace>
1313
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0</WindowsTargetPlatformVersion>
14-
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
14+
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
1515
</PropertyGroup>
1616
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1717
<ItemGroup Label="ProjectConfigurations">

AdvancedSharpAdbClient.WinRT.Tests/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ int main()
1313
auto adbServer = AdbServer::AdbServer();
1414
adbServer.StartServer(L"C:\\Program Files (x86)\\Android\\android-sdk\\platform-tools\\adb.exe", true);
1515
auto status = adbServer.GetStatus();
16-
printf("%ls\n", status.ToString().c_str());
16+
printf("%ls\n", status.as<IStringable>().ToString().c_str());
1717
if (status.IsRunning())
1818
{
1919
auto adbClient = AdbClient::AdbClient();
2020
auto devices = adbClient.GetDevices();
2121
for (auto device : devices)
2222
{
23-
printf("%ls\n", device.ToString().c_str());
23+
printf("%ls\n", device.as<IStringable>().ToString().c_str());
2424
auto processes = adbClient.ListProcesses(device);
2525
for (auto process : processes)
2626
{
27-
printf("%ls\n", process.ToString().c_str());
27+
printf("%ls\n", process.as<IStringable>().ToString().c_str());
2828
}
2929
}
3030
adbClient.KillAdb();

AdvancedSharpAdbClient.WinRT.sln

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Global
2121
Release|x86 = Release|x86
2222
EndGlobalSection
2323
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24-
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|Any CPU.ActiveCfg = Debug|x86
25-
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|Any CPU.Build.0 = Debug|x86
24+
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|Any CPU.Build.0 = Debug|Any CPU
2626
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|ARM.ActiveCfg = Debug|ARM
2727
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|ARM.Build.0 = Debug|ARM
2828
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|ARM64.ActiveCfg = Debug|ARM64
@@ -31,8 +31,8 @@ Global
3131
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|x64.Build.0 = Debug|x64
3232
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|x86.ActiveCfg = Debug|x86
3333
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Debug|x86.Build.0 = Debug|x86
34-
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Release|Any CPU.ActiveCfg = Release|x86
35-
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Release|Any CPU.Build.0 = Release|x86
34+
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Release|Any CPU.Build.0 = Release|Any CPU
3636
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Release|ARM.ActiveCfg = Release|ARM
3737
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Release|ARM.Build.0 = Release|ARM
3838
{083CDC04-9CC2-46E4-84C2-55B645BE9D50}.Release|ARM64.ActiveCfg = Release|ARM64

AdvancedSharpAdbClient.WinRT/AdvancedSharpAdbClient.WinRT.csproj

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

3+
<PropertyGroup>
4+
<FullTargets>True</FullTargets>
5+
</PropertyGroup>
6+
37
<PropertyGroup Condition="'$(FullTargets)' == 'true'">
48
<NoWarn>NU1603</NoWarn>
59
<TargetFrameworks>uap10.0;uap10.0.15138.0;net6.0-windows10.0.17763.0</TargetFrameworks>
@@ -12,18 +16,72 @@
1216
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0-windows10.0.17763.0'">
1317
<CsWinRTComponent>true</CsWinRTComponent>
1418
<CsWinRTWindowsMetadata>10.0.22621.0</CsWinRTWindowsMetadata>
19+
<Platforms>x64;x86;ARM64;ARM</Platforms>
1520
</PropertyGroup>
1621

1722
<PropertyGroup Condition="'$(TargetFramework)' != 'net6.0-windows10.0.17763.0'">
23+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
1824
<DebugType>Full</DebugType>
1925
<OutputType>winmdobj</OutputType>
20-
<Platforms>x64;x86;ARM64;ARM</Platforms>
26+
<Platforms>AnyCPU;x64;x86;ARM64;ARM</Platforms>
2127
</PropertyGroup>
2228

2329
<ItemGroup>
2430
<PackageReference Include="AdvancedSharpAdbClient" Version="2.5.7" />
2531
</ItemGroup>
2632

33+
<ItemGroup Condition="'$(FullTargets)' == 'true'">
34+
<None Include="..\logo.png" Pack="true" PackagePath="\Icon.png">
35+
<Link>Assets\Icon.png</Link>
36+
</None>
37+
<None Include="..\build\*" Pack="true" PackagePath="build\">
38+
<Link>Assets\build\%(FileName)%(Extension)</Link>
39+
</None>
40+
<None Include="bin\$(Configuration)\net6.0-windows10.0.17763.0\*" Pack="true" PackagePath="build\native\">
41+
<Link>Assets\build\native\%(FileName)%(Extension)</Link>
42+
</None>
43+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\AdvancedSharpAdbClient.WinRT.deps.json" />
44+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\AdvancedSharpAdbClient.WinRT.dll" />
45+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\AdvancedSharpAdbClient.WinRT.pdb" />
46+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\AdvancedSharpAdbClient.WinRT.winmd" />
47+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\AdvancedSharpAdbClient.WinRT.xml" />
48+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\WinRT.Host.dll" />
49+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\WinRT.Host.dll.mui" />
50+
<None Remove="bin\$(Configuration)\net6.0-windows10.0.17763.0\WinRT.Host.Shim.dll" />
51+
<None Include="bin\$(Configuration)\uap10.0\*" Pack="true" PackagePath="build\uap10.0\">
52+
<Link>Assets\build\uap10.0\%(FileName)%(Extension)</Link>
53+
</None>
54+
<None Remove="bin\$(Configuration)\uap10.0\AdvancedSharpAdbClient.WinRT.pdb" />
55+
<None Remove="bin\$(Configuration)\uap10.0\AdvancedSharpAdbClient.WinRT.pri" />
56+
<None Remove="bin\$(Configuration)\uap10.0\AdvancedSharpAdbClient.WinRT.winmd" />
57+
<None Remove="bin\$(Configuration)\uap10.0\AdvancedSharpAdbClient.WinRT.xml" />
58+
<None Include="bin\$(Configuration)\uap10.0.15138.0\*" Pack="true" PackagePath="build\uap10.0.15138\">
59+
<Link>Assets\build\uap10.0.15138\%(FileName)%(Extension)</Link>
60+
</None>
61+
<None Remove="bin\$(Configuration)\uap10.0.15138.0\AdvancedSharpAdbClient.WinRT.pdb" />
62+
<None Remove="bin\$(Configuration)\uap10.0.15138.0\AdvancedSharpAdbClient.WinRT.pri" />
63+
<None Remove="bin\$(Configuration)\uap10.0.15138.0\AdvancedSharpAdbClient.WinRT.winmd" />
64+
<None Remove="bin\$(Configuration)\uap10.0.15138.0\AdvancedSharpAdbClient.WinRT.xml" />
65+
<None Include="..\build\*" Pack="true" PackagePath="buildTransitive\">
66+
<Link>Assets\buildTransitive\%(FileName)%(Extension)</Link>
67+
</None>
68+
<None Include="$(NuGetPackageRoot)microsoft.windows.cswinrt\2.0.3\hosting\**\native\*" Pack="true" PackagePath="hosting\">
69+
<Link>Assets\hosting\%(RecursiveDir)\%(FileName)%(Extension)</Link>
70+
</None>
71+
<None Include="$(NuGetPackageRoot)microsoft.windows.cswinrt\2.0.3\hosting\**\native\en-US\*" Pack="true" PackagePath="hosting\">
72+
<Link>Assets\hosting\%(RecursiveDir)\%(FileName)%(Extension)</Link>
73+
</None>
74+
<None Include="bin\$(Configuration)\net6.0-windows10.0.17763.0\AdvancedSharpAdbClient.WinRT.winmd" Pack="true" PackagePath="lib\net6.0-windows10.0.17763.0\winmd\">
75+
<Link>Assets\lib\net6.0-windows10.0.17763.0\winmd\AdvancedSharpAdbClient.WinRT.winmd</Link>
76+
</None>
77+
<None Include="bin\$(Configuration)\net6.0-windows10.0.17763.0\WinRT.Host.Shim.dll" Pack="true" PackagePath="lib\net6.0-windows10.0.17763.0\">
78+
<Link>Assets\lib\net6.0-windows10.0.17763.0\winmd\WinRT.Host.Shim.winmd</Link>
79+
</None>
80+
<None Include="bin\$(Configuration)\net6.0-windows10.0.17763.0\WinRT.Runtime.dll" Pack="true" PackagePath="lib\net6.0-windows10.0.17763.0\">
81+
<Link>Assets\lib\net6.0-windows10.0.17763.0\winmd\WinRT.Runtime.winmd</Link>
82+
</None>
83+
</ItemGroup>
84+
2785
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows10.0.17763.0'">
2886
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.3" />
2987
</ItemGroup>

Directory.Build.props

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,34 @@
33
<PropertyGroup>
44
<AssemblyTitle>.NET client for adb, the Android Debug Bridge (AdvancedSharpAdbClient)</AssemblyTitle>
55
<Authors>The Android Open Source Project, Ryan Conrad, Quamotion and improved by yungd1plomat, wherewhere</Authors>
6+
<ContinuousIntegrationBuild>True</ContinuousIntegrationBuild>
67
<Copyright>https://github.com/quamotion/madb</Copyright>
7-
<Description>AdvancedSharpAdbClient is a .NET library that allows .NET and .NET Core applications to communicate with Android devices. It's a improved version of SharpAdbClient.</Description>
8+
<Description>AdvancedSharpAdbClient.WinRT is a WinRT library that allows WinRT applications to communicate with Android devices. It's a WinRT package of AdvancedSharpAdbClient, which is upgraded version of SharpAdbClient.</Description>
9+
<Deterministic>True</Deterministic>
10+
<EmbedUntrackedSources>True</EmbedUntrackedSources>
811
<GenerateDocumentationFile>True</GenerateDocumentationFile>
9-
<IncludeSymbols>True</IncludeSymbols>
1012
<LangVersion>latest</LangVersion>
13+
<PackageIcon>Icon.png</PackageIcon>
14+
<PackageIconUrl>https://raw.githubusercontent.com/yungd1plomat/AdvancedSharpAdbClient/main/logo.png</PackageIconUrl>
1115
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
1216
<PackageProjectUrl>https://github.com/yungd1plomat/AdvancedSharpAdbClient</PackageProjectUrl>
1317
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
14-
<PackageTags>android;adb;SharpAdbClient;AdvancedSharpAdbClient</PackageTags>
18+
<PackageReleaseNotes>https://github.com/yungd1plomat/AdvancedSharpAdbClient/releases</PackageReleaseNotes>
19+
<PackageTags>Android;ADB;Communicate;UWP;Xamarin;MAUI;WinUI;Mono;Unity;SharpAdbClient;AdvancedSharpAdbClient</PackageTags>
1520
<RepositoryType>git</RepositoryType>
1621
<Product>AdvancedSharpAdbClient: A .NET client for the Android Debug Bridge (adb)</Product>
1722
<PublishRepositoryUrl>True</PublishRepositoryUrl>
1823
<RepositoryUrl>https://github.com/yungd1plomat/AdvancedSharpAdbClient</RepositoryUrl>
19-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2024
<Title>.NET client for adb, Android Debug Bridge (AdvancedSharpAdbClient)</Title>
21-
<VersionPrefix>2.5.4</VersionPrefix>
25+
<VersionPrefix>0.0.1</VersionPrefix>
2226
</PropertyGroup>
2327

2428
<PropertyGroup>
25-
<UseWinRT Condition="'$(IsWindows)' == ''">False</UseWinRT>
26-
<FullTargets Condition="'$(FullTargets)' == ''">True</FullTargets>
29+
<FullTargets Condition="'$(FullTargets)' == ''">False</FullTargets>
30+
<ImportAsync Condition="'$(ImportAsync)' == ''">False</ImportAsync>
2731
<IsWindows Condition="'$(IsWindows)' == ''">False</IsWindows>
28-
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows')) == 'true' OR '$(Platform)' == 'Windows NT'">True</IsWindows>
32+
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows')) == 'True' OR '$(Platform)' == 'Windows NT'">True</IsWindows>
33+
<IsTestProject Condition="'$(IsTestProject)' == ''">$(MSBuildProjectName.Contains('.Test'))</IsTestProject>
2934
</PropertyGroup>
3035

3136
<PropertyGroup Condition="'$(TargetFramework)' == 'netcore50'">
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!-- This file was produced from C#/WinRT -->
2+
<Project ToolsVersion="14.0" xmln="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- Add the hosting dlls to references so they get binplaced -->
5+
<ResolveReferencesDependsOn>AdvancedSharpAdbClient_WinRTCopyAuthoringDlls;$(ResolveReferencesDependsOn)</ResolveReferencesDependsOn>
6+
<!-- Add authored component's winmd to references before C++/WinRT runs -->
7+
<BuildDependsOn>AdvancedSharpAdbClient_WinRTAddAuthoredWinMDReference;$(BuildDependsOn)</BuildDependsOn>
8+
</PropertyGroup>
9+
<PropertyGroup>
10+
<_NormalizedPlatform Condition="'$(Platform)' == 'Win32'">x86</_NormalizedPlatform>
11+
<_NormalizedPlatform Condition="'$(_NormalizedPlatform)' == ''">$(Platform)</_NormalizedPlatform>
12+
</PropertyGroup>
13+
<ItemGroup>
14+
<!-- Managed, WinRT and SDK.NET dlls -->
15+
<HostingAssets Include="$(MSBuildThisFileDirectory)..\lib\net6*.0*\*.dll" />
16+
<!-- Managed DLLs from packages the component depends on -->
17+
<HostingAssets Include="$(MSBuildThisFileDirectory)..\build\native\*.dll" />
18+
<!-- Add the runtimeconfig.json -->
19+
<HostingAssets Include="$(MSBuildThisFileDirectory)..\build\native\WinRT.Host.runtimeconfig.json" />
20+
<!-- Get the proper WinRT.Host.dll -->
21+
<HostingAssets Include="$(MSBuildThisFileDirectory)..\hosting\$(_NormalizedPlatform)\native\WinRT.Host.dll" />
22+
<HostingAssets Include="$(MSBuildThisFileDirectory)..\hosting\$(_NormalizedPlatform)\native\en-us\WinRT.Host.dll.mui" />
23+
</ItemGroup>
24+
<!-- Add the WinMD file as a reference of the native app so a projection gets made -->
25+
<Target Name="AdvancedSharpAdbClient_WinRTAddAuthoredWinMDReference" Outputs="@(Reference)">
26+
<ItemGroup Condition="'$(TargetFramework)' == 'native' OR '$(TargetFramework)' == ''">
27+
<Reference Include="$(MSBuildThisFileDirectory)..\lib\net6*\winmd\*.winmd">
28+
<IsWinMDFile>true</IsWinMDFile>
29+
<Implementation>WinRT.Host.dll</Implementation>
30+
</Reference>
31+
</ItemGroup>
32+
<ItemGroup Condition="'$(TargetFramework)' != 'native' AND '$(TargetFramework)' != ''">
33+
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\lib\net6*\winmd\*.winmd" />
34+
</ItemGroup>
35+
</Target>
36+
<!-- Make sure the runtime assets are available to the app -->
37+
<Target Name="AdvancedSharpAdbClient_WinRTCopyAuthoringDlls" Condition="'$(TargetFramework)' == 'native' OR '$(TargetFramework)' == ''" Outputs="@(ReferenceCopyLocalPaths)">
38+
<ItemGroup>
39+
<ReferenceCopyLocalPaths Include="@(HostingAssets)" />
40+
</ItemGroup>
41+
</Target>
42+
</Project>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!-- This file was produced from C#/WinRT -->
2+
<Project ToolsVersion="14.0" xmln="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- Add the hosting dlls to references so they get binplaced -->
5+
<ResolveReferencesDependsOn>AdvancedSharpAdbClient_WinRTCopyAuthoringDlls;$(ResolveReferencesDependsOn)</ResolveReferencesDependsOn>
6+
<!-- Add authored component's winmd to references before C++/WinRT runs -->
7+
<BuildDependsOn>AdvancedSharpAdbClient_WinRTAddAuthoredWinMDReference;$(BuildDependsOn)</BuildDependsOn>
8+
</PropertyGroup>
9+
<PropertyGroup>
10+
<IsUseUAP10 Condition="'$(IsUseUAP10)' == '' AND $([MSBuild]::VersionLessThan($(WindowsTargetPlatformMinVersion), '10.0.15138.0'))">true</IsUseUAP10>
11+
<_TargetFramework Condition="'$(IsUseUAP10)' == 'true'">uap10.0</_TargetFramework>
12+
<_TargetFramework Condition="'$(IsUseUAP10)' != 'true'">uap10.0.15138</_TargetFramework>
13+
</PropertyGroup>
14+
<ItemGroup>
15+
<!-- Managed, WinRT and SDK.NET dlls -->
16+
<HostingAssets Include="$(MSBuildThisFileDirectory)..\lib\$(_TargetFramework)\*.dll" />
17+
<!-- Managed DLLs from packages the component depends on -->
18+
<HostingAssets Include="$(MSBuildThisFileDirectory)..\build\$(_TargetFramework)\*.dll" />
19+
</ItemGroup>
20+
<!-- Add the WinMD file as a reference of the native app so a projection gets made -->
21+
<Target Name="AdvancedSharpAdbClient_WinRTAddAuthoredWinMDReference" Outputs="@(Reference)">
22+
<ItemGroup Condition="'$(TargetFramework)' == 'native' OR '$(TargetFramework)' == ''">
23+
<Reference Include="$(MSBuildThisFileDirectory)..\lib\$(_TargetFramework)\*.winmd">
24+
<IsWinMDFile>true</IsWinMDFile>
25+
</Reference>
26+
</ItemGroup>
27+
<ItemGroup Condition="'$(TargetFramework)' != 'native' AND '$(TargetFramework)' != ''">
28+
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\lib\$(_TargetFramework)\*.winmd" />
29+
</ItemGroup>
30+
</Target>
31+
<!-- Make sure the runtime assets are available to the app -->
32+
<Target Name="AdvancedSharpAdbClient_WinRTCopyAuthoringDlls" Condition="'$(TargetFramework)' == 'native' OR '$(TargetFramework)' == ''" Outputs="@(ReferenceCopyLocalPaths)">
33+
<ItemGroup>
34+
<ReferenceCopyLocalPaths Include="@(HostingAssets)" />
35+
</ItemGroup>
36+
</Target>
37+
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project ToolsVersion="14.0" xmln="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<IsUseUAP Condition="'$(IsUseUAP)' == '' AND '$(AppContainerApplication)' == 'true'">true</IsUseUAP>
4+
<TargetsPath Condition="'$(IsUseUAP)' == 'true'">$(MSBuildThisFileDirectory)AdvancedSharpAdbClient.WinRT.UAP.targets</TargetsPath>
5+
<TargetsPath Condition="'$(IsUseUAP)' != 'true'">$(MSBuildThisFileDirectory)AdvancedSharpAdbClient.WinRT.CoreApp.targets</TargetsPath>
6+
</PropertyGroup>
7+
<Import Project="$(TargetsPath)" Condition="Exists('$(TargetsPath)')"/>
8+
</Project>

logo.png

9.42 KB
Loading

0 commit comments

Comments
 (0)