From 0242be76d963d427be187c2e73f95b2fba497008 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Fri, 2 Sep 2016 14:29:04 +0900 Subject: [PATCH] Support netstandard 1.6 Change-Id: I11e356d4d13b2636a02e5976e744101dcddcc08e --- .gitignore | 1 - ElmSharp/ElmSharp.Net45.csproj | 160 +++++++++++++++++++++++++++++++ ElmSharp/ElmSharp.Net45.project.json | 8 ++ ElmSharp/ElmSharp.csproj | 169 +++++++++++++++++++++++++++++++++ ElmSharp/ElmSharp.project.json | 11 +++ ElmSharp/ElmSharp.xproj | 19 ---- ElmSharp/ElmSharp/Background.cs | 5 +- ElmSharp/Interop/Interop.Elementary.cs | 8 +- ElmSharp/Properties/AssemblyInfo.cs | 20 +--- ElmSharp/project.json | 16 ---- ElmSharpTest/ElmSharpTest.xproj.user | 6 ++ ElmSharpTest/project.json | 2 +- packaging/elm-sharp.spec | 45 +++++++-- 13 files changed, 404 insertions(+), 66 deletions(-) create mode 100644 ElmSharp/ElmSharp.Net45.csproj create mode 100644 ElmSharp/ElmSharp.Net45.project.json create mode 100644 ElmSharp/ElmSharp.csproj create mode 100644 ElmSharp/ElmSharp.project.json delete mode 100644 ElmSharp/ElmSharp.xproj delete mode 100644 ElmSharp/project.json create mode 100644 ElmSharpTest/ElmSharpTest.xproj.user diff --git a/.gitignore b/.gitignore index 4554980..46619d5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ obj/ *.exe *.dll *.csproj.user -*.xproj.user *.lock.json .vs/ diff --git a/ElmSharp/ElmSharp.Net45.csproj b/ElmSharp/ElmSharp.Net45.csproj new file mode 100644 index 0000000..a1d64ec --- /dev/null +++ b/ElmSharp/ElmSharp.Net45.csproj @@ -0,0 +1,160 @@ + + + + Debug + AnyCPU + {657E0754-FAF0-42B9-B9F5-45868826758E} + Library + Properties + ElmSharp + ElmSharp + 512 + v4.5 + + + true + full + true + bin\Debug\Net45\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\Net45\ + TRACE + prompt + 4 + true + + + true + + + ElmSharp.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ElmSharp/ElmSharp.Net45.project.json b/ElmSharp/ElmSharp.Net45.project.json new file mode 100644 index 0000000..5e1948a --- /dev/null +++ b/ElmSharp/ElmSharp.Net45.project.json @@ -0,0 +1,8 @@ +{ + "frameworks": { + "net45": {} + }, + "runtimes": { + "win": {} + } +} diff --git a/ElmSharp/ElmSharp.csproj b/ElmSharp/ElmSharp.csproj new file mode 100644 index 0000000..b9850d8 --- /dev/null +++ b/ElmSharp/ElmSharp.csproj @@ -0,0 +1,169 @@ + + + + Debug + AnyCPU + {7B15AF72-70CC-11E6-AE37-EB727F0BD84E} + Library + Properties + ElmSharp + ElmSharp + 512 + + + .NETStandard + v1.6 + .NETStandard,Version=v1.6 + false + true + $(NoWarn);1701;1702 + + + true + full + true + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + true + + + ElmSharp.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) + <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) + true + + \ No newline at end of file diff --git a/ElmSharp/ElmSharp.project.json b/ElmSharp/ElmSharp.project.json new file mode 100644 index 0000000..04ccf35 --- /dev/null +++ b/ElmSharp/ElmSharp.project.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "NETStandard.Library": "1.6.0", + }, + "frameworks": { + "netstandard1.6": {} + }, + "runtimes": { + "win": {} + } +} diff --git a/ElmSharp/ElmSharp.xproj b/ElmSharp/ElmSharp.xproj deleted file mode 100644 index 3f3adab..0000000 --- a/ElmSharp/ElmSharp.xproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - ba32f892-baaa-43ef-b9b8-bcf022c54321 - ElmSharp - .\obj - .\bin\ - - - - 2.0 - - - \ No newline at end of file diff --git a/ElmSharp/ElmSharp/Background.cs b/ElmSharp/ElmSharp/Background.cs index ae25349..25d4446 100644 --- a/ElmSharp/ElmSharp/Background.cs +++ b/ElmSharp/ElmSharp/Background.cs @@ -10,18 +10,17 @@ namespace ElmSharp public override Color Color { + //TO-DO: Consider to support alpha to elm_bg. get { int r; int g; int b; Interop.Elementary.elm_bg_color_get(Handle, out r, out g, out b); - Color value = base.Color; - return new Color(r, g, b, value.A); + return new Color(r, g, b); } set { - base.Color = value; Interop.Elementary.elm_bg_color_set(Handle, value.R, value.G, value.B); } } diff --git a/ElmSharp/Interop/Interop.Elementary.cs b/ElmSharp/Interop/Interop.Elementary.cs index 4e2cd42..6821173 100644 --- a/ElmSharp/Interop/Interop.Elementary.cs +++ b/ElmSharp/Interop/Interop.Elementary.cs @@ -74,6 +74,9 @@ internal static partial class Interop internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content); [DllImport(Libraries.Elementary)] + internal static extern IntPtr elm_object_part_content_get(IntPtr obj, string part); + + [DllImport(Libraries.Elementary)] internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content); [DllImport(Libraries.Elementary)] @@ -96,7 +99,10 @@ internal static partial class Interop internal static extern IntPtr elm_layout_add(IntPtr obj); [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_content_set(IntPtr obj, string swallow, IntPtr content); + internal static extern IntPtr elm_layout_content_get(IntPtr obj, string swallow); + + [DllImport(Libraries.Elementary)] + internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content); [DllImport(Libraries.Elementary)] internal static extern IntPtr elm_layout_content_unset(IntPtr obj, string swallow); diff --git a/ElmSharp/Properties/AssemblyInfo.cs b/ElmSharp/Properties/AssemblyInfo.cs index 98d44f9..8648f95 100644 --- a/ElmSharp/Properties/AssemblyInfo.cs +++ b/ElmSharp/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("EflSharp")] +[assembly: AssemblyTitle("ElmSharp")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EflSharp")] -[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyCompany("Samsung Electronics")] +[assembly: AssemblyProduct("ElmSharp")] +[assembly: AssemblyCopyright("Copyright (c) 2015 Samsung Electronics Co., Ltd")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -22,15 +22,5 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bfb6195c-3271-45e8-96fa-5872fa23c920")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] + diff --git a/ElmSharp/project.json b/ElmSharp/project.json deleted file mode 100644 index 0348ec5..0000000 --- a/ElmSharp/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "keyFile": "ElmSharp.snk", - "allowUnsafe": true - }, - "frameworks": { - "netcoreapp1.0": { - "imports": "dnxcore50", - "dependencies": { - "NETStandard.Library": "1.6.0" - } - }, - "net45": {} - } -} diff --git a/ElmSharpTest/ElmSharpTest.xproj.user b/ElmSharpTest/ElmSharpTest.xproj.user new file mode 100644 index 0000000..ce9011d --- /dev/null +++ b/ElmSharpTest/ElmSharpTest.xproj.user @@ -0,0 +1,6 @@ + + + + ElmSharpTest + + \ No newline at end of file diff --git a/ElmSharpTest/project.json b/ElmSharpTest/project.json index 4ecb49f..6262aea 100644 --- a/ElmSharpTest/project.json +++ b/ElmSharpTest/project.json @@ -4,7 +4,7 @@ "emitEntryPoint": true }, "dependencies": { - "ElmSharp": "1.0.0" + "ElmSharp": "1.0.0-*" }, "frameworks": { "netcoreapp1.0": { diff --git a/packaging/elm-sharp.spec b/packaging/elm-sharp.spec index 36add48..33ddd2f 100644 --- a/packaging/elm-sharp.spec +++ b/packaging/elm-sharp.spec @@ -17,6 +17,10 @@ URL: https://www.tizen.org Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest +# Mono +BuildRequires: mono-compiler +BuildRequires: mono-devel + # .NETCore %if 0%{?_with_corefx} AutoReqProv: no @@ -35,23 +39,44 @@ cp %{SOURCE1} . %define Assemblies ElmSharp %build -dotnet-gbs build %{Assemblies} \ +# Build for Net45 +for ASM in %{Assemblies}; do +if [ -e $ASM/$ASM.Net45.csproj ]; then + xbuild $ASM/$ASM.Net45.csproj \ + /p:Configuration=%{BUILDCONF} \ + /p:DotnetAssemblyPath=%{dotnet_assembly_path}/devel/net45 \ + /p:OutputPath=bin/net45 +fi + +# Build for Dotnet %if 0%{?_with_corefx} - --CoreFxPath=%{dotnet_core_path} \ +if [ -e $ASM/$ASM.csproj ]; then + xbuild $ASM/$ASM.csproj \ + /p:Configuration=%{BUILDCONF} \ + /p:DotnetAssemblyPath=%{dotnet_assembly_path}/devel/netstandard1.6 \ + /p:CoreFxPath=%{dotnet_core_path} \ + /p:OutputPath=bin/netstandard1.6 +fi %endif - --Configuration=%{BUILDCONF} \ - --DotnetAssemblyPath=%{dotnet_assembly_path} -dotnet-gbs pack %{Assemblies} --PackageVersion=%{version} +# Make NuGet package +dotnet-gbs pack $ASM/$ASM.nuspec --PackageVersion=%{version} --PackageFiles=$ASM/bin + +done %install -mkdir -p %{buildroot}%{dotnet_assembly_path} -dotnet-gbs install %{Assemblies} \ - --Configuration=%{BUILDCONF} \ - --InstallPath=%{buildroot}%{dotnet_assembly_path} +mkdir -p %{buildroot}%{dotnet_assembly_path}/devel +for ASM in %{Assemblies}; do + cp -fr $ASM/bin/* %{buildroot}%{dotnet_assembly_path}/devel +%if 0%{?_with_corefx} + install -p -m 644 $ASM/bin/netstandard1.6/$ASM.dll %{buildroot}%{dotnet_assembly_path} +%else + install -p -m 644 $ASM/bin/net45/$ASM.dll %{buildroot}%{dotnet_assembly_path} +%endif +done mkdir -p %{buildroot}/nuget -install -p -m 644 .nuget/*.nupkg %{buildroot}/nuget +install -p -m 644 *.nupkg %{buildroot}/nuget %files %manifest %{name}.manifest -- 2.7.4