From 8cc56cb10d204ec6bb18f7a4c8a7a9cd720b79a0 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Thu, 28 Jul 2016 18:45:28 +0900 Subject: Fix code for building with corefx Change-Id: Ie3f38bdf7bd8f2f23bd8c8ebef85906194a0d9cc Signed-off-by: WonYoung Choi --- .../CoreFx.References.targets | 265 +++++++++++++++++++++ .../Tizen.Network.IoTConnectivity.csproj | 3 +- .../IoTConnectivityClientManager.cs | 34 +-- .../RemoteResource.cs | 10 +- .../Representation.cs | 2 +- .../Tizen.Network.IoTConnectivity/Resource.cs | 2 +- .../Tizen.Network.IoTConnectivity/ResourceQuery.cs | 4 +- packaging/csapi-network-iotconnectivity.spec | 16 +- 8 files changed, 302 insertions(+), 34 deletions(-) create mode 100644 Tizen.Network.IoTConnectivity/CoreFx.References.targets diff --git a/Tizen.Network.IoTConnectivity/CoreFx.References.targets b/Tizen.Network.IoTConnectivity/CoreFx.References.targets new file mode 100644 index 0000000..dab29ec --- /dev/null +++ b/Tizen.Network.IoTConnectivity/CoreFx.References.targets @@ -0,0 +1,265 @@ + + + + + False + $(CoreFxPath)/Microsoft.Win32.Primitives.dll + + + False + $(CoreFxPath)/System.AppContext.dll + + + False + $(CoreFxPath)/System.Collections.Concurrent.dll + + + False + $(CoreFxPath)/System.Collections.dll + + + False + $(CoreFxPath)/System.ComponentModel.Annotations.dll + + + False + $(CoreFxPath)/System.ComponentModel.dll + + + False + $(CoreFxPath)/System.Console.dll + + + False + $(CoreFxPath)/System.Diagnostics.Debug.dll + + + False + $(CoreFxPath)/System.Diagnostics.Process.dll + + + False + $(CoreFxPath)/System.Diagnostics.Tools.dll + + + False + $(CoreFxPath)/System.Diagnostics.TraceSource.dll + + + False + $(CoreFxPath)/System.Diagnostics.Tracing.dll + + + False + $(CoreFxPath)/System.Dynamic.Runtime.dll + + + False + $(CoreFxPath)/System.Globalization.Calendars.dll + + + False + $(CoreFxPath)/System.Globalization.dll + + + False + $(CoreFxPath)/System.Globalization.Extensions.dll + + + False + $(CoreFxPath)/System.IO.Compression.dll + + + False + $(CoreFxPath)/System.IO.Compression.ZipFile.dll + + + False + $(CoreFxPath)/System.IO.dll + + + False + $(CoreFxPath)/System.IO.FileSystem.dll + + + False + $(CoreFxPath)/System.IO.FileSystem.Primitives.dll + + + False + $(CoreFxPath)/System.IO.FileSystem.Watcher.dll + + + False + $(CoreFxPath)/System.IO.MemoryMappedFiles.dll + + + False + $(CoreFxPath)/System.IO.UnmanagedMemoryStream.dll + + + False + $(CoreFxPath)/System.Linq.dll + + + False + $(CoreFxPath)/System.Linq.Expressions.dll + + + False + $(CoreFxPath)/System.Linq.Parallel.dll + + + False + $(CoreFxPath)/System.Linq.Queryable.dll + + + False + $(CoreFxPath)/System.Net.Http.dll + + + False + $(CoreFxPath)/System.Net.NameResolution.dll + + + False + $(CoreFxPath)/System.Net.Primitives.dll + + + False + $(CoreFxPath)/System.Net.Requests.dll + + + False + $(CoreFxPath)/System.Net.Security.dll + + + False + $(CoreFxPath)/System.Net.Sockets.dll + + + False + $(CoreFxPath)/System.Net.WebHeaderCollection.dll + + + False + $(CoreFxPath)/System.Numerics.Vectors.dll + + + False + $(CoreFxPath)/System.ObjectModel.dll + + + False + $(CoreFxPath)/System.Reflection.DispatchProxy.dll + + + False + $(CoreFxPath)/System.Reflection.dll + + + False + $(CoreFxPath)/System.Reflection.Extensions.dll + + + False + $(CoreFxPath)/System.Reflection.Primitives.dll + + + False + $(CoreFxPath)/System.Reflection.TypeExtensions.dll + + + False + $(CoreFxPath)/System.Resources.ResourceManager.dll + + + False + $(CoreFxPath)/System.Runtime.dll + + + False + $(CoreFxPath)/System.Runtime.Extensions.dll + + + False + $(CoreFxPath)/System.Runtime.Handles.dll + + + False + $(CoreFxPath)/System.Runtime.InteropServices.dll + + + False + $(CoreFxPath)/System.Runtime.InteropServices.RuntimeInformation.dll + + + False + $(CoreFxPath)/System.Runtime.Loader.dll + + + False + $(CoreFxPath)/System.Runtime.Numerics.dll + + + False + $(CoreFxPath)/System.Security.Cryptography.Algorithms.dll + + + False + $(CoreFxPath)/System.Security.Cryptography.Encoding.dll + + + False + $(CoreFxPath)/System.Security.Cryptography.Primitives.dll + + + False + $(CoreFxPath)/System.Security.Cryptography.X509Certificates.dll + + + False + $(CoreFxPath)/System.Text.Encoding.dll + + + False + $(CoreFxPath)/System.Text.Encoding.Extensions.dll + + + False + $(CoreFxPath)/System.Text.RegularExpressions.dll + + + False + $(CoreFxPath)/System.Threading.dll + + + False + $(CoreFxPath)/System.Threading.Tasks.dll + + + False + $(CoreFxPath)/System.Threading.Tasks.Parallel.dll + + + False + $(CoreFxPath)/System.Threading.Thread.dll + + + False + $(CoreFxPath)/System.Threading.ThreadPool.dll + + + False + $(CoreFxPath)/System.Threading.Timer.dll + + + False + $(CoreFxPath)/System.Xml.ReaderWriter.dll + + + False + $(CoreFxPath)/System.Xml.XDocument.dll + + + \ No newline at end of file diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj index 86d261a..0eb151d 100644 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj @@ -38,7 +38,8 @@ Tizen.Network.IoTConnectivity.snk - + + diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs index 846df77..dabec52 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs @@ -714,8 +714,8 @@ namespace Tizen.Network.IoTConnectivity PresenceReceivedEventArgs e = new PresenceReceivedEventArgs() { PresenceId = presenceId, - HostAddress = Marshal.PtrToStringAuto(host), - Type = Marshal.PtrToStringAuto(type), + HostAddress = Marshal.PtrToStringAnsi(host), + Type = Marshal.PtrToStringAnsi(type), EventType = (PresenceEventType)trigger }; @@ -757,10 +757,10 @@ namespace Tizen.Network.IoTConnectivity DeviceInformationFoundEventArgs e = new DeviceInformationFoundEventArgs() { RequestId = requestId, - Name = Marshal.PtrToStringAuto(name), - SpecVersion = Marshal.PtrToStringAuto(specVersion), - DeviceId = Marshal.PtrToStringAuto(deviceId), - DataModelVersion = Marshal.PtrToStringAuto(dataModelVersion) + Name = Marshal.PtrToStringAnsi(name), + SpecVersion = Marshal.PtrToStringAnsi(specVersion), + DeviceId = Marshal.PtrToStringAnsi(deviceId), + DataModelVersion = Marshal.PtrToStringAnsi(dataModelVersion) }; return e; @@ -850,17 +850,17 @@ namespace Tizen.Network.IoTConnectivity PlatformInformationFoundEventArgs e = new PlatformInformationFoundEventArgs() { RequestId = requestId, - PlatformId = (platformId != IntPtr.Zero) ? Marshal.PtrToStringAuto(platformId) : string.Empty, - ManufacturerName = (manufacturerName != IntPtr.Zero) ? Marshal.PtrToStringAuto(manufacturerName) : string.Empty, - ManufacturerURL = (manufacturerUrl != IntPtr.Zero) ? Marshal.PtrToStringAuto(manufacturerUrl) : string.Empty, - DateOfManufacture = (dateOfManufacture != IntPtr.Zero) ? Marshal.PtrToStringAuto(dateOfManufacture) : string.Empty, - ModelNumber = (modelNumber != IntPtr.Zero) ? Marshal.PtrToStringAuto(modelNumber) : string.Empty, - PlatformVersion = (platformVersion != IntPtr.Zero) ? Marshal.PtrToStringAuto(platformVersion) : string.Empty, - OsVersion = (osVersion != IntPtr.Zero) ? Marshal.PtrToStringAuto(osVersion) : string.Empty, - HardwareVersion = (hardwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAuto(hardwareVersion) : string.Empty, - FirmwareVersion = (firmwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAuto(firmwareVersion) : string.Empty, - SupportUrl = (supportUrl != IntPtr.Zero) ? Marshal.PtrToStringAuto(supportUrl) : string.Empty, - SystemTime = (systemTime != IntPtr.Zero) ? Marshal.PtrToStringAuto(systemTime) : string.Empty + PlatformId = (platformId != IntPtr.Zero) ? Marshal.PtrToStringAnsi(platformId) : string.Empty, + ManufacturerName = (manufacturerName != IntPtr.Zero) ? Marshal.PtrToStringAnsi(manufacturerName) : string.Empty, + ManufacturerURL = (manufacturerUrl != IntPtr.Zero) ? Marshal.PtrToStringAnsi(manufacturerUrl) : string.Empty, + DateOfManufacture = (dateOfManufacture != IntPtr.Zero) ? Marshal.PtrToStringAnsi(dateOfManufacture) : string.Empty, + ModelNumber = (modelNumber != IntPtr.Zero) ? Marshal.PtrToStringAnsi(modelNumber) : string.Empty, + PlatformVersion = (platformVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(platformVersion) : string.Empty, + OsVersion = (osVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(osVersion) : string.Empty, + HardwareVersion = (hardwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(hardwareVersion) : string.Empty, + FirmwareVersion = (firmwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(firmwareVersion) : string.Empty, + SupportUrl = (supportUrl != IntPtr.Zero) ? Marshal.PtrToStringAnsi(supportUrl) : string.Empty, + SystemTime = (systemTime != IntPtr.Zero) ? Marshal.PtrToStringAnsi(systemTime) : string.Empty }; return e; diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs index c861155..ecbdb36 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs @@ -716,7 +716,7 @@ namespace Tizen.Network.IoTConnectivity Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device name of remote resource"); throw IoTConnectivityErrorFactory.GetException(ret); } - DeviceName = Marshal.PtrToStringAuto(deviceName);*/ + DeviceName = Marshal.PtrToStringAnsi(deviceName);*/ } private void SetRemoteResource() @@ -773,10 +773,10 @@ namespace Tizen.Network.IoTConnectivity Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device name of remote resource"); throw IoTConnectivityErrorFactory.GetException(ret); } - DeviceName = Marshal.PtrToStringAuto(deviceName); - DeviceId = Marshal.PtrToStringAuto(deviceIdPtr); - HostAddress = Marshal.PtrToStringAuto(hostAddressPtr); - UriPath = Marshal.PtrToStringAuto(uriPathPtr); + DeviceName = Marshal.PtrToStringAnsi(deviceName); + DeviceId = Marshal.PtrToStringAnsi(deviceIdPtr); + HostAddress = Marshal.PtrToStringAnsi(hostAddressPtr); + UriPath = Marshal.PtrToStringAnsi(uriPathPtr); Types = new ResourceTypes(typesHandle); Interfaces = new ResourceInterfaces(interfacesHandle); Policy = (ResourcePolicy)policy; diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs index 52c5c29..fc5f1d4 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs @@ -90,7 +90,7 @@ namespace Tizen.Network.IoTConnectivity Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get uri"); throw IoTConnectivityErrorFactory.GetException(ret); } - return Marshal.PtrToStringAuto(path); + return Marshal.PtrToStringAnsi(path); } set { diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs index aeeefdd..2e96776 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs @@ -429,7 +429,7 @@ namespace Tizen.Network.IoTConnectivity return new Request() { - HostAddress = Marshal.PtrToStringAuto(hostAddressPtr), + HostAddress = Marshal.PtrToStringAnsi(hostAddressPtr), Options = opts, Query = query, Representation = representation diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs index afc3843..e672c85 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs @@ -91,7 +91,7 @@ namespace Tizen.Network.IoTConnectivity Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type"); throw IoTConnectivityErrorFactory.GetException(ret); } - return Marshal.PtrToStringAuto(type); + return Marshal.PtrToStringAnsi(type); } set { @@ -128,7 +128,7 @@ namespace Tizen.Network.IoTConnectivity Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface"); throw IoTConnectivityErrorFactory.GetException(ret); } - return Marshal.PtrToStringAuto(iface); + return Marshal.PtrToStringAnsi(iface); } set { diff --git a/packaging/csapi-network-iotconnectivity.spec b/packaging/csapi-network-iotconnectivity.spec index 7a19fe4..1d8a412 100755 --- a/packaging/csapi-network-iotconnectivity.spec +++ b/packaging/csapi-network-iotconnectivity.spec @@ -1,4 +1,5 @@ %{!?dotnet_assembly_path: %define dotnet_assembly_path %{_datadir}/assembly} +%{!?dotnet_core_path: %define dotnet_core_path %{_datadir}/tizen.net/ref} %if 0%{?tizen_build_devel_mode} %define BUILDCONF Debug @@ -20,15 +21,12 @@ Source1: %{name}.manifest BuildRequires: mono-compiler BuildRequires: mono-devel +# .NETCore %if 0%{?_with_corefx} AutoReqProv: no BuildRequires: corefx-managed-32b-ref %endif -# P/Invoke Build Requires -BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(iotcon) - # C# API Requires BuildRequires: csapi-tizen @@ -44,12 +42,17 @@ cp %{SOURCE1} . %build for ASM in %{Assemblies}; do xbuild $ASM/$ASM.csproj \ +%if 0%{?_with_corefx} + /p:NoStdLib=True \ + /p:TargetFrameworkVersion=v5.0 \ + /p:AddAdditionalExplicitAssemblyReferences=False \ + /p:CoreFxPath=%{dotnet_core_path} \ +%endif /p:Configuration=%{BUILDCONF} \ /p:ReferencePath=%{dotnet_assembly_path} done %install -# Assemblies mkdir -p %{buildroot}%{dotnet_assembly_path} for ASM in %{Assemblies}; do install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path} @@ -57,6 +60,5 @@ done %files %manifest %{name}.manifest -%attr(644,root,root) %{dotnet_assembly_path}/*.dll %license LICENSE - +%attr(644,root,root) %{dotnet_assembly_path}/*.dll -- cgit v1.2.3