From: WonYoung Choi Date: Sat, 3 Sep 2016 07:22:29 +0000 (+0900) Subject: Fix project files to support netstandard 1.6 X-Git-Tag: submit/trunk/20170823.075128~96^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2195b4d4ec9612db4c06ed8d851ef620d94208e2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Fix project files to support netstandard 1.6 Change-Id: I6b807149c0cec822db76b04a64aac16a16499965 Signed-off-by: WonYoung Choi --- diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..46619d5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +bin/ +obj/ +*.exe +*.dll +*.csproj.user +*.lock.json +.vs/ diff --git a/packaging/csapi-mime-type.spec b/packaging/csapi-mime-type.spec index 02f7bf2..51797cb 100755 --- a/packaging/csapi-mime-type.spec +++ b/packaging/csapi-mime-type.spec @@ -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 index 0000000..354de56 --- /dev/null +++ b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.csproj @@ -0,0 +1,72 @@ + + + + Debug + AnyCPU + {BF719F11-CDEA-4D04-A85B-4521A69E3614} + Library + Properties + Tizen.Content.MimeType + Tizen.Content.MimeType + 512 + v4.5 + + + true + full + false + bin\Debug\Net45\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\Net45\ + TRACE + prompt + 4 + false + + + true + + + Tizen.Content.MimeType.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 index 0000000..d9af4f0 --- /dev/null +++ b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.Net45.project.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "Tizen": "1.0.0" + }, + "frameworks": { + "net45": {} + }, + "runtimes": { + "win": {} + } +} diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj old mode 100755 new mode 100644 index a4886b7..06f62b6 --- a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj +++ b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj @@ -1,94 +1,81 @@ - - - - - Debug - AnyCPU - {3EE5842E-7004-43BC-825B-29FFDEC18D4E} - Library - Properties - Tizen.Content.MimeType - Tizen.Content.MimeType - v4.5 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - - - Tizen.Content.MimeType.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - csapi-tizen - ..\..\tizen\Tizen\obj\Debug\Tizen.dll - - - csapi-tizen - ..\..\tizen\Tizen.Internals\bin\Debug\Tizen.Internals.dll - - - - - {B9AA1CB2-F72D-4A30-A33B-A20C850A38A0} - Tizen.Internals - True - - - {7659CA59-410D-41A1-9841-586E88BC78C9} - Tizen - True - - - + + + + Debug + AnyCPU + {3EE5842E-7004-43BC-825B-29FFDEC18D4E} + Library + Properties + Tizen.Content.MimeType + Tizen.Content.MimeType + 512 + + + .NETStandard + v1.6 + .NETStandard,Version=v1.6 + false + true + $(NoWarn);1701;1702 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + + + Tizen.Content.MimeType.snk + + + + + + + + + + + + + + + + + - + --> + + + + <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) + <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) + true + + \ 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 index 0000000..48511f4 --- /dev/null +++ b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.nuspec @@ -0,0 +1,12 @@ + + + + Tizen.Content.MimeType + $version$ + Tizen Developers + MimeType API for Tizen.Net + + + + + 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 index 0000000..beb9e15 --- /dev/null +++ b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.project.json @@ -0,0 +1,12 @@ +{ + "dependencies": { + "NETStandard.Library": "1.6.0", + "Tizen": "1.0.0" + }, + "frameworks": { + "netstandard1.6": {} + }, + "runtimes": { + "win": {} + } +}