Skip to content

Commit 9c72a09

Browse files
committed
Add FullTargets prop to support netcore and uap
1 parent 77b22cc commit 9c72a09

13 files changed

+35
-21
lines changed

AdvancedSharpAdbClient/AdbCommandLineClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public void StartServer()
130130
return;
131131
}
132132

133-
#if !NETSTANDARD1_3
133+
#if HAS_Process
134134
// Starting the adb server failed for whatever reason. This can happen if adb.exe
135135
// is running but is not accepting requests. In that case, try to kill it & start again.
136136
// It kills all processes named "adb", so let's hope nobody else named their process that way.

AdvancedSharpAdbClient/AdvancedSharpAdbClient.csproj

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
3+
<PropertyGroup Condition="'$(FullTargets)' == 'true'">
4+
<NoWarn>NU1603</NoWarn>
5+
<TargetFrameworks>net3.5-client;net4.0-client;net4.5.2;net4.6.2;net4.7.2;net4.8.1;net6.0;netcore50;netcoreapp3.1;netstandard1.3;netstandard2.0;uap10.0</TargetFrameworks>
6+
</PropertyGroup>
7+
8+
<PropertyGroup Condition="'$(FullTargets)' != 'true'">
49
<TargetFramework Condition="'$(GITHUB_ACTIONS)' == 'true'">netstandard2.0</TargetFramework>
510
<TargetFrameworks Condition="'$(GITHUB_ACTIONS)' != 'true' And '$(IsWindows)'">net3.5-client;net4.0-client;net4.5.2;net4.6.2;net4.7.2;net4.8.1;net6.0;netcoreapp3.1;netstandard1.3;netstandard2.0</TargetFrameworks>
611
<TargetFrameworks Condition="'$(GITHUB_ACTIONS)' != 'true' And !'$(IsWindows)'">net6.0;netcoreapp3.1;netstandard1.3;netstandard2.0</TargetFrameworks>
@@ -30,7 +35,8 @@
3035
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
3136
</ItemGroup>
3237

33-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
38+
<ItemGroup Condition="'$(TargetFramework)' == 'netcore50'
39+
or '$(TargetFramework)' == 'netstandard1.3'">
3440
<PackageReference Include="System.Buffers" Version="4.5.1" />
3541
<PackageReference Include="System.Drawing-dotnet-core" Version="1.2.3" />
3642
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
@@ -39,6 +45,7 @@
3945
</ItemGroup>
4046

4147
<ItemGroup Condition="'$(TargetFramework)' == 'net4.5.2'
48+
or '$(TargetFramework)' == 'netcore50'
4249
or '$(TargetFramework)' == 'netstandard1.3'">
4350
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.2" />
4451
</ItemGroup>
@@ -64,10 +71,16 @@
6471
and '$(TargetFramework)' != 'net4.0-client'">
6572
<DefineConstants>$(DefineConstants);HAS_LOGGER</DefineConstants>
6673
</PropertyGroup>
67-
74+
6875
<PropertyGroup Condition="'$(TargetFramework)' == 'net4.5.2'
76+
or '$(TargetFramework)' == 'netcore50'
6977
or '$(TargetFramework)' == 'netstandard1.3'">
7078
<DefineConstants>$(DefineConstants);HAS_OLDLOGGER</DefineConstants>
7179
</PropertyGroup>
7280

81+
<PropertyGroup Condition="'$(TargetFramework)' != 'netcore50'
82+
and '$(TargetFramework)' != 'netstandard1.3'">
83+
<DefineConstants>$(DefineConstants);HAS_Process</DefineConstants>
84+
</PropertyGroup>
85+
7386
</Project>

AdvancedSharpAdbClient/DeviceMonitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void Dispose()
158158
monitorTaskCancellationTokenSource.Cancel();
159159
monitorTask.Wait();
160160

161-
#if !NETSTANDARD1_3
161+
#if HAS_Process
162162
monitorTask.Dispose();
163163
#endif
164164
monitorTask = null;

