From: WonYoung Choi Date: Tue, 4 Oct 2016 04:24:13 +0000 (+0900) Subject: Add NuGet.BuildTasks X-Git-Tag: accepted/tizen/mobile/20161214.052222~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12f14b270abe4d3121e4e2355060b3a67a202c75;p=platform%2Fcore%2Fdotnet%2Fbuild-tools.git Add NuGet.BuildTasks Change-Id: I69625c4e5f96f4fe95de62abcaa00e311bf63350 --- diff --git a/packaging/dotnet-build-tools.spec b/packaging/dotnet-build-tools.spec index 8148f20..981af69 100644 --- a/packaging/dotnet-build-tools.spec +++ b/packaging/dotnet-build-tools.spec @@ -23,10 +23,23 @@ C# Deivce API with xbuild in GBS environment. %install # nuget +%define NuGetDir %{_datadir}/NuGet +mkdir -p %{buildroot}%{NuGetDir} mkdir -p %{buildroot}%{_bindir} -install -p -m 755 nuget/NuGet.exe %{buildroot}%{_bindir} -install -p -m 644 nuget/NuGet.Config %{buildroot} -ln -s %{_bindir}/NuGet.exe %{buildroot}%{_bindir}/nuget.exe +install -p -m 755 tools/nuget/* %{buildroot}%{NuGetDir} +ln -s %{NuGetDir}/nuget %{buildroot}%{_bindir}/nuget +ln -s %{NuGetDir}/NuGet.exe %{buildroot}%{_bindir}/nuget.exe + +# NuGet.BuildTasks +%define XBuildDir %{_libdir}/mono/xbuild +mkdir -p %{buildroot}%{XBuildDir}/Microsoft/NuGet +install -p -m 644 tasks/NuGet/Microsoft.NuGet.targets %{buildroot}%{XBuildDir}/Microsoft/NuGet +install -p -m 644 tasks/NuGet/Microsoft.NuGet.Build.Tasks.dll %{buildroot}%{XBuildDir}/Microsoft/NuGet +install -p -m 644 tasks/NuGet/Microsoft.NuGet.props %{buildroot}%{XBuildDir}/Microsoft/NuGet +mkdir -p %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportBefore +install -p -m 644 tasks/NuGet/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 tasks/NuGet/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportAfter # local nuget packages mkdir -p %{buildroot}/nuget @@ -40,12 +53,13 @@ ln -s %{_datadir}/dotnet-gbs/dotnet-gbs.py %{buildroot}/%{_bindir}/dotnet-gbs # Targets %define TargetDir %{_libdir}/mono/xbuild/Tizen mkdir -p %{buildroot}%{TargetDir} -install -p -m 644 targets/* %{buildroot}%{TargetDir} +install -p -m 644 tasks/GBS/* %{buildroot}%{TargetDir} %files %license LICENSE -/NuGet.Config %{_bindir}/* +%{NuGetDir}/* %{TargetDir}/* +%{XBuildDir}/* %{_datadir}/dotnet-gbs/* /nuget/*.nupkg diff --git a/targets/Tizen.CSharp.GBS.targets b/tasks/GBS/Tizen.CSharp.GBS.targets similarity index 100% rename from targets/Tizen.CSharp.GBS.targets rename to tasks/GBS/Tizen.CSharp.GBS.targets diff --git a/tasks/NuGet/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets b/tasks/NuGet/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets new file mode 100644 index 0000000..72ce25d --- /dev/null +++ b/tasks/NuGet/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets @@ -0,0 +1,17 @@ + + + + $(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.targets + + + diff --git a/tasks/NuGet/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props b/tasks/NuGet/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props new file mode 100644 index 0000000..a34517c --- /dev/null +++ b/tasks/NuGet/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props @@ -0,0 +1,17 @@ + + + + $(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.props + + + diff --git a/tasks/NuGet/Microsoft.NuGet.Build.Tasks.dll b/tasks/NuGet/Microsoft.NuGet.Build.Tasks.dll new file mode 100644 index 0000000..dd280df Binary files /dev/null and b/tasks/NuGet/Microsoft.NuGet.Build.Tasks.dll differ diff --git a/tasks/NuGet/Microsoft.NuGet.props b/tasks/NuGet/Microsoft.NuGet.props new file mode 100644 index 0000000..a3b4823 --- /dev/null +++ b/tasks/NuGet/Microsoft.NuGet.props @@ -0,0 +1,14 @@ + + + + diff --git a/tasks/NuGet/Microsoft.NuGet.targets b/tasks/NuGet/Microsoft.NuGet.targets new file mode 100644 index 0000000..42dbc16 --- /dev/null +++ b/tasks/NuGet/Microsoft.NuGet.targets @@ -0,0 +1,271 @@ + + + + + + <_ProjectSpecificProjectJsonFile>$(MSBuildProjectName).project.json + $(MSBuildProjectName).project.lock.json + project.lock.json + + + + true + + win10 + win + + true + $(TargetPlatformIdentifier),Version=v$([System.Version]::Parse('$(TargetPlatformMinVersion)').ToString(3)) + $(TargetFrameworkMoniker) + + true + true + + <_NuGetRuntimeIdentifierPlatformTargetSuffix Condition="'$(PlatformTarget)' != '' and '$(PlatformTarget)' != 'AnyCPU'">-$(PlatformTarget.ToLower()) + <_NuGetRuntimeIdentifierWithoutAot>$(BaseNuGetRuntimeIdentifier)$(_NuGetRuntimeIdentifierPlatformTargetSuffix) + + + + + $(_NuGetRuntimeIdentifierWithoutAot) + $(_NuGetRuntimeIdentifierWithoutAot)-aot + + + + + + + + + <_NuGetTargetFallbackMoniker>UAP,Version=v10.0 + false + false + true + + + + + + <_ProjectReferencingProjectJsonFile Include="$(MSBuildProjectFullPath)"> + @(ProjectReference) + $(MSBuildProjectDirectory)\project.json + + + + + + + + + + + + $(RootNamespace) + + + $(AssemblyName) + + + $(MSBuildProjectDirectory) + + + $(TargetFileName) + + + $(MSBuildProjectFile) + + + + + + $(ResolveAssemblyReferencesDependsOn);ResolveNuGetPackageAssets + ResolveNuGetPackageAssets;$(PrepareResourcesDependsOn) + + + + ResolveProjectReferences + $(ResolveNuGetPackageAssetsDependsOn);ImplicitlyExpandTargetFramework + + + + + + + + + + + + + %(_XProjTargetDirs.Identity) + + + + + + + + + + + + + + + + + + + <_ReferencesFromNuGetPackages Remove="%(ReferencePath.FileName)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandTargetFramework'" /> + + + + <_ResolvedProjectReferencePaths Include="@(_ReferencesFromNuGetPackages)" Condition="'%(_ReferencesFromNuGetPackages.NuGetSourceType)' == 'Project'" /> + + + + + + + + true + + + + + + + + + + + + + + + + + + %(NonAheadOfTimeRuntimeImplementations.FullPath) + %(NonAheadOfTimeRuntimeImplementations.FullPath) + + + + + + + .NETCore,Version=v5.0 + .NETCore,Version=v5.0 + <_ComputeNetCoreFrameworkInjectionParametersBeforeTargets Condition="'$(AppxPackage)' == 'true' and '$(TargetPlatformIdentifier)' == 'UAP'">BeforeGenerateProjectPriFile + + + + + <_PackagingOutputsIncludesFramework Condition="'%(PackagingOutputs.FileName)%(PackagingOutputs.Extension)' == 'System.Runtime.dll'">true + <_AppContainsManagedCodeForInjection Condition="'%(PackagingOutputs.Identity)' == '$(_TargetPlatformSdkDir)UnionMetadata\Windows.winmd'">true + + + + <_NetCoreFrameworkInjectionNeeded Condition="'$(_PackagingOutputsIncludesFramework)' != 'true' and '$(_AppContainsManagedCodeForInjection)' == 'true'">true + + + + + + + + + + + + + + @(_NuGetInjectionSourceDirectories->'%(Identity)\project.lock.json') + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\NuGet\Repository', 'NETCoreSDK', null, RegistryView.Registry32, RegistryView.Default)) + + + + + + + + + <_CoreRuntimePackageId Condition="'%(_InjectNetCoreFrameworkPayload.FileName)%(_InjectNetCoreFrameworkPayload.Extension)' == 'mscorlib.dll' OR '%(_InjectNetCoreFrameworkPayload.FileName)%(_InjectNetCoreFrameworkPayload.Extension)' == 'mscorlib.ni.dll'">%(_InjectNetCoreFrameworkPayload.NuGetPackageId) + + + + + %(Filename)%(Extension) + $(ProjectName) + CopyLocalFilesOutputGroup + + + + + + diff --git a/nuget/NuGet.Config b/tools/nuget/NuGet.Config similarity index 62% rename from nuget/NuGet.Config rename to tools/nuget/NuGet.Config index ed5910d..6ed4e83 100644 --- a/nuget/NuGet.Config +++ b/tools/nuget/NuGet.Config @@ -3,8 +3,5 @@ - - - diff --git a/nuget/NuGet.exe b/tools/nuget/NuGet.exe old mode 100755 new mode 100644 similarity index 100% rename from nuget/NuGet.exe rename to tools/nuget/NuGet.exe diff --git a/tools/nuget/nuget b/tools/nuget/nuget new file mode 100755 index 0000000..0d69009 --- /dev/null +++ b/tools/nuget/nuget @@ -0,0 +1,14 @@ +#!/bin/bash + +NUGET_DIR=/usr/share/NuGet + +CMD=$1 + +CONFIGFILE_OPTION="-configfile $NUGET_DIR/NuGet.Config" + +case $CMD in + pack|init|add|locals|mirror|help) + CONFIGFILE_OPTION="" +esac + +mono $NUGET_DIR/NuGet.exe $@ $CONFIGFILE_OPTION