From 2fc2358af9c4cce28710b2d55df080bb9b758a85 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 26 Feb 2019 00:53:53 -0800 Subject: [PATCH] Simplify solutions used to build monolinker/illink (dotnet/linker#474) Until I can make more progress on SDK-style projects (see https://github.com/mono/linker/pull/471), I'll begin trying to set up a build of illink using arcade and the old-style projects. In this change I'm getting rid of the scattered linker.sln files in favor of monolinker.sln for monolinker, and illink.sln for the illink/ILLink.Tasks build. Commit migrated from https://github.com/dotnet/linker/commit/1331119f9d7503b05807a35296a9637ee8e45a9d --- src/tools/illink/README.md | 2 +- src/tools/illink/corebuild/build.sh | 2 +- .../illink/corebuild/integration/build.ps1 | 6 +- .../illink/corebuild/integration/build.sh | 6 +- .../illink/corebuild/integration/linker.sln | 76 ------------------- src/tools/illink/corebuild/restore.cmd | 2 +- src/tools/illink/corebuild/restore.sh | 2 +- .../{corebuild/linker.sln => illink.sln} | 26 +++++-- src/tools/illink/monobuild/Makefile | 6 +- .../illink/{linker.sln => monolinker.sln} | 0 src/tools/illink/src/ILLink.Tasks/README.md | 4 +- 11 files changed, 35 insertions(+), 97 deletions(-) delete mode 100644 src/tools/illink/corebuild/integration/linker.sln rename src/tools/illink/{corebuild/linker.sln => illink.sln} (79%) rename src/tools/illink/{linker.sln => monolinker.sln} (100%) diff --git a/src/tools/illink/README.md b/src/tools/illink/README.md index 79cd985ce0078..82b3bc4cee00b 100644 --- a/src/tools/illink/README.md +++ b/src/tools/illink/README.md @@ -6,7 +6,7 @@ programs might require to run as opposed to the full libraries. It is used by the various Xamarin products to extract only the bits of code that are needed to run an application on Android, iOS and other platforms. -It can also be used in the form of [ILLink.Tasks](corebuild/README.md) to reduce the size of .NET Core apps. +It can also be used in the form of [ILLink.Tasks](src/ILLink.Tasks/README.md) to reduce the size of .NET Core apps. # [Analyzer](src/analyzer/README.md) diff --git a/src/tools/illink/corebuild/build.sh b/src/tools/illink/corebuild/build.sh index dc57f0fa1f9a4..062218ad1b869 100755 --- a/src/tools/illink/corebuild/build.sh +++ b/src/tools/illink/corebuild/build.sh @@ -3,5 +3,5 @@ # build.sh will bootstrap the cli and ultimately call "dotnet build" working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -$working_tree_root/dotnet.sh build $working_tree_root/linker.sln $@ +$working_tree_root/dotnet.sh build $working_tree_root/../illink.sln $@ exit $? diff --git a/src/tools/illink/corebuild/integration/build.ps1 b/src/tools/illink/corebuild/integration/build.ps1 index 3894a7d84b11b..7e8c8589ba24c 100644 --- a/src/tools/illink/corebuild/integration/build.ps1 +++ b/src/tools/illink/corebuild/integration/build.ps1 @@ -3,7 +3,7 @@ If (Test-Path $tasksFolder) { Remove-Item -r $tasksFolder } -$dotNetTool = Join-Path $PSScriptRoot "..\corebuild\dotnet.ps1" +$dotNetTool = Join-Path $PSScriptRoot "..\dotnet.ps1" # create integration packages -& $dotNetTool restore (Join-Path $PSScriptRoot "linker.sln") -& $dotNetTool pack (Join-Path $PSScriptRoot "linker.sln") +& $dotNetTool restore (Join-Path $PSScriptRoot ".." ".." "illink.sln") +& $dotNetTool pack (Join-Path $PSScriptRoot ".." ".." "illink.sln") diff --git a/src/tools/illink/corebuild/integration/build.sh b/src/tools/illink/corebuild/integration/build.sh index f137c08b479c2..43b59f5e678ce 100755 --- a/src/tools/illink/corebuild/integration/build.sh +++ b/src/tools/illink/corebuild/integration/build.sh @@ -8,7 +8,7 @@ then rm -r $tasksFolder fi -dotNetTool=$__scriptpath/../corebuild/dotnet.sh +dotNetTool=$__scriptpath/../dotnet.sh # create integration packages -$dotNetTool restore $__scriptpath/linker.sln -$dotNetTool pack $__scriptpath/linker.sln +$dotNetTool restore $__scriptpath/../../illink.sln +$dotNetTool pack $__scriptpath/../../illink.sln diff --git a/src/tools/illink/corebuild/integration/linker.sln b/src/tools/illink/corebuild/integration/linker.sln deleted file mode 100644 index 53472ffcfff79..0000000000000 --- a/src/tools/illink/corebuild/integration/linker.sln +++ /dev/null @@ -1,76 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILLink.Tasks", "..\..\src\ILLink.Tasks\ILLink.Tasks.csproj", "{42050FFF-50CB-41D5-B617-68D1624FE716}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Linker", "..\..\src\linker\Mono.Linker.csproj", "{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "..\..\external\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Pdb", "..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb.csproj", "{63E6915C-7EA4-4D76-AB28-0D7191EEA626}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {42050FFF-50CB-41D5-B617-68D1624FE716}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {42050FFF-50CB-41D5-B617-68D1624FE716}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42050FFF-50CB-41D5-B617-68D1624FE716}.Debug|x64.ActiveCfg = Debug|x64 - {42050FFF-50CB-41D5-B617-68D1624FE716}.Debug|x64.Build.0 = Debug|x64 - {42050FFF-50CB-41D5-B617-68D1624FE716}.Debug|x86.ActiveCfg = Debug|x86 - {42050FFF-50CB-41D5-B617-68D1624FE716}.Debug|x86.Build.0 = Debug|x86 - {42050FFF-50CB-41D5-B617-68D1624FE716}.Release|Any CPU.ActiveCfg = Release|Any CPU - {42050FFF-50CB-41D5-B617-68D1624FE716}.Release|Any CPU.Build.0 = Release|Any CPU - {42050FFF-50CB-41D5-B617-68D1624FE716}.Release|x64.ActiveCfg = Release|x64 - {42050FFF-50CB-41D5-B617-68D1624FE716}.Release|x64.Build.0 = Release|x64 - {42050FFF-50CB-41D5-B617-68D1624FE716}.Release|x86.ActiveCfg = Release|x86 - {42050FFF-50CB-41D5-B617-68D1624FE716}.Release|x86.Build.0 = Release|x86 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Debug|Any CPU.ActiveCfg = netcore_Debug|Any CPU - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Debug|Any CPU.Build.0 = netcore_Debug|Any CPU - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Debug|x64.ActiveCfg = netcore_Debug|x64 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Debug|x64.Build.0 = netcore_Debug|x64 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Debug|x86.ActiveCfg = netcore_Debug|x86 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Debug|x86.Build.0 = netcore_Debug|x86 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|Any CPU.ActiveCfg = netcore_Release|Any CPU - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|Any CPU.Build.0 = netcore_Release|Any CPU - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|x64.ActiveCfg = netcore_Release|x64 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|x64.Build.0 = netcore_Release|x64 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|x86.ActiveCfg = netcore_Release|x86 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|x86.Build.0 = netcore_Release|x86 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x64.ActiveCfg = netstandard_Debug|x64 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x64.Build.0 = netstandard_Debug|x64 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.ActiveCfg = netstandard_Debug|x86 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.Build.0 = netstandard_Debug|x86 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.Build.0 = netstandard_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x64.ActiveCfg = netstandard_Release|x64 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x64.Build.0 = netstandard_Release|x64 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.ActiveCfg = netstandard_Release|x86 - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.Build.0 = netstandard_Release|x86 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x64.ActiveCfg = netstandard_Debug|x64 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x64.Build.0 = netstandard_Debug|x64 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x86.ActiveCfg = netstandard_Debug|x86 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x86.Build.0 = netstandard_Debug|x86 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.Build.0 = netstandard_Release|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x64.ActiveCfg = netstandard_Release|x64 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x64.Build.0 = netstandard_Release|x64 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.ActiveCfg = netstandard_Release|x86 - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.Build.0 = netstandard_Release|x86 - EndGlobalSection -EndGlobal diff --git a/src/tools/illink/corebuild/restore.cmd b/src/tools/illink/corebuild/restore.cmd index cad3a3c53322d..6c0f997a7fd58 100644 --- a/src/tools/illink/corebuild/restore.cmd +++ b/src/tools/illink/corebuild/restore.cmd @@ -3,5 +3,5 @@ REM restore.sh will bootstrap the cli and ultimately call "dotnet REM restore". Dependencies of the linker will get restored as well. -@call %~dp0dotnet.cmd restore %~dp0integration\linker.sln %* +@call %~dp0dotnet.cmd restore %~dp0..\illink.sln %* @exit /b %ERRORLEVEL% diff --git a/src/tools/illink/corebuild/restore.sh b/src/tools/illink/corebuild/restore.sh index 0099b17d308a7..ad22a1711ff73 100755 --- a/src/tools/illink/corebuild/restore.sh +++ b/src/tools/illink/corebuild/restore.sh @@ -4,4 +4,4 @@ # restore". Dependencies of the linker will get restored as well. working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -$working_tree_root/dotnet.sh restore $working_tree_root/integration/linker.sln $@ +$working_tree_root/dotnet.sh restore $working_tree_root/../illink.sln $@ diff --git a/src/tools/illink/corebuild/linker.sln b/src/tools/illink/illink.sln similarity index 79% rename from src/tools/illink/corebuild/linker.sln rename to src/tools/illink/illink.sln index e509e98935b2b..7a52b7822602b 100644 --- a/src/tools/illink/corebuild/linker.sln +++ b/src/tools/illink/illink.sln @@ -1,16 +1,18 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Linker", "..\src\linker\Mono.Linker.csproj", "{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Linker", "src\linker\Mono.Linker.csproj", "{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "..\external\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "external\cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Pdb", "..\external\cecil\symbols\pdb\Mono.Cecil.Pdb.csproj", "{63E6915C-7EA4-4D76-AB28-0D7191EEA626}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Pdb", "external\cecil\symbols\pdb\Mono.Cecil.Pdb.csproj", "{63E6915C-7EA4-4D76-AB28-0D7191EEA626}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Mdb", "..\external\cecil\symbols\mdb\Mono.Cecil.Mdb.csproj", "{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Mdb", "external\cecil\symbols\mdb\Mono.Cecil.Mdb.csproj", "{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILLink.CustomSteps", "..\src\ILLink.CustomSteps\ILLink.CustomSteps.csproj", "{275C1D10-168A-4AC4-8F3E-AD969F580B9C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILLink.CustomSteps", "src\ILLink.CustomSteps\ILLink.CustomSteps.csproj", "{275C1D10-168A-4AC4-8F3E-AD969F580B9C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILLink.Tasks", "src\ILLink.Tasks\ILLink.Tasks.csproj", "{A7A026C4-DEB4-4EF6-963E-17E7B98A6527}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -85,6 +87,18 @@ Global {275C1D10-168A-4AC4-8F3E-AD969F580B9C}.Release|x64.Build.0 = illink_Release|x64 {275C1D10-168A-4AC4-8F3E-AD969F580B9C}.Release|x86.ActiveCfg = illink_Release|x86 {275C1D10-168A-4AC4-8F3E-AD969F580B9C}.Release|x86.Build.0 = illink_Release|x86 + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Debug|x64.ActiveCfg = Debug|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Debug|x64.Build.0 = Debug|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Debug|x86.ActiveCfg = Debug|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Debug|x86.Build.0 = Debug|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Release|Any CPU.Build.0 = Release|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Release|x64.ActiveCfg = Release|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Release|x64.Build.0 = Release|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Release|x86.ActiveCfg = Release|Any CPU + {A7A026C4-DEB4-4EF6-963E-17E7B98A6527}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/tools/illink/monobuild/Makefile b/src/tools/illink/monobuild/Makefile index 3302e925e79f0..eb438708cbe06 100644 --- a/src/tools/illink/monobuild/Makefile +++ b/src/tools/illink/monobuild/Makefile @@ -4,13 +4,13 @@ CONFIGURATION = Debug all: build check build: prepare - $(MSBUILD) ../linker.sln /p:Configuration=$(CONFIGURATION) + $(MSBUILD) ../monolinker.sln /p:Configuration=$(CONFIGURATION) clean: - $(MSBUILD) ../linker.sln /t:clean + $(MSBUILD) ../monolinker.sln /t:clean prepare: - nuget restore ../linker.sln + nuget restore ../monolinker.sln # A hack for project.assets.json issues rm -f ../external/cecil/obj/project.assets.json rm -f ../external/cecil/symbols/pdb/obj/project.assets.json diff --git a/src/tools/illink/linker.sln b/src/tools/illink/monolinker.sln similarity index 100% rename from src/tools/illink/linker.sln rename to src/tools/illink/monolinker.sln diff --git a/src/tools/illink/src/ILLink.Tasks/README.md b/src/tools/illink/src/ILLink.Tasks/README.md index b75f521b8f517..b4e9dad38ee29 100644 --- a/src/tools/illink/src/ILLink.Tasks/README.md +++ b/src/tools/illink/src/ILLink.Tasks/README.md @@ -31,8 +31,8 @@ The full set of options is described below. ## Building ``` -linker> ./corebuild/dotnet.{sh/ps1} restore ./corebuild/integration/linker.sln -linker> ./corebuild/dotnet.{sh/ps1} pack ./corebuild/integration/ILLink.Tasks/ILLink.Tasks.csproj +linker> ./corebuild/dotnet.{sh/ps1} restore illink.sln +linker> ./corebuild/dotnet.{sh/ps1} pack src/ILLink.Tasks/ILLink.Tasks.csproj ``` The output package will be placed in