Fix project files to support netstandard 1.6
authorWonYoung Choi <wy80.choi@samsung.com>
Sat, 3 Sep 2016 07:22:29 +0000 (16:22 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Sat, 3 Sep 2016 07:22:29 +0000 (16:22 +0900)
Change-Id: I6b807149c0cec822db76b04a64aac16a16499965
Signed-off-by: WonYoung Choi <wy80.choi@samsung.com>
.gitignore [new file with mode: 0755]
packaging/csapi-mime-type.spec
src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.csproj [new file with mode: 0644]
src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.project.json [new file with mode: 0644]
src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj [changed mode: 0755->0644]
src/Tizen.Content.MimeType/Tizen.Content.MimeType.nuspec [new file with mode: 0644]
src/Tizen.Content.MimeType/Tizen.Content.MimeType.project.json [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100755 (executable)
index 0000000..46619d5
--- /dev/null
@@ -0,0 +1,7 @@
+bin/
+obj/
+*.exe
+*.dll
+*.csproj.user
+*.lock.json
+.vs/
index 02f7bf2..51797cb 100755 (executable)
@@ -1,4 +1,4 @@
-%{!?dotnet_assembly_path: %define dotnet_assembly_path %{_datadir}/assembly}
+%{!?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}
@@ -27,8 +27,10 @@ AutoReqProv: no
 BuildRequires: corefx-managed-32b-ref
 %endif
 
-# C# API Requires
-BuildRequires: csapi-tizen
+BuildRequires: dotnet-build-tools
+
+# C# API Requries
+BuildRequires: csapi-tizen-devel
 
 %description
 Tizen MimeType API for C#
@@ -40,25 +42,69 @@ cp %{SOURCE1} .
 %define Assemblies Tizen.Content.MimeType
 
 %build
+# Build for Net45
 for ASM in %{Assemblies}; do
-xbuild $ASM/$ASM.csproj \
+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}
-        /p:NoStdLib=True \
-        /p:TargetFrameworkVersion=v5.0 \
-        /p:AddAdditionalExplicitAssemblyReferences=False \
-        /p: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
-        /p:Configuration=%{BUILDCONF} \
-        /p:ReferencePath=%{dotnet_assembly_path}
+
+# Make NuGet package
+dotnet-gbs pack $ASM/$ASM.nuspec --PackageVersion=%{version} --PackageFiles=$ASM/bin
+
 done
 
 %install
-mkdir -p %{buildroot}%{dotnet_assembly_path}
+mkdir -p %{buildroot}%{dotnet_assembly_path}/devel
 for ASM in %{Assemblies}; do
-install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
+  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 *.nupkg %{buildroot}/nuget
+
 %files
 %manifest %{name}.manifest
 %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}
