From: Wonyoung Choi Date: Mon, 2 Apr 2018 07:20:10 +0000 (+0900) Subject: Remove mono dependency X-Git-Tag: accepted/tizen/unified/20180403.060159~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d45d8dbee2c97e591305c0a842e4dbec738bf8ef;p=platform%2Fcore%2Fdotnet%2Fbuild-tools.git Remove mono dependency Change-Id: I2998a0c7bca1a905b9084ec68f47562238ea0620 --- diff --git a/NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets b/NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets deleted file mode 100644 index 72ce25d..0000000 --- a/NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter.targets +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.targets - - - diff --git a/NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props b/NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props deleted file mode 100644 index a34517c..0000000 --- a/NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportBefore.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.props - - - diff --git a/NuGet.BuildTasks/Microsoft.NuGet.Build.Tasks.dll b/NuGet.BuildTasks/Microsoft.NuGet.Build.Tasks.dll deleted file mode 100644 index dd280df..0000000 Binary files a/NuGet.BuildTasks/Microsoft.NuGet.Build.Tasks.dll and /dev/null differ diff --git a/NuGet.BuildTasks/Microsoft.NuGet.props b/NuGet.BuildTasks/Microsoft.NuGet.props deleted file mode 100644 index a3b4823..0000000 --- a/NuGet.BuildTasks/Microsoft.NuGet.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/NuGet.BuildTasks/Microsoft.NuGet.targets b/NuGet.BuildTasks/Microsoft.NuGet.targets deleted file mode 100644 index 42dbc16..0000000 --- a/NuGet.BuildTasks/Microsoft.NuGet.targets +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - <_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/LICENSE b/NuGet/LICENSE deleted file mode 100644 index 6bfd8f9..0000000 --- a/NuGet/LICENSE +++ /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/NuGet.Config b/NuGet/NuGet.Config deleted file mode 100644 index 6ed4e83..0000000 --- a/NuGet/NuGet.Config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/NuGet/NuGet.exe b/NuGet/NuGet.exe deleted file mode 100644 index 6bb79fe..0000000 Binary files a/NuGet/NuGet.exe and /dev/null differ diff --git a/NuGet/nuget b/NuGet/nuget deleted file mode 100755 index 0d69009..0000000 --- a/NuGet/nuget +++ /dev/null @@ -1,14 +0,0 @@ -#!/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 diff --git a/Tools/dotnet-build.sh b/Tools/dotnet-build.sh index c053b67..9ffaef8 100755 --- a/Tools/dotnet-build.sh +++ b/Tools/dotnet-build.sh @@ -21,17 +21,6 @@ exit_on_error() { fi } -run_nuget() { - $RETRY_CMD nuget $@ - exit_on_error $? -} - -run_xbuild() { - echo "+ xbuild $@" - xbuild $@ - exit_on_error $? -} - run_dotnet() { echo "+ dotnet $@" $RETRY_CMD $TIMEOUT_CMD 600 dotnet $@ @@ -53,72 +42,24 @@ update_version_to_asterisk() { done } -build_project() { - local CSPROJ=$1; shift - - local PROJNAME=${CSPROJ%.*} - local PROJECT_JSON=$PROJNAME.project.json - if [ -f $PROJECT_JSON ]; then - run_nuget restore $PROJECT_JSON - fi - run_xbuild $CSPROJ /p:Configuration=$CONFIGURATION $@ -} - cmd_restore() { - if $USE_DOTNET_CLI; then - ## update_version_to_asterisk # update PackageReference version to * in .csproj - local OPTS="" - [ -n "$SOURCE" ] && OPTS="$OPTS -s $SOURCE" - run_dotnet restore $PROJECT $OPTS $@ - else - if [[ $PROJECT_TYPE == "dir" ]]; then - local PROJFILES=$(find $PROJECT -name "*project.json") - for p in $PROJFILES; do - run_nuget restore $p $@ - done - else - run_nuget restore $PROJECT $@ - fi - fi + local OPTS="" + [ -n "$SOURCE" ] && OPTS="$OPTS -s $SOURCE" + run_dotnet restore $PROJECT $OPTS $@ } cmd_build() { - if $USE_DOTNET_CLI; then - cmd_restore # restore first - local OPTS="" - [ -n "$CONFIGURATION" ] && OPTS="$OPTS -c $CONFIGURATION" - run_dotnet build --no-restore $PROJECT $OPTS $@ /p:UsingRPMMacro=true - else - if [[ $PROJECT_TYPE == "dir" ]]; then - local PROJFILES=$(find $PROJECT -name "*.csproj") - for p in $PROJFILES; do - build_project $p $@ - done - elif [[ $PROJECT_TYPE == "sln" ]]; then - run_xbuild $PROJECT /p:Configuration=$CONFIGURATION $@ - elif [[ $PROJECT_TYPE == "csproj" ]]; then - build_project $PROJECT $@ - fi - fi + cmd_restore # restore first + local OPTS="" + [ -n "$CONFIGURATION" ] && OPTS="$OPTS -c $CONFIGURATION" + run_dotnet build --no-restore $PROJECT $OPTS $@ /p:UsingRPMMacro=true } cmd_pack() { local OPTS="" - if $USE_DOTNET_CLI; then - [ -n "$CONFIGURATION" ] && OPTS="$OPTS -c $CONFIGURATION" - [ -n "$VERSION" ] && OPTS="$OPTS /p:Version=$VERSION" - run_dotnet pack --no-restore --no-build $PROJECT $OPTS $@ /p:UsingRPMMacro=true - else - local NUSPEC=($PROJECT) - if [ -d $PROJECT ]; then - NUSPEC=($(find $PROJECT -name "*.nuspec")) - fi - [ -n "$CONFIGURATION" ] && OPTS="$OPTS -Properties Configuration=$CONFIGURATION" - [ -n "$VERSION" ] && OPTS="$OPTS -Version $VERSION" - for x in ${NUSPEC[@]}; do - run_nuget pack $x $OPTS $@ - done - fi + [ -n "$CONFIGURATION" ] && OPTS="$OPTS -c $CONFIGURATION" + [ -n "$VERSION" ] && OPTS="$OPTS /p:Version=$VERSION" + run_dotnet pack --no-restore --no-build $PROJECT $OPTS $@ /p:UsingRPMMacro=true } cmd_install() { @@ -204,13 +145,14 @@ elif [ -d $PROJECT ]; then fi fi +if [ $USE_DOTNET_CLI == false ]; then + echo "Not supported project type." + exit 1 +fi + export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true -# To build PCL projects ReferenceAssemblyRoot should be set. -# dotnet-cli will find reference assemblies for PCL in this path. -export ReferenceAssemblyRoot=/usr/lib/mono/xbuild-frameworks - # Dump echo "----------------------------------------------" echo "CMD=$CMD" diff --git a/packaging/dotnet-build-tools.spec b/packaging/dotnet-build-tools.spec index 56a3981..d1295b1 100644 --- a/packaging/dotnet-build-tools.spec +++ b/packaging/dotnet-build-tools.spec @@ -3,7 +3,7 @@ Name: dotnet-build-tools Summary: Tools for building C# API projects -Version: 1.3.5 +Version: 2.0.0 Release: 1 Group: Development/Libraries License: MIT and Apache-2.0 @@ -16,11 +16,6 @@ AutoReqProv: no BuildRequires: patchelf Requires: corefx-managed-ref -Requires: referenceassemblies-pcl - -Requires: mono-compat -Requires: mono-devel -Requires: mono-compiler Requires: xmlstarlet @@ -28,8 +23,6 @@ Requires: xmlstarlet Build target files (.Targets) and Tools (including NuGet.exe) for building C# Deivce API with xbuild in GBS environment. -%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 @@ -67,26 +60,7 @@ ln -s %{CLI_PATH}/dotnet %{buildroot}%{_bindir}/dotnet # Tizen.GBS.BuildTasks 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}%{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}%{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 NuGet/LICENSE %config(noreplace) %{_sysconfdir}/rpm/macros.dotnet-build-tools %{_bindir}/* -%{NUGET_PATH}/* -%{XBUILD_PATH}/* %{TOOLS_PATH}/*