Use nuget restore to solve dependencies
authorWonYoung Choi <wy80.choi@samsung.com>
Tue, 4 Oct 2016 04:40:33 +0000 (13:40 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Wed, 5 Oct 2016 09:39:28 +0000 (18:39 +0900)
Change-Id: I32b533b9bca86bac87e12f2c6c71ba09b06bfc4c

packaging/csapi-download.spec
src/Tizen.Content.Download/Tizen.Content.Download.Net45.csproj
src/Tizen.Content.Download/Tizen.Content.Download.Net45.project.json
src/Tizen.Content.Download/Tizen.Content.Download.csproj
src/Tizen.Content.Download/Tizen.Content.Download.nuspec
src/Tizen.Content.Download/Tizen.Content.Download.project.json

index cd35a69..20eb0fb 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:       csapi-download
 Summary:    Tizen Download API for C#
-Version:    1.0.0
+Version:    1.0.1
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -17,21 +16,16 @@ URL:        https://www.tizen.org
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 
-# Mono
+AutoReqProv: no
+
 BuildRequires: mono-compiler
 BuildRequires: mono-devel
 
-# .NETCore
-%if 0%{?_with_corefx}
-AutoReqProv: no
-BuildRequires: corefx-managed-32b-ref
-%endif
-
 BuildRequires: dotnet-build-tools
 
 # C# API Requires
-BuildRequires: csapi-tizen-devel
-BuildRequires: csapi-application-devel
+BuildRequires: csapi-tizen-nuget
+BuildRequires: csapi-application-nuget
 
 %description
 Tizen Download API for C#
@@ -43,42 +37,26 @@ cp %{SOURCE1} .
 %define Assemblies Tizen.Content.Download
 
 %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
 
@@ -87,22 +65,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 77b5287..cb60161 100644 (file)
@@ -49,7 +49,6 @@
     <None Include="Tizen.Content.Download.Net45.project.json" />\r
     <None Include="Tizen.Content.Download.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 02716e2..3910e25 100644 (file)
@@ -1,6 +1,6 @@
 {
   "dependencies": {
-    "Tizen.Applications": "1.0.0"
+    "Tizen.Applications": "1.0.1"
   },
   "frameworks": {
     "net45": {}
index f541d07..1530d9c 100644 (file)
@@ -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
@@ -56,7 +56,6 @@
     <None Include="Tizen.Content.Download.project.json" />\r
     <None Include="Tizen.Content.Download.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 2cdebe5..fc32922 100644 (file)
@@ -6,7 +6,11 @@
                <authors>Tizen Developers</authors>
                <description>Download API for Tizen.Net</description>
     <dependencies>
-      <dependency id="Tizen.Applications" version="1.0.0" />
+      <dependency id="Tizen.Applications" version="1.0.1" />
     </dependencies>
        </metadata>
+  <files>
+    <file src="bin/$Configuration$/Tizen.Content.Download.dll" target="lib/netstandard1.3" />
+    <file src="bin/$Configuration$/Net45/Tizen.Content.Download.dll" target="lib/net45" />
+  </files>
 </package>
index 2b4b410..dabc334 100644 (file)
@@ -1,12 +1,9 @@
 {
   "dependencies": {
     "NETStandard.Library": "1.6.0",
-    "Tizen.Applications": "1.0.0"
+    "Tizen.Applications": "1.0.1"
   },
   "frameworks": {
-    "netstandard1.6": {}
-  },
-  "runtimes": {
-    "win": {}
+    "netstandard1.3": {}
   }
 }