+
+%files nuget
+/nuget/*.nupkg
diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.csproj b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.csproj
new file mode 100644 (file)
index 0000000..354de56
--- /dev/null
@@ -0,0 +1,72 @@
+<?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>{BF719F11-CDEA-4D04-A85B-4521A69E3614}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>Tizen.Content.MimeType</RootNamespace>\r
+    <AssemblyName>Tizen.Content.MimeType</AssemblyName>\r
+    <FileAlignment>512</FileAlignment>\r
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\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\Net45\</OutputPath>\r
+    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\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\Net45\</OutputPath>\r
+    <DefineConstants>TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+    <Prefer32Bit>false</Prefer32Bit>\r
+  </PropertyGroup>\r
+  <PropertyGroup>\r
+    <SignAssembly>true</SignAssembly>\r
+  </PropertyGroup>\r
+  <PropertyGroup>\r
+    <AssemblyOriginatorKeyFile>Tizen.Content.MimeType.snk</AssemblyOriginatorKeyFile>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Reference Include="System" />\r
+    <Reference Include="System.Core" />\r
+    <Reference Include="System.Xml.Linq" />\r
+    <Reference Include="System.Data.DataSetExtensions" />\r
+    <Reference Include="Microsoft.CSharp" />\r
+    <Reference Include="System.Data" />\r
+    <Reference Include="System.Net.Http" />\r
+    <Reference Include="System.Xml" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="Interop\Interop.Glib.cs" />\r
+    <Compile Include="Interop\Interop.Libc.cs" />\r
+    <Compile Include="Interop\Interop.Libraries.cs" />\r
+    <Compile Include="Interop\Interop.Mime.cs" />\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <Compile Include="Tizen.Content.MimeType\MimeExceptionFactory.cs" />\r
+    <Compile Include="Tizen.Content.MimeType\MimeUtil.cs" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="Tizen.Content.MimeType.nuspec" />\r
+    <None Include="Tizen.Content.MimeType.Net45.project.json" />\r
+    <None Include="Tizen.Content.MimeType.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.
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->\r
+</Project>
\ No newline at end of file
diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.project.json b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.project.json
new file mode 100644 (file)
index 0000000..d9af4f0
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "dependencies": {
+    "Tizen": "1.0.0"
+  },
+  "frameworks": {
+    "net45": {}
+  },
+  "runtimes": {
+    "win": {}
+  }
+}
old mode 100755 (executable)
new mode 100644 (file)
index a4886b7..06f62b6
@@ -1,94 +1,81 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{3EE5842E-7004-43BC-825B-29FFDEC18D4E}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Tizen.Content.MimeType</RootNamespace>
-    <AssemblyName>Tizen.Content.MimeType</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <TargetFrameworkProfile />
-  </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>
-    <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>
-    <Prefer32Bit>false</Prefer32Bit>
-  </PropertyGroup>
-  <PropertyGroup>
-    <SignAssembly>true</SignAssembly>
-  </PropertyGroup>
-  <PropertyGroup>
-    <AssemblyOriginatorKeyFile>Tizen.Content.MimeType.snk</AssemblyOriginatorKeyFile>
-  </PropertyGroup>
-  <Import Project="CoreFx.References.targets" />
-  <ItemGroup Condition=" '$(CoreFxPath)' == '' ">
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Interop\Interop.Glib.cs" />
-    <Compile Include="Interop\Interop.Libc.cs" />
-    <Compile Include="Interop\Interop.Libraries.cs" />
-    <Compile Include="Interop\Interop.Mime.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Tizen.Content.MimeType\MimeExceptionFactory.cs" />
-    <Compile Include="Tizen.Content.MimeType\MimeUtil.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Tizen.Content.MimeType.snk" />
-  </ItemGroup>
-  <ItemGroup />
-  <ItemGroup>
-    <Reference Include="Tizen">
-      <PkgConfig>csapi-tizen</PkgConfig>
-      <HintPath>..\..\tizen\Tizen\obj\Debug\Tizen.dll</HintPath>
-    </Reference>
-    <Reference Include="Tizen.Internals">
-      <PkgConfig>csapi-tizen</PkgConfig>
-      <HintPath>..\..\tizen\Tizen.Internals\bin\Debug\Tizen.Internals.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\tizen\Tizen.Internals\Tizen.Internals.csproj">
-      <Project>{B9AA1CB2-F72D-4A30-A33B-A20C850A38A0}</Project>
-      <Name>Tizen.Internals</Name>
-      <Private>True</Private>
-    </ProjectReference>
-    <ProjectReference Include="..\..\tizen\Tizen\Tizen.csproj">
-      <Project>{7659CA59-410D-41A1-9841-586E88BC78C9}</Project>
-      <Name>Tizen</Name>
-      <Private>True</Private>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+<?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>{3EE5842E-7004-43BC-825B-29FFDEC18D4E}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>Tizen.Content.MimeType</RootNamespace>\r
+    <AssemblyName>Tizen.Content.MimeType</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
+    <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
+    <Prefer32Bit>false</Prefer32Bit>\r
+  </PropertyGroup>\r
+  <PropertyGroup>\r
+    <SignAssembly>true</SignAssembly>\r
+  </PropertyGroup>\r
+  <PropertyGroup>\r
+    <AssemblyOriginatorKeyFile>Tizen.Content.MimeType.snk</AssemblyOriginatorKeyFile>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Compile Include="Interop\Interop.Glib.cs" />\r
+    <Compile Include="Interop\Interop.Libc.cs" />\r
+    <Compile Include="Interop\Interop.Libraries.cs" />\r
+    <Compile Include="Interop\Interop.Mime.cs" />\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <Compile Include="Tizen.Content.MimeType\MimeExceptionFactory.cs" />\r
+    <Compile Include="Tizen.Content.MimeType\MimeUtil.cs" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="Tizen.Content.MimeType.nuspec" />\r
+    <None Include="Tizen.Content.MimeType.project.json" />\r
+    <None Include="Tizen.Content.MimeType.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.
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">
   </Target>
   <Target Name="AfterBuild">
   </Target>
-  -->
-</Project>
+  -->\r
+  <PropertyGroup>\r
+    <!-- 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
diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.nuspec b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.nuspec
new file mode 100644 (file)
index 0000000..48511f4
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<package>
+  <metadata>
+               <id>Tizen.Content.MimeType</id>
+               <version>$version$</version>
+               <authors>Tizen Developers</authors>
+               <description>MimeType API for Tizen.Net</description>
+    <dependencies>
+      <dependency id="Tizen" version="1.0.0" />
+    </dependencies>
+       </metadata>
+</package>
diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.project.json b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.project.json
new file mode 100644 (file)
index 0000000..beb9e15
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "dependencies": {
+    "NETStandard.Library": "1.6.0",
+    "Tizen": "1.0.0"
+  },
+  "frameworks": {
+    "netstandard1.6": {}
+  },
+  "runtimes": {
+    "win": {}
+  }
+}