Updating project to use xbuild
authormanish.r <manish.r@samsung.com>
Mon, 4 Jul 2016 11:11:15 +0000 (16:41 +0530)
committermanish.r <manish.r@samsung.com>
Mon, 4 Jul 2016 11:11:15 +0000 (16:41 +0530)
Change-Id: I9d3a314a4c7b0d9eeef8a5c7bca49cb128b52f01
Signed-off-by: manish.r <manish.r@samsung.com>
packaging/csapi-mime-type.spec
src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj

index fb2b218..e84bac9 100755 (executable)
@@ -1,5 +1,4 @@
-%define dllpath %{_libdir}/mono/tizen
-%define dllname Tizen.Content.MimeType.dll
+%define BUILDCONF Debug
 
 Name:       csapi-mime-type
 Summary:    Tizen MimeType API for C#
@@ -12,15 +11,8 @@ Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 Source2:    %{name}.pc.in
 
-# TODO: replace mono-compiler, mono-devel to mcs, mono-shlib-cop
 BuildRequires: mono-compiler
 BuildRequires: mono-devel
-# TODO: replace mono-core to gacutil.
-#       mono-core should provide the symbol 'gacutil'
-Requires(post): mono-core
-Requires(postun): mono-core
-
-# P/Invoke Dependencies
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(capi-content-mime-type)
 BuildRequires: pkgconfig(csapi-tizen)
@@ -43,22 +35,10 @@ cp %{SOURCE1} .
 
 %build
 # build dll
-mcs -target:library -out:%{dllname} -keyfile:Tizen.Content.MimeType/Tizen.Content.MimeType.snk -pkg:'csapi-tizen'\
-  Tizen.Content.MimeType/Properties/AssemblyInfo.cs \
-  Tizen.Content.MimeType/Interop/*.cs \
-  Tizen.Content.MimeType/Tizen.Content.MimeType/*.cs
-
-# check p/invoke
-if [ -x %{dllname} ]; then
-  RET=`mono-shlib-cop %{dllname}`; \
-  CNT=`echo $RET | grep -E "^error:" | wc -l`; \
-  if [ $CNT -gt 0 ]; then exit 1; fi
-fi
+xbuild Tizen.Content.MimeType/Tizen.Content.MimeType.csproj /p:Configuration=%{BUILDCONF}
 
 %install
-# copy dll
-mkdir -p %{buildroot}%{dllpath}
-install -p -m 644 %{dllname} %{buildroot}%{dllpath}
+gacutil -i Tizen.Content.MimeType/bin/%{BUILDCONF}/Tizen.Content.MimeType.dll -root "%{buildroot}%{_libdir}" -package tizen
 
 # generate pkgconfig
 mkdir -p %{buildroot}%{_libdir}/pkgconfig
@@ -67,11 +47,9 @@ sed -e "s#@version@#%{version}#g" \
     -e "s#@dllname@#%{dllname}#g" \
     %{SOURCE2} > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
 
-%post
-gacutil -i %{dllpath}/%{dllname}
-
 %files
-%{dllpath}/%{dllname}
+%manifest %{name}.manifest
+%{_libdir}/mono/
 
 %files devel
 %{_libdir}/pkgconfig/%{name}.pc
index eb7ac76..4188483 100755 (executable)
@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Tizen.Content.MimeType</RootNamespace>
     <AssemblyName>Tizen.Content.MimeType</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>
@@ -21,6 +21,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -29,6 +30,7 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup>
     <SignAssembly>true</SignAssembly>
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-    <Reference Include="Tizen">
-      <HintPath>..\..\..\..\..\..\..\dll\usr\lib\mono\tizen\Tizen.dll</HintPath>
-    </Reference>
-    <Reference Include="Tizen.Internals">
-      <HintPath>..\..\..\..\..\..\..\dll\usr\lib\mono\tizen\Tizen.Internals.dll</HintPath>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Interop\Interop.Glib.cs" />
     <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" />
   <!-- 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.