--- /dev/null
+{
+ "runtimeOptions": {
+ "tfm": "netcoreapp2.0",
+ "framework": {
+ "name": "Microsoft.NETCore.App",
+ "version": "2.0.0-*"
+ }
+ }
+}
--- /dev/null
+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.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
+ <PropertyGroup Condition="'$(UseTizenGBSImportAfterTarget)' == ''">
<UseTizenGBSImportAfterTarget>false</UseTizenGBSImportAfterTarget>
<UseTizenGBSImportAfterTarget Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == 'Tizen'">true</UseTizenGBSImportAfterTarget>
</PropertyGroup>
__AppendNuGetFiles;
$(BuildDependsOn);
__CleanUpIntemediate;
+ __GenerateReferenceAssembly;
</BuildDependsOn>
</PropertyGroup>
<!-- Append _NuGetFiles to .nuspec file -->
<Target Name="__AppendNuGetFiles" Condition="Exists('$(NuSpecFile)')">
+ <!--
<Exec Command="dotnet-build nuspec_addfile "$(NuSpecFile)" "%(NuGetAssemblyFile.Identity)" "lib/$(TargetFramework)"" />
+ -->
+ </Target>
+
+ <PropertyGroup>
+ <_GenAPITargetDir>_ref</_GenAPITargetDir>
+ <_GenAPITargetSourcePath>$(_GenAPITargetDir)/$(TargetName).cs</_GenAPITargetSourcePath>
+ <_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)" />
+ </Target>
+
+ <!-- Generate Reference Assembly .cs file -->
+ <Target Name="__GenerateReferenceAssemblySource"
+ Inputs="$(TargetPath)"
+ Outputs="$(_GenAPITargetSourcePath)"
+ DependsOnTargets="__CreateAPIDirectory">
+
+ <ItemGroup>
+ <_referencePathDirectoriesWithDuplicates Include="%(ReferencePath.RootDir)%(ReferencePath.Directory)" />
+ <_referencePathDirectories Include="%(_referencePathDirectoriesWithDuplicates.Identity)" />
+ </ItemGroup>
+
+ <Exec Command="$(_GenAPICommand) -assembly:"$(TargetPath)" -libPath:"@(_referencePathDirectories)" -out:"$(_GenAPITargetSourcePath)" -throw -global" />
+
+ <ItemGroup>
+ <FileWrites Include="$(_GenAPITargetSourcePath)"/>
+ </ItemGroup>
+ </Target>
+
+
+ <Target Name="__GenerateReferenceAssembly"
+ Inputs="$(_GenAPITargetSourcePath)"
+ Outputs="$(_GenAPITargetAssemblyPath)"
+ DependsOnTargets="__GenerateReferenceAssemblySource">
+
+ <Csc Condition="$(MSBuildToolsVersion) < 15"
+ Sources="$(_GenAPITargetSourcePath)"
+ OutputAssembly="$(_GenAPITargetAssemblyPath)"
+ AdditionalLibPaths="$(AdditionalLibPaths)"
+ AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
+ DefineConstants="$(DefineConstants)"
+ KeyFile="$(KeyOriginatorFile)"
+ TargetType="$(OutputType)"
+ NoStandardLib="$(NoCompilerStandardLib)"
+ References="@(ReferencePath)"
+ ToolExe="$(CscToolExe)"
+ ToolPath="$(CscToolPath)" />
+
+ <Csc Condition="$(MSBuildToolsVersion) >= 15"
+ Sources="$(_GenAPITargetSourcePath)"
+ OutputAssembly="$(_GenAPITargetAssemblyPath)"
+ AdditionalLibPaths="$(AdditionalLibPaths)"
+ AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
+ DefineConstants="$(DefineConstants)"
+ KeyFile="$(KeyOriginatorFile)"
+ PublicSign="$(PublicSign)"
+ TargetType="$(OutputType)"
+ NoStandardLib="$(NoCompilerStandardLib)"
+ References="@(ReferencePath)"
+ ToolExe="$(CscToolExe)"
+ ToolPath="$(CscToolPath)" />
+
+ <ItemGroup>
+ <FileWrites Include="$(_GenAPITargetAssemblyPath)"/>
+ </ItemGroup>
</Target>
</Project>
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
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
# 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}/*
%_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
###############################################################
/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:) \
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}