Skip to content

Commit

Permalink
Make Mono build in dotnet/runtime
Browse files Browse the repository at this point in the history
Also add packaging project for Microsoft.NETCore.Runtime.Mono.
  • Loading branch information
akoeplinger committed Jan 18, 2020
1 parent cd8b98d commit 3d2aafd
Show file tree
Hide file tree
Showing 55 changed files with 1,293 additions and 6,071 deletions.
15 changes: 14 additions & 1 deletion eng/Subsets.props
Expand Up @@ -50,24 +50,27 @@
<PropertyGroup>
<LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
<CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
<MonoProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono'))</MonoProjectRoot>
<InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
<RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
<RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
</PropertyGroup>

<PropertyGroup>
<DefaultSubsetCategories>libraries-installer-coreclr</DefaultSubsetCategories>
<DefaultSubsetCategories>libraries-installer-coreclr-mono</DefaultSubsetCategories>
<DefaultInstallerSubsets>corehost-managed-depproj-pkgproj-bundle-installers-test</DefaultInstallerSubsets>
<!-- TODO: Split into multiple sets. -->
<DefaultLibrariesSubsets>all</DefaultLibrariesSubsets>
<DefaultCoreClrSubsets>all</DefaultCoreClrSubsets>
<DefaultMonoSubsets>all</DefaultMonoSubsets>

<_subsetCategory Condition="'$(SubsetCategory)' != ''">$(SubsetCategory.ToLowerInvariant())</_subsetCategory>
<_subsetCategory Condition="'$(SubsetCategory)' == ''">$(DefaultSubsetCategories)</_subsetCategory>
<_subset Condition="'$(Subset)' != ''">$(Subset.ToLowerInvariant())</_subset>
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('installer'))">$(DefaultInstallerSubsets)</_subset>
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('libraries'))">$(_subset)$(DefaultLibrariesSubsets)</_subset>
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('coreclr'))">$(_subset)$(DefaultCoreClrSubsets)</_subset>
<_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('mono'))">$(_subset)$(DefaultMonoSubsets)</_subset>
</PropertyGroup>

<ItemGroup>
Expand All @@ -80,6 +83,9 @@
<!-- CoreClr -->
<SubsetName Include="All" Category="CoreClr" Description="The .NET runtime." />

<!-- Mono -->
<SubsetName Include="All" Category="Mono" Description="The Mono .NET runtime." />

<!-- Installer -->
<SubsetName Include="All" Category="Installer" Description="The .NET Core hosts, hosting libraries, bundles, and installers. Includes these projects' tests." />
<SubsetName Include="CoreHost" Category="Installer" Description="The .NET Core hosts." />
Expand All @@ -102,6 +108,13 @@
<ProjectToBuild Include="@(CoreClrProjectToBuild)" />
</ItemGroup>

<!-- Mono sets -->
<ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('all'))">
<MonoProjectToBuild Include="$(MonoProjectRoot)mono.proj" BuildInParallel="false" />
<MonoProjectToBuild Include="$(MonoProjectRoot)netcore\System.Private.CoreLib\System.Private.CoreLib.csproj" BuildInParallel="false" />
<ProjectToBuild Include="@(MonoProjectToBuild)" />
</ItemGroup>

<!-- Libraries sets -->
<ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('all'))">
<LibrariesProjectToBuild Include="$(LibrariesProjectRoot)build.proj" BuildInParallel="false" />
Expand Down
2 changes: 2 additions & 0 deletions mono.cmd
@@ -0,0 +1,2 @@
@echo off
"%~dp0build.cmd" -subsetCategory mono %*
16 changes: 16 additions & 0 deletions mono.sh
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

source="${BASH_SOURCE[0]}"

# resolve $SOURCE until the file is no longer a symlink
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"

# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
"$scriptroot/build.sh" --subsetCategory mono $@
28 changes: 28 additions & 0 deletions src/mono/Directory.Build.props
@@ -0,0 +1,28 @@
<Project>

<PropertyGroup>
<SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />

<!-- Ensure our properties are set before Arcade defines defaults -->
<Import Project="dir.common.props" />
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<PropertyGroup Condition="'$(CopyrightNetFoundation)' != ''">
<Copyright>$(CopyrightNetFoundation)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup>
<SignAssembly Condition="'$(UsingMicrosoftNETSdk)'!='true'">false</SignAssembly>
</PropertyGroup>

