<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- UseTizenGBSImportAfterTarget -->
<PropertyGroup Condition="'$(UseTizenGBSImportAfterTarget)' == ''">
<UseTizenGBSImportAfterTarget>false</UseTizenGBSImportAfterTarget>
<UseTizenGBSImportAfterTarget Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Tizen'">true</UseTizenGBSImportAfterTarget>
</PropertyGroup>
- <!-- Set DocumentationFile -->
- <PropertyGroup Condition="'$(UseTizenGBSImportAfterTarget)' == 'true'">
- <DocumentationFile Condition="'$(DocumentationFile)' == ''">$(OutputPath)$(AssemblyName).xml</DocumentationFile>
- </PropertyGroup>
-
- <!-- Set TargetFramework -->
+ <!-- TargetFramework -->
<PropertyGroup Condition="'$(TargetFramework)' == ''">
<_ShortTargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">netstandard</_ShortTargetFrameworkIdentifier>
<_ShortTargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == 'Tizen'">tizen</_ShortTargetFrameworkIdentifier>
<TargetFramework Condition="'$(_ShortTargetFrameworkIdentifier)' != ''">$(_ShortTargetFrameworkIdentifier)$(_TargetFrameworkVersionWithoutV)</TargetFramework>
</PropertyGroup>
- <!-- NuSpec File -->
- <PropertyGroup>
- <NuSpecFile>$(MSBuildProjectDirectory)/$(AssemblyName).nuspec</NuSpecFile>
- </PropertyGroup>
-
- <!-- Additional files to append to .nuspec -->
- <ItemGroup>
- <NuGetAssemblyFile Include="$(OutputPath)$(TargetFileName)" />
- <NuGetAssemblyFile Include="$(DocumentationFile)" />
- </ItemGroup>
-
+ <!-- Modify BuildDependsOn -->
<PropertyGroup Condition="'$(UseTizenGBSImportAfterTarget)' == 'true'">
<BuildDependsOn>
- __AppendNuGetFiles;
$(BuildDependsOn);
- __CleanUpIntemediate;
__GenerateReferenceAssembly;
+ __AppendNuGetAssemblyFiles;
</BuildDependsOn>
</PropertyGroup>
- <!-- Cleanup Intermediate files after build -->
- <Target Name="__CleanUpIntemediate">
- <RemoveDir Directories="$(BaseIntermediateOutputPath)" />
- </Target>
-
- <!-- Append _NuGetFiles to .nuspec file -->
- <Target Name="__AppendNuGetFiles" Condition="Exists('$(NuSpecFile)')">
- <!--
- <Exec Command="dotnet-build nuspec_addfile "$(NuSpecFile)" "%(NuGetAssemblyFile.Identity)" "lib/$(TargetFramework)"" />
- -->
- </Target>
+ <!-- DocumentationFile -->
+ <PropertyGroup Condition="'$(UseTizenGBSImportAfterTarget)' == 'true'">
+ <DocumentationFile Condition="'$(DocumentationFile)' == ''">$(OutputPath)$(AssemblyName).xml</DocumentationFile>
+ </PropertyGroup>
+ <!-- GenAPI Properties -->
<PropertyGroup>
<_GenAPITargetDir>_ref</_GenAPITargetDir>
<_GenAPITargetSourcePath>$(_GenAPITargetDir)/$(TargetName).cs</_GenAPITargetSourcePath>
+ <_GenAPITargetAssemblyInfoPath>$(_GenAPITargetDir)/$(TargetName).AssemblyInfo.cs</_GenAPITargetAssemblyInfoPath>
<_GenAPITargetAssemblyPath>$(_GenAPITargetDir)/$(TargetName).dll</_GenAPITargetAssemblyPath>
<_GenAPIPath Condition="'$(_GenAPIPath)' == ''">/usr/share/dotnet-build-tools/GenAPI/GenAPI.exe</_GenAPIPath>
<_GenAPICommand>dotnet $(_GenAPIPath)</_GenAPICommand>
</PropertyGroup>
- <Target Name="__CreateAPIDirectory">
- <MakeDir Directories="$(_GenAPITargetDir)" />
+ <!-- NuSpec File -->
+ <PropertyGroup>
+ <NuSpecFile>$(MSBuildProjectDirectory)/$(AssemblyName).nuspec</NuSpecFile>
+ </PropertyGroup>
+
+ <!-- Additional files to append to .nuspec -->
+ <ItemGroup>
+ <NuGetAssemblyFile Include="$(DocumentationFile)">
+ <TargetPath>ref/$(TargetFramework)</TargetPath>
+ </NuGetAssemblyFile>
+ <NuGetAssemblyFile Include="$(OutputPath)$(TargetFileName)">
+ <TargetPath>lib/$(TargetFramework)</TargetPath>
+ </NuGetAssemblyFile>
+ <NuGetAssemblyFile Include="$(_GenAPITargetAssemblyPath)">
+ <TargetPath>ref/$(TargetFramework)</TargetPath>
+ </NuGetAssemblyFile>
+ </ItemGroup>
+
+ <!-- Append _NuGetFiles to .nuspec file -->
+ <Target Name="__AppendNuGetAssemblyFiles" Condition="Exists('$(NuSpecFile)')">
+ <Exec Command="dotnet-build nuspec_addfile "$(NuSpecFile)" "%(NuGetAssemblyFile.Identity)" "%(NuGetAssemblyFile.TargetPath)"" />
</Target>
<!-- Generate Reference Assembly .cs file -->
<Target Name="__GenerateReferenceAssemblySource"
Inputs="$(TargetPath)"
- Outputs="$(_GenAPITargetSourcePath)"
- DependsOnTargets="__CreateAPIDirectory">
+ Outputs="$(_GenAPITargetSourcePath)">
+
+ <MakeDir Directories="$(_GenAPITargetDir)" />
<ItemGroup>
<_referencePathDirectoriesWithDuplicates Include="%(ReferencePath.RootDir)%(ReferencePath.Directory)" />
<Exec Command="$(_GenAPICommand) -assembly:"$(TargetPath)" -libPath:"@(_referencePathDirectories)" -out:"$(_GenAPITargetSourcePath)" -throw -global" />
<ItemGroup>
+ <__RefCompile Include="$(_GenAPITargetSourcePath)"/>
<FileWrites Include="$(_GenAPITargetSourcePath)"/>
</ItemGroup>
+
</Target>
+ <!-- Generate AssemblyInfo.cs file -->
+ <Target Name="__GenerateAssemblyInfoSource"
+ Inputs="$(TargetPath)"
+ Outputs="$(_GenAPITargetAssemblyInfoPath)">
+
+ <GetAssemblyIdentity AssemblyFiles="$(TargetPath)" Condition="'$(AssemblyVersion)' == ''">
+ <Output TaskParameter="Assemblies" ItemName="__AssemblyInfo" />
+ </GetAssemblyIdentity>
+
+ <ItemGroup Condition="'$(AssemblyVersion)' == ''">
+ <AssemblyInfoLines Include="[assembly:System.Reflection.AssemblyVersion("%(__AssemblyInfo.Version)")]" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(AssemblyVersion)' != ''">
+ <AssemblyInfoLines Include="[assembly:System.Reflection.AssemblyVersion("$(AssemblyVersion)")]" />
+ </ItemGroup>
+
+ <WriteLinesToFile
+ File="$(_GenAPITargetAssemblyInfoPath)"
+ Lines="@(AssemblyInfoLines)"
+ Overwrite="true" />
+
+ <ItemGroup>
+ <__RefCompile Include="$(_GenAPITargetAssemblyInfoPath)" />
+ <FileWrites Include="$(_GenAPITargetAssemblyInfoPath)" />
+ </ItemGroup>
+
+ </Target>
+ <!-- Generate Reference Assembly .dll file -->
<Target Name="__GenerateReferenceAssembly"
- Inputs="$(_GenAPITargetSourcePath)"
+ Inputs="@(__RefCompile)"
Outputs="$(_GenAPITargetAssemblyPath)"
- DependsOnTargets="__GenerateReferenceAssemblySource">
+ DependsOnTargets="__GenerateReferenceAssemblySource;__GenerateAssemblyInfoSource">
- <Csc Condition="$(MSBuildToolsVersion) < 15"
- Sources="$(_GenAPITargetSourcePath)"
+ <!-- for ToolVersion 4.0 -->
+ <Csc Condition="'$(MSBuildAssemblyVersion)' == ''"
+ Sources="@(__RefCompile)"
OutputAssembly="$(_GenAPITargetAssemblyPath)"
AdditionalLibPaths="$(AdditionalLibPaths)"
AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)" />
- <Csc Condition="$(MSBuildToolsVersion) >= 15"
- Sources="$(_GenAPITargetSourcePath)"
+ <!-- for ToolVersion 15.0 -->
+ <Csc Condition="'$(MSBuildAssemblyVersion)' != ''"
+ Sources="@(__RefCompile)"
OutputAssembly="$(_GenAPITargetAssemblyPath)"
AdditionalLibPaths="$(AdditionalLibPaths)"
AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
%_with_corefx 1
%_dotnet_assembly_path /usr/share/dotnet.tizen/framework
-%_dotnet_assembly_ref_path /usr/share/dotnet.tizen/framework/ref
%_dotnet_nuget_source /nuget
###############################################################
%_dotnet_build_conf %{lua:if tonumber(rpm.expand("0%{?tizen_build_devel_mode}")) == 1 then print "Debug" else print "Release" end}
-%_nuget_package \
-%package nuget\
-Summary: NuGet package for %{name}\
-Group: Development/Libraries\
-%description nuget\
-NuGet package for %{name}\
-%files nuget\
-/nuget/*.nupkg\
-%{nil}
-
%dotnet_nuget_package(n:f:)\
%package %{-n:-n %{-n*}-}nuget\
Summary: NuGet package for %{-n:%{-n*}}%{!-n:%{name}}\
Group: Development/Libraries\
AutoReqProv: no\
%description %{-n:-n %{-n*}-}nuget\
-NuGet package for %{-n:%{-n*}}%{!-n:%{name}} \
+NuGet package for %{-n:%{-n*}}%{!-n:%{name}}\
%files %{-n:-n %{-n*}-}nuget\
/nuget/%{-f:%{-f*}}%{!-f:*.nupkg}\
%{nil}
-%dotnet_reference_package(n:)\
-%package %{-n:-n %{-n*}-}ref\
-Summary: Reference package for %{-n:%{-n*}}%{!-n:%{name}}\
-Group: Development/Libraries\
-AutoReqProv: no\
-%description %{-n:-n %{-n*}-}ref\
-Reference package for %{-n:%{-n*}}%{!-n:%{name}}\
-%files %{-n:-n %{-n*}-}ref\
-%{_dotnet_assembly_ref_path}/*.dll\
+%dotnet_sub_packages(n:f:) \
+%dotnet_nuget_package %{-n:-n %{-n*}} %{-f:-f %{-f*}} \
%{nil}
+######### keep for backward compatibilities ###########
%dotnet_import_sub_packages \
-%dotnet_nuget_package \
-%dotnet_reference_package \
+%dotnet_sub_packages \
%{nil}
-%dotnet_sub_packages(n:f:) \
-%dotnet_nuget_package %{-n:-n%{-n*}} %{-f:-f%{-f*}} \
-%dotnet_reference_package %{-n:-n%{-n*}} \
+%_nuget_package \
+%dotnet_nuget_package \
%{nil}
+#######################################################
%dotnet_restore(s:) \
dotnet-build -s %{-s:%{-s*}}%{!-s:%{_dotnet_nuget_source}} restore %{1} %{?2} %{?3} %{?4} %{?5} %{?6} \
dotnet-build -t assembly install %{1} %{buildroot}%{_dotnet_assembly_path} \
%{nil}
-%dotnet_install_reference() \
-dotnet-build -t reference install %{1} %{buildroot}%{_dotnet_assembly_ref_path} \
-
%dotnet_install_nuget() \
dotnet-build -t nupkg install %{1} %{buildroot}%{_dotnet_nuget_source} \
%{nil}
%dotnet_install() \
-dotnet-build -t assembly install %{1} %{buildroot}%{_dotnet_assembly_path} \
-dotnet-build -t reference install %{1} %{buildroot}%{_dotnet_assembly_ref_path} \
-dotnet-build -t nupkg install %{1} %{buildroot}%{_dotnet_nuget_source} \
+%{expand: %dotnet_install_assembly %%{1}} \
+%{expand: %dotnet_install_nuget %%{1}} \
%{nil}