Use nuget restore to solve dependencies
authorWonYoung Choi <wy80.choi@samsung.com>
Tue, 4 Oct 2016 06:39:10 +0000 (15:39 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Tue, 4 Oct 2016 12:36:47 +0000 (21:36 +0900)
Change-Id: I9541707be648a37c493dc2715b67dbe45611b888

packaging/elm-sharp.spec
src/ElmSharp/ElmSharp.Net45.csproj
src/ElmSharp/ElmSharp.csproj
src/ElmSharp/ElmSharp.nuspec
src/ElmSharp/ElmSharp.project.json
src/ElmSharp/ElmSharp/Color.cs
src/ElmSharp/ElmSharp/Image.cs
test/ElmSharp.Test/ElmSharp.Test.project.json

index e909818..34f2202 100644 (file)
@@ -1,5 +1,4 @@
 %{!?dotnet_assembly_path: %define dotnet_assembly_path /opt/usr/share/dotnet.tizen/framework}
-%{!?dotnet_core_path: %define dotnet_core_path %{_datadir}/tizen.net/ref}
 
 %if 0%{?tizen_build_devel_mode}
 %define BUILDCONF Debug
@@ -9,7 +8,7 @@
 
 Name:       elm-sharp
 Summary:    C# Binding for Elementary
-Version:    1.0.4
+Version:    1.0.5
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -17,16 +16,9 @@ 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
-BuildRequires: corefx-managed-32b-ref
-%endif
-
 BuildRequires: dotnet-build-tools
 
 %description
@@ -39,42 +31,26 @@ cp %{SOURCE1} .
 %define Assemblies ElmSharp
 
 %build
-# 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}
-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
-
-# Make NuGet package
-dotnet-gbs pack $ASM/$ASM.nuspec --PackageVersion=%{version} --PackageFiles=$ASM/bin
-
+# NuGet Restore
+find $ASM/*.project.json -exec nuget restore {} \;
+# Build
+find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \;
+# NuGet Pack
+nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF}
 done
 
 %install
-mkdir -p %{buildroot}%{dotnet_assembly_path}/devel
+# Runtime Binary
+mkdir -p %{buildroot}%{dotnet_assembly_path}
 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}
+  install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
 %else
-  install -p -m 644 $ASM/bin/net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
+  install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
 %endif
 done
-
+# NuGet
 mkdir -p %{buildroot}/nuget
 install -p -m 644 *.nupkg %{buildroot}/nuget
 
@@ -83,22 +59,9 @@ install -p -m 644 *.nupkg %{buildroot}/nuget
 %license LICENSE
 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
 
-%package devel
-Summary:   Development package for %{name}
-Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
-AutoReqProv: no
-
-%description devel
-Development package for %{name}
-
-%files devel
-%{dotnet_assembly_path}/devel/*
-
 %package nuget
 Summary:   NuGet package for %{name}
 Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
 
 %description nuget
 NuGet package for %{name}
index 92a8f32..f6d676e 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
     <None Include="ElmSharp.nuspec" />\r
     <None Include="ElmSharp.snk" />\r
   </ItemGroup>\r
-  <Import Project="$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets" Condition="Exists('$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets')" />\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\r
        Other similar extension points exist, see Microsoft.Common.targets.\r
index 8af1fd5..f5aabe1 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
@@ -12,8 +12,8 @@
   </PropertyGroup>\r
   <PropertyGroup>\r
     <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>\r
-    <TargetFrameworkVersion>v1.6</TargetFrameworkVersion>\r
-    <NuGetTargetMoniker>.NETStandard,Version=v1.6</NuGetTargetMoniker>\r
+    <TargetFrameworkVersion>v1.3</TargetFrameworkVersion>\r
+    <NuGetTargetMoniker>.NETStandard,Version=v1.3</NuGetTargetMoniker>\r
     <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
     <NoStdLib>true</NoStdLib>\r
     <NoWarn>$(NoWarn);1701;1702</NoWarn>\r
     <None Include="ElmSharp.project.json" />\r
     <None Include="ElmSharp.snk" />\r
   </ItemGroup>\r
-  <Import Project="$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets" Condition="Exists('$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets')" />\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\r
        Other similar extension points exist, see Microsoft.Common.targets.\r
index 7950b99..4a72702 100644 (file)
@@ -6,4 +6,8 @@
                <authors>Tizen Developers</authors>
                <description>C# Binding for Elementary</description>
        </metadata>
+  <files>
+    <file src="bin/$Configuration$/ElmSharp.dll" target="lib/netstandard1.3" />
+    <file src="bin/$Configuration$/Net45/ElmSharp.dll" target="lib/net45" />
+  </files>
 </package>
index 872bd5c..e8c7d8f 100644 (file)
@@ -3,9 +3,6 @@
     "NETStandard.Library": "1.6.0"
   },
   "frameworks": {
-    "netstandard1.6": {}
-  },
-  "runtimes": {
-    "win": {}
+    "netstandard1.3": {}
   }
 }
index 0843c95..004a66c 100644 (file)
@@ -88,6 +88,7 @@ namespace ElmSharp
             return FromUint(Convert.ToUInt32(hex.Replace("#", ""), 16));
         }
 
+        [CLSCompliant(false)]
         public static Color FromUint(uint argb)
         {
             return FromRgba((byte)((argb & 0x00ff0000) >> 0x10), (byte)((argb & 0x0000ff00) >> 0x8), (byte)(argb & 0x000000ff), (byte)((argb & 0xff000000) >> 0x18));
index 141623c..d90cd49 100644 (file)
@@ -218,6 +218,7 @@ namespace ElmSharp
             LoadingCompleted?.Invoke(this, EventArgs.Empty);
         }
        
+        [CLSCompliant(false)]
         public unsafe void Load(byte* img, long size)
         {
             bool ret = Interop.Elementary.elm_image_memfile_set(Handle, img, size, IntPtr.Zero, IntPtr.Zero);
index 33302d8..e6aacc0 100644 (file)
@@ -1,12 +1,12 @@
-{\r
-  "dependencies": {\r
-    "Microsoft.NETCore.App": "1.0.0",\r
-    "Tizen.Applications": "1.0.0"\r
-  },\r
-  "frameworks": {\r
-    "netcoreapp1.0": {}\r
-  },\r
-  "runtimes": {\r
-    "win": {}\r
-  }\r
-}
\ No newline at end of file
+{
+  "dependencies": {
+    "Microsoft.NETCore.App": "1.0.0",
+    "Tizen.Applications": "1.0.1"
+  },
+  "frameworks": {
+    "netcoreapp1.0": {}
+  },
+  "runtimes": {
+    "win": {}
+  }
+}