<PropertyGroup>
<CL_MPCount>$(NumberOfCores)</CL_MPCount>
</PropertyGroup>
<PropertyGroup>
<!-- Enables Strict mode for Roslyn compiler -->
<Features>strict;nullablePublicOnly</Features>
</PropertyGroup>
</Project>
15 changes: 15 additions & 0 deletions src/mono/Directory.Build.targets
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="..\..\Directory.Build.targets" />

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<PropertyGroup>
<!-- SDK sets product to assembly but we want it to be our product name -->
<Product>Microsoft%AE .NET Core</Product>

<!-- Use the .NET Core product branding version for informational version description -->
<InformationalVersion>$(ProductVersion)</InformationalVersion>
<InformationalVersion Condition="'$(VersionSuffix)' != ''">$(InformationalVersion)-$(VersionSuffix)</InformationalVersion>
</PropertyGroup>
</Project>
102 changes: 102 additions & 0 deletions src/mono/dir.common.props
@@ -0,0 +1,102 @@
<Project>

<!-- Set default Configuration and Platform -->
<PropertyGroup>
<BuildArch>$(__BuildArch)</BuildArch>
<BuildArch Condition="'$(__BuildArch)'==''">x64</BuildArch>
<BuildArch Condition="'$(__BuildArch)' == 'amd64'">x64</BuildArch>

<BuildType>$(__BuildType)</BuildType>
<BuildType Condition="'$(__BuildType)'==''">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'debug'">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'release'">Release</BuildType>
<BuildType Condition="'$(__BuildType)' == 'checked'">Checked</BuildType>

<BuildOS>$(__BuildOS)</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(Windows))' == 'true'">Windows_NT</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(Linux))' == 'true'">Linux</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(OSX))' == 'true'">OSX</BuildOS>

<!-- TODO: converge on one property for BuildOS and __BuildOS (and similar), and remove these extra lines. -->
<__BuildOS>$(BuildOS)</__BuildOS>
<__BuildArch>$(BuildArch)</__BuildArch>

<Configuration Condition="'$(Configuration)' == ''">$(BuildType)</Configuration>
<Platform Condition="'$(Platform)' == ''">$(BuildArch)</Platform>

<PlatformConfigPathPart>$(BuildOS).$(BuildArch).$(BuildType)</PlatformConfigPathPart>

</PropertyGroup>

<!-- Common properties -->
<PropertyGroup>

<__ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)</__ProjectDir>
<ProjectDir>$(__ProjectDir)\</ProjectDir>
<RootRepoDir>$(ProjectDir)\..\..\</RootRepoDir>
<ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)</ProjectDir>

<BaseIntermediateOutputPath>$(RootRepoDir)artifacts\obj\mono\$(MSBuildProjectName)\</BaseIntermediateOutputPath>

<SourceDir>$(__SourceDir)\</SourceDir>
<SourceDir Condition="'$(__SourceDir)'==''">$(ProjectDir)src\</SourceDir>

<RootBinDir>$(__RootBinDir)\</RootBinDir>
<RootBinDir Condition="'$(__RootBinDir)'==''">$(RootRepoDir)artifacts\</RootBinDir>

<BinDir>$(__BinDir)\</BinDir>
<BinDir Condition="'$(__BinDir)'==''">$(RootBinDir)bin\mono\$(PlatformConfigPathPart)\</BinDir>

</PropertyGroup>

<PropertyGroup>
<!-- Central place to set the versions of all nuget packages produced in the repo -->
<PackageVersion Condition="'$(PackageVersion)' == ''">5.0.0</PackageVersion>

<!-- Set the boolean below to true to generate packages with stabilized versions -->
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<StableVersion Condition="'$(StabilizePackageVersion)' == 'true' and '$(StableVersion)' == ''">$(PackageVersion)</StableVersion>

<PreReleaseLabel>preview8</PreReleaseLabel>
</PropertyGroup>

<!-- Set up common target properties that we use to conditionally include sources -->
<PropertyGroup>
<TargetsFreeBSD Condition="'$(BuildOS)' == 'FreeBSD'">true</TargetsFreeBSD>
<TargetsLinux Condition="'$(BuildOS)' == 'Linux'">true</TargetsLinux>
<TargetsNetBSD Condition="'$(BuildOS)' == 'NetBSD'">true</TargetsNetBSD>
<TargetsOSX Condition="'$(BuildOS)' == 'OSX'">true</TargetsOSX>
<TargetsWindows Condition="'$(BuildOS)' == 'Windows_NT'">true</TargetsWindows>

<TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true'">true</TargetsUnix>

</PropertyGroup>

<PropertyGroup>
<LangVersion>8.0</LangVersion>
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>

<!-- Set the kind of PDB to Portable -->
<PropertyGroup>
<DebugType Condition="'$(DebugType)' == ''">Portable</DebugType>
</PropertyGroup>

<!-- Common properties -->
<PropertyGroup>

<!-- Default to portable build if not explicitly set -->
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>

<!-- If true, indicates that this is not an officially supported release -->
<!-- It is important to flip this to false in official release branches -->
<!-- Keep it in sync with PRERELEASE in clrdefinitions.cmake -->
<IsPrerelease>true</IsPrerelease>
</PropertyGroup>

<!-- Output paths -->
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

</Project>
2 changes: 2 additions & 0 deletions src/mono/llvm/Makefile.am
@@ -0,0 +1,2 @@
# temporary Makefile until we can fully move netcore mono to new repo
all:
69 changes: 0 additions & 69 deletions src/mono/m4/mono-output.m4
Expand Up @@ -5,23 +5,14 @@
#
AC_DEFUN([AC_MONO_OUTPUT], [
AC_CONFIG_FILES([po/mcs/Makefile.in])
AC_CONFIG_FILES([acceptance-tests/microbench-perf.sh], [chmod +x acceptance-tests/microbench-perf.sh])
AC_CONFIG_FILES([runtime/mono-wrapper], [chmod +x runtime/mono-wrapper])
AC_CONFIG_FILES([runtime/monodis-wrapper], [chmod +x runtime/monodis-wrapper])
AC_CONFIG_FILES([runtime/bin/mono-hang-watchdog], [chmod +x runtime/bin/mono-hang-watchdog])
AC_OUTPUT([
Makefile
llvm/Makefile
mono/Makefile
mono/btls/Makefile
mono/native/Makefile
mono/utils/Makefile
mono/metadata/Makefile
mono/zlib/Makefile
mono/dis/Makefile
mono/cil/Makefile
mono/arch/Makefile
mono/arch/x86/Makefile
mono/arch/amd64/Makefile
Expand All @@ -33,70 +24,10 @@ AC_DEFUN([AC_MONO_OUTPUT], [
mono/arch/mips/Makefile
mono/arch/riscv/Makefile
mono/sgen/Makefile
mono/native/platform-type.c
mono/native/platform-type-compat.c
mono/native/platform-type-unified.c
mono/tests/Makefile
mono/tests/assembly-load-reference/Makefile
mono/tests/tests-config
mono/tests/gc-descriptors/Makefile
mono/tests/testing_gac/Makefile
mono/tests/fullaot-mixed/Makefile
mono/tests/llvmonly-mixed/Makefile
mono/unit-tests/Makefile
mono/benchmark/Makefile
mono/mini/Makefile
mono/profiler/Makefile
mono/eglib/Makefile
mono/eglib/eglib-config.h
mono/eglib/test/Makefile
m4/Makefile
msvc/Makefile
mono/utils/jemalloc/Makefile
mono-uninstalled.pc
acceptance-tests/Makefile
scripts/mono-find-provides
scripts/mono-find-requires
ikvm-native/Makefile
scripts/Makefile
man/Makefile
docs/Makefile
data/Makefile
data/net_2_0/Makefile
data/net_4_0/Makefile
data/net_4_5/Makefile
data/net_2_0/Browsers/Makefile
data/net_4_0/Browsers/Makefile
data/net_4_5/Browsers/Makefile
data/mint.pc
data/mono-2.pc
data/monosgen-2.pc
data/mono.pc
data/mono-cairo.pc
data/mono-options.pc
data/mono-lineeditor.pc
data/monodoc.pc
data/dotnet.pc
data/dotnet35.pc
data/wcf.pc
data/cecil.pc
data/system.web.extensions_1.0.pc
data/system.web.extensions.design_1.0.pc
data/system.web.mvc.pc
data/system.web.mvc2.pc
data/system.web.mvc3.pc
data/aspnetwebstack.pc
data/reactive.pc
samples/Makefile
support/Makefile
data/config
tools/Makefile
tools/locale-builder/Makefile
tools/sgen/Makefile
tools/pedump/Makefile
tools/mono-hang-watchdog/Makefile
runtime/Makefile
po/Makefile
netcore/corerun/Makefile
])
])

0 comments on commit 3d2aafd

Please sign in to comment.