From: WonYoung Choi Date: Thu, 27 Apr 2017 05:23:17 +0000 (+0900) Subject: Genereate ref sub package for reference assemblies X-Git-Tag: submit/tizen/20170427.082929^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51ad6b4df39d88307eaff535b85d14fc980eb5bb;p=platform%2Fcore%2Fdotnet%2Fbuild-tools.git Genereate ref sub package for reference assemblies Change-Id: Ib3379ca6e42ecaa6751b0d541279499ea3232a9b --- diff --git a/GenAPI/GenAPI.exe b/GenAPI/GenAPI.exe new file mode 100755 index 00000000..55a3548c Binary files /dev/null and b/GenAPI/GenAPI.exe differ diff --git a/GenAPI/GenAPI.runtimeconfig.json b/GenAPI/GenAPI.runtimeconfig.json new file mode 100644 index 00000000..9b04e483 --- /dev/null +++ b/GenAPI/GenAPI.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp2.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "2.0.0-*" + } + } +} diff --git a/GenAPI/LICENSE b/GenAPI/LICENSE new file mode 100644 index 00000000..56e51b1c --- /dev/null +++ b/GenAPI/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/GenAPI/Microsoft.Cci.Extensions.dll b/GenAPI/Microsoft.Cci.Extensions.dll new file mode 100755 index 00000000..aa7d7f80 Binary files /dev/null and b/GenAPI/Microsoft.Cci.Extensions.dll differ diff --git a/GenAPI/Microsoft.Cci.dll b/GenAPI/Microsoft.Cci.dll new file mode 100755 index 00000000..0956d9a9 Binary files /dev/null and b/GenAPI/Microsoft.Cci.dll differ diff --git a/LICENSE.NuGet b/LICENSE.NuGet deleted file mode 100644 index 6bfd8f90..00000000 --- a/LICENSE.NuGet +++ /dev/null @@ -1,14 +0,0 @@ -NuGet.BuildTasks - -Copyright (c) .NET Foundation. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -these files except in compliance with the License. You may obtain a copy of the -License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. diff --git a/NuGet/LICENSE b/NuGet/LICENSE new file mode 100644 index 00000000..6bfd8f90 --- /dev/null +++ b/NuGet/LICENSE @@ -0,0 +1,14 @@ +NuGet.BuildTasks + +Copyright (c) .NET Foundation. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +these files except in compliance with the License. You may obtain a copy of the +License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. diff --git a/Tizen.GBS.BuildTasks/Tizen.GBS.ImportAfter.targets b/Tizen.GBS.BuildTasks/Tizen.GBS.ImportAfter.targets index 84830163..dbf32d56 100644 --- a/Tizen.GBS.BuildTasks/Tizen.GBS.ImportAfter.targets +++ b/Tizen.GBS.BuildTasks/Tizen.GBS.ImportAfter.targets @@ -1,6 +1,6 @@ - + false true @@ -34,6 +34,7 @@ __AppendNuGetFiles; $(BuildDependsOn); __CleanUpIntemediate; + __GenerateReferenceAssembly; @@ -44,7 +45,77 @@ + + + + + <_GenAPITargetDir>_ref + <_GenAPITargetSourcePath>$(_GenAPITargetDir)/$(TargetName).cs + <_GenAPITargetAssemblyPath>$(_GenAPITargetDir)/$(TargetName).dll + <_GenAPIPath Condition="'$(_GenAPIPath)' == ''">/usr/share/dotnet-build-tools/GenAPI/GenAPI.exe + <_GenAPICommand>dotnet $(_GenAPIPath) + + + + + + + + + + + <_referencePathDirectoriesWithDuplicates Include="%(ReferencePath.RootDir)%(ReferencePath.Directory)" /> + <_referencePathDirectories Include="%(_referencePathDirectoriesWithDuplicates.Identity)" /> + + + + + + + + + + + + + + + + + + + diff --git a/Tools/dotnet-build.sh b/Tools/dotnet-build.sh index 11909494..202aa246 100755 --- a/Tools/dotnet-build.sh +++ b/Tools/dotnet-build.sh @@ -126,6 +126,8 @@ cmd_install() { if [[ $TYPE == "assembly" ]]; then find $PROJECT/bin -name $PROJECT.dll -exec install -p -m 644 {} $DEST \; + elif [[ $TYPE == "reference" ]]; then + find $PROJECT/_ref -name $PROJECT.dll -exec install -p -m 644 {} $DEST \; elif [[ $TYPE == "nupkg" ]]; then find . -name "$PROJECT.[0-9]*.nupkg" -exec install -p -m 644 {} $DEST \; fi diff --git a/packaging/dotnet-build-tools.spec b/packaging/dotnet-build-tools.spec index b4517d75..cc565e8e 100644 --- a/packaging/dotnet-build-tools.spec +++ b/packaging/dotnet-build-tools.spec @@ -28,10 +28,11 @@ Requires: xmlstarlet Build target files (.Targets) and Tools (including NuGet.exe) for building C# Deivce API with xbuild in GBS environment. -%define XBuildDir /usr/lib/mono/xbuild -%define NuGetDir %{_datadir}/NuGet -%define ToolsDir %{_datadir}/dotnet-build-tools -%define CLI_PATH %{_datadir}/dotnet-build-tools/cli +%define XBUILD_PATH /usr/lib/mono/xbuild +%define NUGET_PATH %{_datadir}/NuGet +%define TOOLS_PATH %{_datadir}/dotnet-build-tools +%define CLI_PATH %{TOOLS_PATH}/cli +%define GENAPI_PATH %{TOOLS_PATH}/GenAPI %prep %setup -q @@ -55,40 +56,44 @@ install -D -p -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/rpm/macros.dotnet-build- # BuildTools mkdir -p %{buildroot}%{_bindir} -mkdir -p %{buildroot}%{ToolsDir} -install -p -m 755 Tools/* %{buildroot}%{ToolsDir} -ln -s %{ToolsDir}/dotnet-build.sh %{buildroot}%{_bindir}/dotnet-build +mkdir -p %{buildroot}%{TOOLS_PATH} +install -p -m 755 Tools/* %{buildroot}%{TOOLS_PATH} +ln -s %{TOOLS_PATH}/dotnet-build.sh %{buildroot}%{_bindir}/dotnet-build # dotnet-cli mkdir -p %{buildroot}%{CLI_PATH} cp -fr ./dotnet/* %{buildroot}%{CLI_PATH} ln -s %{CLI_PATH}/dotnet %{buildroot}%{_bindir}/dotnet +# GenAPI +mkdir -p %{buildroot}%{GENAPI_PATH} +install -p -m 644 GenAPI/* %{buildroot}%{GENAPI_PATH} + # Tizen.GBS.BuildTasks -mkdir -p %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportAfter -install -p -m 644 Tizen.GBS.BuildTasks/Tizen.GBS.ImportAfter.targets %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportAfter +mkdir -p %{buildroot}%{XBUILD_PATH}/14.0/Microsoft.Common.targets/ImportAfter +install -p -m 644 Tizen.GBS.BuildTasks/Tizen.GBS.ImportAfter.targets %{buildroot}%{XBUILD_PATH}/14.0/Microsoft.Common.targets/ImportAfter install -p -m 644 Tizen.GBS.BuildTasks/Tizen.GBS.ImportAfter.targets %{buildroot}%{CLI_PATH}/sdk/*/15.0/Microsoft.Common.targets/ImportAfter # NuGet -mkdir -p %{buildroot}%{NuGetDir} -install -p -m 755 NuGet/* %{buildroot}%{NuGetDir} -ln -s %{NuGetDir}/nuget %{buildroot}%{_bindir}/nuget -ln -s %{NuGetDir}/NuGet.exe %{buildroot}%{_bindir}/nuget.exe +mkdir -p %{buildroot}%{NUGET_PATH} +install -p -m 755 NuGet/* %{buildroot}%{NUGET_PATH} +ln -s %{NUGET_PATH}/nuget %{buildroot}%{_bindir}/nuget +ln -s %{NUGET_PATH}/NuGet.exe %{buildroot}%{_bindir}/nuget.exe # NuGet.BuildTasks -mkdir -p %{buildroot}%{XBuildDir}/Microsoft/NuGet -install -p -m 644 NuGet.BuildTasks/Microsoft.NuGet.targets %{buildroot}%{XBuildDir}/Microsoft/NuGet -install -p -m 644 NuGet.BuildTasks/Microsoft.NuGet.Build.Tasks.dll %{buildroot}%{XBuildDir}/Microsoft/NuGet -install -p -m 644 NuGet.BuildTasks/Microsoft.NuGet.props %{buildroot}%{XBuildDir}/Microsoft/NuGet -mkdir -p %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportBefore -install -p -m 644 NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportBefore -mkdir -p %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportAfter -install -p -m 644 NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportAfter +mkdir -p %{buildroot}%{XBUILD_PATH}/Microsoft/NuGet +install -p -m 644 NuGet.BuildTasks/Microsoft.NuGet.targets %{buildroot}%{XBUILD_PATH}/Microsoft/NuGet +install -p -m 644 NuGet.BuildTasks/Microsoft.NuGet.Build.Tasks.dll %{buildroot}%{XBUILD_PATH}/Microsoft/NuGet +install -p -m 644 NuGet.BuildTasks/Microsoft.NuGet.props %{buildroot}%{XBUILD_PATH}/Microsoft/NuGet +mkdir -p %{buildroot}%{XBUILD_PATH}/14.0/Microsoft.Common.targets/ImportBefore +install -p -m 644 NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props %{buildroot}%{XBUILD_PATH}/14.0/Microsoft.Common.targets/ImportBefore +mkdir -p %{buildroot}%{XBUILD_PATH}/14.0/Microsoft.Common.targets/ImportAfter +install -p -m 644 NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets %{buildroot}%{XBUILD_PATH}/14.0/Microsoft.Common.targets/ImportAfter %files -%license LICENSE.NuGet +%license NuGet/LICENSE GenAPI/LICENSE %config(noreplace) %{_sysconfdir}/rpm/macros.dotnet-build-tools %{_bindir}/* -%{NuGetDir}/* -%{XBuildDir}/* -%{ToolsDir}/* +%{NUGET_PATH}/* +%{XBUILD_PATH}/* +%{TOOLS_PATH}/* diff --git a/packaging/macros.dotnet-build-tools b/packaging/macros.dotnet-build-tools index 6a0eb64b..2e48d6a6 100644 --- a/packaging/macros.dotnet-build-tools +++ b/packaging/macros.dotnet-build-tools @@ -6,6 +6,7 @@ %_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 ############################################################### @@ -26,8 +27,36 @@ NuGet package for %{name}\ /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}} \ +%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\ +%{nil} + %dotnet_import_sub_packages \ -%_nuget_package \ +%dotnet_nuget_package \ +%dotnet_reference_package \ +%{nil} + +%dotnet_sub_packages(n:f:) \ +%dotnet_nuget_package %{-n:-n%{-n*}} %{-f:-f%{-f*}} \ +%dotnet_reference_package %{-n:-n%{-n*}} \ %{nil} %dotnet_restore(s:) \ @@ -46,11 +75,15 @@ dotnet-build -c %{_dotnet_build_conf} %{?2:-v %{2}} pack %{1} %{?3} %{?4} %{?5} 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} \ %{nil}