Use nuget restore to solve dependencies
authorWonYoung Choi <wy80.choi@samsung.com>
Tue, 4 Oct 2016 14:21:02 +0000 (23:21 +0900)
committerChangjoon Baek <joon.c.baek@samsung.com>
Wed, 5 Oct 2016 23:49:48 +0000 (08:49 +0900)
Change-Id: Ic4232c0f07b934f18214538ec85b80f0ec60f733
Signed-off-by: WonYoung Choi <wy80.choi@samsung.com>
packaging/csapi-trace.spec
src/Tizen.Tracer/Tizen.Tracer.Net45.csproj
src/Tizen.Tracer/Tizen.Tracer.Net45.project.json
src/Tizen.Tracer/Tizen.Tracer.csproj
src/Tizen.Tracer/Tizen.Tracer.nuspec
src/Tizen.Tracer/Tizen.Tracer.project.json

index fa66794..a81739e 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-trace
 Summary:    Tizen Tracer API for C#
-Version:    1.0.0
+Version:    1.0.1
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -17,20 +16,15 @@ 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-tizen-nuget
 
 %description
 Tizen Tracer API for C#
@@ -42,42 +36,26 @@ cp %{SOURCE1} .
 %define Assemblies Tizen.Tracer
 
 %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
 
@@ -86,22 +64,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 775a346..4fd4b7a 100644 (file)
@@ -3,7 +3,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{20C210FC-AE4F-411F-9BA9-8DD900ED61DB}</ProjectGuid>
+    <ProjectGuid>{D6ED1942-9F12-4F29-BB73-60E90B2DC612}</ProjectGuid>
     <OutputType>Library</OutputType>
     <RootNamespace>Tizen.Tracer</RootNamespace>
     <AssemblyName>Tizen.Tracer</AssemblyName>
@@ -58,7 +58,6 @@
     <None Include="Tizen.Tracer.Net45.project.json" />
     <None Include="Tizen.Tracer.snk" />
   </ItemGroup>
-  <Import Project="$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets" Condition="Exists('$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets')" />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
        Other similar extension points exist, see Microsoft.Common.targets.
@@ -67,4 +66,4 @@
   <Target Name="AfterBuild">
   </Target>
   -->
-</Project>
\ No newline at end of file
+</Project>
index d9af4f0..ab1a0ee 100644 (file)
@@ -1,6 +1,6 @@
 {
   "dependencies": {
-    "Tizen": "1.0.0"
+    "Tizen": "1.0.1"
   },
   "frameworks": {
     "net45": {}
index 8a47d25..2c147ab 100644 (file)
@@ -1,79 +1,78 @@
-<?xml version="1.0" encoding="utf-8"?>\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
-    <ProjectGuid>{20C210FC-AE4F-411F-9BA9-8DD900ED61DB}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <RootNamespace>Tizen.Tracer</RootNamespace>\r
-    <AssemblyName>Tizen.Tracer</AssemblyName>\r
-    <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>\r
-    <TargetFrameworkVersion>v1.6</TargetFrameworkVersion>\r
-    <NuGetTargetMoniker>.NETStandard,Version=v1.6</NuGetTargetMoniker>\r
-    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
-    <NoStdLib>true</NoStdLib>\r
-    <NoWarn>$(NoWarn);1701;1702</NoWarn>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <Optimize>false</Optimize>\r
-    <OutputPath>bin\Debug\</OutputPath>\r
-    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <ConsolePause>false</ConsolePause>\r
-    <Prefer32Bit>false</Prefer32Bit>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Release\</OutputPath>\r
-    <DefineConstants>TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <ConsolePause>false</ConsolePause>\r
-    <Prefer32Bit>false</Prefer32Bit>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <AssemblyOriginatorKeyFile>Tizen.Tracer.snk</AssemblyOriginatorKeyFile>\r
-  </PropertyGroup>\r
-  <ItemGroup>\r
-    <Compile Include="Properties\AssemblyInfo.cs" />\r
-    <Compile Include="Interop\Interop.Libraries.cs" />\r
-    <Compile Include="Tizen\Tracer.cs" />\r
-    <Compile Include="Interop\Interop.Tracer.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <None Include="Tizen.Tracer.nuspec" />\r
-    <None Include="Tizen.Tracer.project.json" />\r
-    <None Include="Tizen.Tracer.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
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{20C210FC-AE4F-411F-9BA9-8DD900ED61DB}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>Tizen.Tracer</RootNamespace>
+    <AssemblyName>Tizen.Tracer</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v1.3</TargetFrameworkVersion>
+    <NuGetTargetMoniker>.NETStandard,Version=v1.3</NuGetTargetMoniker>
+    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+    <NoStdLib>true</NoStdLib>
+    <NoWarn>$(NoWarn);1701;1702</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>Tizen.Tracer.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Interop\Interop.Libraries.cs" />
+    <Compile Include="Tizen\Tracer.cs" />
+    <Compile Include="Interop\Interop.Tracer.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Tizen.Tracer.nuspec" />
+    <None Include="Tizen.Tracer.project.json" />
+    <None Include="Tizen.Tracer.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">
   </Target>
   <Target Name="AfterBuild">
   </Target>
-  -->\r
-  <PropertyGroup>\r
+  -->
+  <PropertyGroup>
     <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
        https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
-    -->\r
+    -->
     <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
        properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
        to prevent it from outputting a warning (MSB3644).
-    -->\r
-    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>\r
-    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>\r
-    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>\r
-  </PropertyGroup>\r
-</Project>
\ No newline at end of file
+    -->
+    <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
+    <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
+    <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
+  </PropertyGroup>
+</Project>
index 6ce0030..5e9f781 100644 (file)
@@ -6,7 +6,11 @@
                <authors>Tizen Developers</authors>
                <description>Tracing API for Tizen.Net</description>
     <dependencies>
-      <dependency id="Tizen" version="1.0.0" />
+      <dependency id="Tizen" version="1.0.1" />
     </dependencies>
        </metadata>
+  <files>
+    <file src="bin/$Configuration$/Tizen.Tracer.dll" target="lib/netstandard1.3" />
+    <file src="bin/$Configuration$/Net45/Tizen.Tracer.dll" target="lib/net45" />
+  </files>
 </package>
index beb9e15..db7436c 100644 (file)
@@ -1,12 +1,9 @@
 {
   "dependencies": {
     "NETStandard.Library": "1.6.0",
-    "Tizen": "1.0.0"
+    "Tizen": "1.0.1"
   },
   "frameworks": {
-    "netstandard1.6": {}
-  },
-  "runtimes": {
-    "win": {}
+    "netstandard1.3": {}
   }
 }