AdvancedSharpAdbClient/Exceptions/AdbException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public AdbException(string message, AdbResponse response) : base(message)
5252
/// <param name="serializationInfo">The serialization info.</param>
5353
/// <param name="context">The context.</param>
5454
public AdbException(SerializationInfo serializationInfo, StreamingContext context) :
55-
#if !NETSTANDARD1_3
55+
#if HAS_Process
5656
base(serializationInfo, context)
5757
#else
5858
base(serializationInfo.GetString("Message"))
5959
#endif
6060
{
61-
#if NETSTANDARD1_3
61+
#if !HAS_Process
6262
HelpLink = serializationInfo.GetString("HelpURL"); // Do not rename (binary serialization)
6363
HResult = serializationInfo.GetInt32("HResult"); // Do not rename (binary serialization)
6464
Source = serializationInfo.GetString("Source"); // Do not rename (binary serialization)

AdvancedSharpAdbClient/Exceptions/CommandAbortingException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public CommandAbortingException(string message) : base(message)
3333
/// <param name="serializationInfo">The serialization info.</param>
3434
/// <param name="context">The context.</param>
3535
public CommandAbortingException(SerializationInfo serializationInfo, StreamingContext context) :
36-
#if !NETSTANDARD1_3
36+
#if HAS_Process
3737
base(serializationInfo, context)
3838
#else
3939
base(serializationInfo.GetString("Message"))
4040
#endif
4141
{
42-
#if NETSTANDARD1_3
42+
#if !HAS_Process
4343
HelpLink = serializationInfo.GetString("HelpURL"); // Do not rename (binary serialization)
4444
HResult = serializationInfo.GetInt32("HResult"); // Do not rename (binary serialization)
4545
Source = serializationInfo.GetString("Source"); // Do not rename (binary serialization)

AdvancedSharpAdbClient/Exceptions/PackageInstallationException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ public PackageInstallationException(string message, Exception inner) : base(mess
4545
/// <exception cref="ArgumentNullException">The <paramref name="info"/> parameter is null.</exception>
4646
/// <exception cref="SerializationException">The class name is null or <see cref="Exception.HResult"/> is zero (0).</exception>
4747
protected PackageInstallationException(SerializationInfo info, StreamingContext context) :
48-
#if !NETSTANDARD1_3
48+
#if HAS_Process
4949
base(info, context)
5050
#else
5151
base(info.GetString("Message"))
5252
#endif
5353
{
54-
#if NETSTANDARD1_3
54+
#if !HAS_Process
5555
HelpLink = info.GetString("HelpURL"); // Do not rename (binary serialization)
5656
HResult = info.GetInt32("HResult"); // Do not rename (binary serialization)
5757
Source = info.GetString("Source"); // Do not rename (binary serialization)

AdvancedSharpAdbClient/Exceptions/PermissionDeniedException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public PermissionDeniedException(string message) : base(message)
3333
/// <param name="serializationInfo">The serialization info.</param>
3434
/// <param name="context">The context.</param>
3535
public PermissionDeniedException(SerializationInfo serializationInfo, StreamingContext context) :
36-
#if !NETSTANDARD1_3
36+
#if HAS_Process
3737
base(serializationInfo, context)
3838
#else
3939
base(serializationInfo.GetString("Message"))
4040
#endif
4141
{
42-
#if NETSTANDARD1_3
42+
#if !HAS_Process
4343
HelpLink = serializationInfo.GetString("HelpURL"); // Do not rename (binary serialization)
4444
HResult = serializationInfo.GetInt32("HResult"); // Do not rename (binary serialization)
4545
Source = serializationInfo.GetString("Source"); // Do not rename (binary serialization)

AdvancedSharpAdbClient/Exceptions/UnknownOptionException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public UnknownOptionException(string message) : base(message)
3333
/// <param name="serializationInfo">The serialization info.</param>
3434
/// <param name="context">The context.</param>
3535
public UnknownOptionException(SerializationInfo serializationInfo, StreamingContext context) :
36-
#if !NETSTANDARD1_3
36+
#if HAS_Process
3737
base(serializationInfo, context)
3838
#else
3939
base(serializationInfo.GetString("Message"))
4040
#endif
4141
{
42-
#if NETSTANDARD1_3
42+
#if !HAS_Process
4343
HelpLink = serializationInfo.GetString("HelpURL"); // Do not rename (binary serialization)
4444
HResult = serializationInfo.GetInt32("HResult"); // Do not rename (binary serialization)
4545
Source = serializationInfo.GetString("Source"); // Do not rename (binary serialization)

AdvancedSharpAdbClient/Extensions/CrossPlatformFunc.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static class CrossPlatformFunc
2525
/// <returns>The return code of the process.</returns>
2626
public static Func<string, string, List<string>, List<string>, int> RunProcess = (string filename, string command, List<string> errorOutput, List<string> standardOutput) =>
2727
{
28-
#if !NETSTANDARD1_3
28+
#if HAS_Process
2929
ProcessStartInfo psi = new(filename, command)
3030
{
3131
CreateNoWindow = true,

AdvancedSharpAdbClient/Extensions/TaskToApm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETSTANDARD1_3
1+
#if !HAS_Process
22
// Licensed to the .NET Foundation under one or more agreements.
33
// The .NET Foundation licenses this file to you under the MIT license.
44

0 commit comments

Comments
 (0)