Add ossbuild for build support on GitHub
Common-RSL commit 89adfe794d9682ecff196d0d108b9229e60aa48e
This commit is contained in:
Родитель
f511640f67
Коммит
21c6f07e61
|
@ -0,0 +1,5 @@
|
|||
<root>
|
||||
<versions>
|
||||
<version name="filever" value="1.2.25.0" />
|
||||
</versions>
|
||||
</root>
|
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
***********************************************************************************************
|
||||
Environment.props
|
||||
|
||||
This file overrides shipped msbuild settings to work well in an isolated no-install drop
|
||||
|
||||
Environment.Custom.props should be configured by the build environment administrators to
|
||||
* Setup paths to local SDKs and Tools
|
||||
* Add the necessary extensibility hooks for customization from consumers
|
||||
|
||||
Build environment administrators must call Environment.{cmd|ps1} from this directory to
|
||||
setup the build environment properly.
|
||||
|
||||
|
||||
Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
***********************************************************************************************
|
||||
-->
|
||||
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyCompany>Microsoft Corporation</AssemblyCompany>
|
||||
<AssemblyDescription>Microsoft Azure%ae</AssemblyDescription>
|
||||
<AssemblyCopyright>Copyright %a9 Microsoft Corporation. All rights reserved.</AssemblyCopyright>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Auto generate NuGet packages from projects. This is temporary stopgap solution
|
||||
to help with migrations until we can get a permanant packaging system in place. -->
|
||||
<PropertyGroup>
|
||||
<InstallPkgLocal Condition="'$(InstallPkgLocal)'==''">false</InstallPkgLocal>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Turning off CLS compliance warnings/errors -->
|
||||
<PropertyGroup>
|
||||
<AssemblyCLSCompliant>false</AssemblyCLSCompliant>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Required for using Nuproj targets since we don't check in NuGet.exe -->
|
||||
<PropertyGroup>
|
||||
<NuProjToolPath>$(PkgNuGet_CommandLine)\tools</NuProjToolPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Add in StyleCop -->
|
||||
<PropertyGroup>
|
||||
<StyleCopEnabled>false</StyleCopEnabled>
|
||||
<StyleCopVersion Condition="'$(StyleCopVersion)' == ''">4.3.0.8</StyleCopVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GeneratedHeadersDir>$(OutputRoot)\$(BuildType)-$(BuildArchitecture)\Headers</GeneratedHeadersDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutBinDir>$(OutputRoot)\$(BuildType)-$(BuildArchitecture)\Binaries</OutBinDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TaefRedist>$(PkgTaef_amd64)\Binaries\Release\x64\TestExecution\</TaefRedist>
|
||||
</PropertyGroup>
|
||||
|
||||
<Choose>
|
||||
<When Condition="'$(OSSBUILD)' == ''">
|
||||
<PropertyGroup>
|
||||
<LibCmd>$(PkgVisualCpp_Corext)\bin\x64\$(_BuildArch)\lib.exe</LibCmd>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<LibCmd>lib.exe</LibCmd>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
||||
</Project>
|
|
@ -23,6 +23,11 @@ bld/
|
|||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
objd/
|
||||
obj/
|
||||
ossbuild/packageList.props
|
||||
/out/
|
||||
.*.swp
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<!-- If no override is provided, fall back on the AssemblyName (C#). -->
|
||||
<OutDirSuffix Condition="'$(OutDirSuffix)' == ''">$(AssemblyName)\</OutDirSuffix>
|
||||
<!-- If still not defined, fall back on TargetName (native). -->
|
||||
<OutDirSuffix Condition="'$(OutDirSuffix)' ==''">$(TargetName)\</OutDirSuffix>
|
||||
<!-- If still not defined, just use the name of the file -->
|
||||
<OutDirSuffix Condition="'$(OutDirSuffix)' == ''">$(MSBuildProjectName)</OutDirSuffix>
|
||||
<BinariesBuildTypeArchDirectory>$(OUTPUTROOT)\$(BuildType)-$(BuildArchitecture)</BinariesBuildTypeArchDirectory>
|
||||
<OutDir>$(BinariesBuildTypeArchDirectory)\$(OutDirSuffix)</OutDir>
|
||||
<OutputPath>$(OutDir)</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="BeforeAllTargets" BeforeTargets="BeforeBuild">
|
||||
<ItemGroup>
|
||||
<AssemblyAttributes Include="AssemblyCompany"><_Parameter1>$(AssemblyCompany)</_Parameter1></AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyCopyright"><_Parameter1>$(AssemblyCopyright)</_Parameter1></AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyDescription"><_Parameter1>$(GitRepositoryName) $(GitBranchName) commit $(VersionCommitHash) on $(BuildDate)</_Parameter1></AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyFileVersion"><_Parameter1>$(BUILDNUMBER)</_Parameter1></AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyInformationalVersion"><_Parameter1>$(AssemblyInformationalVersion)</_Parameter1></AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyProduct"><_Parameter1>$(AssemblyProduct)</_Parameter1></AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyTitle"><_Parameter1>$(AssemblyName)</_Parameter1></AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyVersion"><_Parameter1>$(BUILDNUMBER)</_Parameter1></AssemblyAttributes>
|
||||
|
||||
<!-- Standard WriteCodeFragment doesn't support boolean. So we have to work around it. -->
|
||||
<codegenlines Include="[assembly: System.Runtime.InteropServices.ComVisible(false)]" />
|
||||
<codegenlines Include="[assembly: System.CLSCompliant($(AssemblyCLSCompliant))]" />
|
||||
</ItemGroup>
|
||||
<MakeDir Directories="$(IntermediateOutputPath)" />
|
||||
<WriteCodeFragment AssemblyAttributes="@(AssemblyAttributes)"
|
||||
Language="C#"
|
||||
OutputFile="_asmcodegen.cs"
|
||||
OutputDirectory="$(IntermediateOutputPath)">
|
||||
<Output TaskParameter="OutputFile" ItemName="Compile" />
|
||||
</WriteCodeFragment>
|
||||
<WriteLinesToFile File="$(IntermediateOutputPath)_asmcodegen.cs" Overwrite="false" Lines="@(codegenlines)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
</Project>
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<PropertyGroup>
|
||||
<!-- If no override is provided, fall back on the AssemblyName (C#). -->
|
||||
<OutDirSuffix Condition="'$(OutDirSuffix)' == ''">$(AssemblyName)\</OutDirSuffix>
|
||||
<!-- If still not defined, fall back on TargetName (native). -->
|
||||
<OutDirSuffix Condition="'$(OutDirSuffix)' ==''">$(TargetName)\</OutDirSuffix>
|
||||
<!-- If still not defined, just use the name of the file -->
|
||||
<OutDirSuffix Condition="'$(OutDirSuffix)' == ''">$(MSBuildProjectName)</OutDirSuffix>
|
||||
<BinariesBuildTypeArchDirectory>$(OUTPUTROOT)\$(BuildType)-$(BuildArchitecture)</BinariesBuildTypeArchDirectory>
|
||||
<OutDir>$(BinariesBuildTypeArchDirectory)\$(OutDirSuffix)</OutDir>
|
||||
<OutputPath>$(OutDir)</OutputPath>
|
||||
<TargetPath>$(OutDir)$(TargetName)$(TargetExt)</TargetPath>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<UsingTask TaskName="SimpleRobocopy" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
|
||||
<ParameterGroup>
|
||||
<Sources ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.IO" />
|
||||
<Using Namespace="System.Text.RegularExpressions" />
|
||||
<Using Namespace="Microsoft.Build.Framework" />
|
||||
<Code Type="Fragment" Language="cs"><![CDATA[
|
||||
foreach (var source in Sources)
|
||||
{
|
||||
var item = source.ItemSpec;
|
||||
var dest = source.GetMetadata("DestinationFolder");
|
||||
var isRecursive = source.GetMetadata("IsRecursive");
|
||||
var noSymbols = source.GetMetadata("NoSymbols");
|
||||
var dirExclude = source.GetMetadata("DirExclude");
|
||||
|
||||
var copySymbol = string.IsNullOrEmpty(noSymbols) || noSymbols == "true";
|
||||
Func<string, bool> shouldCopy = filePath => {
|
||||
var dir = Path.GetDirectoryName(filePath);
|
||||
var name = Path.GetFileName(filePath);
|
||||
var ext = Path.GetExtension(filePath).ToUpperInvariant();
|
||||
if (!copySymbol && ext == ".PDB")
|
||||
return false;
|
||||
|
||||
if (!string.IsNullOrEmpty(dirExclude) && Regex.IsMatch(dir, dirExclude, RegexOptions.IgnoreCase))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
Log.LogMessage(MessageImportance.High, "Robocopy: {0} -> {1} recursive: '{2}'", item, dest, isRecursive);
|
||||
if (!Directory.Exists(dest)) {
|
||||
Directory.CreateDirectory(dest);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(isRecursive) &&
|
||||
string.Equals(isRecursive, "true", StringComparison.OrdinalIgnoreCase) &&
|
||||
Directory.Exists(item)) {
|
||||
var files = Directory.EnumerateFiles(item, "*.*", SearchOption.AllDirectories);
|
||||
foreach (var f in files) {
|
||||
if (!File.Exists(f)) // skip directories
|
||||
continue;
|
||||
|
||||
var fName = f.Substring(item.Length + 1);
|
||||
var dName = Path.Combine(dest, fName);
|
||||
var destDir = Path.GetDirectoryName(dName);
|
||||
if (!Directory.Exists(destDir))
|
||||
Directory.CreateDirectory(destDir);
|
||||
Log.LogMessage("Copy {0} -> {1}", f, dName);
|
||||
File.Copy(f, dName, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
var destFile = Path.Combine(dest, Path.GetFileName(item));
|
||||
Log.LogMessage("Copy {0} -> {1}", item, destFile);
|
||||
File.Copy(item, destFile, true);
|
||||
}
|
||||
}
|
||||
]]></Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
|
||||
<Target Name="RobocopyFiles" AfterTargets="_PostBuild" Condition="'@(Robocopy)' != ''">
|
||||
<SimpleRobocopy Sources="@(Robocopy)" Condition="'@(Robocopy)' != ''" />
|
||||
</Target>
|
||||
<Target Name="Build" />
|
||||
<Target Name="_PostBuild" AfterTargets="Build" />
|
||||
</Project>
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MsBuildAllProjects>$(MsBuildAllProjects);$(MsBuildThisFileFullPath)</MsBuildAllProjects>
|
||||
<IsTraversalProject>true</IsTraversalProject>
|
||||
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
|
||||
<UnloadProjectsOnCompletion Condition="'$(UnloadProjectsOnCompletion)' == ''">false</UnloadProjectsOnCompletion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- This target file is only used at the repo root level -->
|
||||
<Target Name="Build" Condition="'@(ProjectFile)' != ''">
|
||||
<MSBuild Projects="@(ProjectFile)" Targets="Build" Properties="BuildingTraversal=$(BuildingTraversal)"
|
||||
BuildInParallel="$(BuildInParallel)"
|
||||
SkipNonexistentProjects="$(SkipNonexistentProjectsInTraversal)"
|
||||
UnloadProjectsOnCompletion="$(UnloadProjectsOnCompletion)" />
|
||||
</Target>
|
||||
|
||||
<!-- Copy Build and change name -->
|
||||
<Target Name="Clean" Condition="'@(ProjectFile)' != ''">
|
||||
<MSBuild Projects="@(ProjectFile)" Targets="Build" Properties="BuildingTraversal=$(BuildingTraversal)"
|
||||
BuildInParallel="$(BuildInParallel)"
|
||||
SkipNonexistentProjects="$(SkipNonexistentProjectsInTraversal)"
|
||||
UnloadProjectsOnCompletion="$(UnloadProjectsOnCompletion)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
|
||||
</Project>
|
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MsBuildAllProjects>$(MsBuildAllProjects);$(MsBuildThisFileFullPath)</MsBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ExtendedTargetsPath>$(REPOROOT)\ossbuild</ExtendedTargetsPath>
|
||||
|
||||
<ObjectRoot Condition="'$(ObjectRoot)' == ''">$(OBJECT_ROOT)</ObjectRoot>
|
||||
<OutputRoot Condition="'$(OutputRoot)' == ''">$(_NTTREE)</OutputRoot>
|
||||
|
||||
<ObjectRoot Condition="'$(ObjectRoot)' == ''">$(BaseDir)\out\obj</ObjectRoot>
|
||||
<OutputRoot Condition="'$(OutputRoot)' == ''">$(BaseDir)\out\bin</OutputRoot>
|
||||
|
||||
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
|
||||
<Platform Condition="'$(Platform)' == ''">x64</Platform>
|
||||
|
||||
<DefaultBuildArchitecture Condition="'$(_defaultBuildArch)' != ''">$(_defaultBuildArch)</DefaultBuildArchitecture>
|
||||
<DefaultBuildArchitecture Condition="'$(DefaultBuildArchitecture)' == ''">amd64</DefaultBuildArchitecture>
|
||||
<DefaultBuildArchitecture Condition="'$(DefaultBuildArchitecture)' == 'x64'">amd64</DefaultBuildArchitecture>
|
||||
|
||||
<BuildArchitecture Condition="'$(_BuildArch)' != ''">$(_BuildArch)</BuildArchitecture>
|
||||
<BuildArchitecture Condition="'$(BuildArchitecture)' == '' AND '$(Platform)' == 'x64'">amd64</BuildArchitecture>
|
||||
<BuildArchitecture Condition="'$(BuildArchitecture)' == ''">$(DefaultBuildArchitecture)</BuildArchitecture>
|
||||
|
||||
<BuildType Condition="'$(Configuration)' == 'Release'">retail</BuildType>
|
||||
<BuildType Condition="'$(BuildType)' == ''">debug</BuildType>
|
||||
|
||||
<BUILD_ALT_DIR Condition="'$(BUILD_ALT_DIR)'=='' AND '$(BuildType)'=='debug'">d</BUILD_ALT_DIR>
|
||||
<ObjectDirectory Condition="'$(ObjectDirectory)' == ''">obj$(BUILD_ALT_DIR)</ObjectDirectory>
|
||||
<BaseIntermediateOutputPath>$(ObjectDirectory)\</BaseIntermediateOutputPath>
|
||||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(BuildArchitecture)\</IntermediateOutputPath>
|
||||
<O>$(IntermediateOutputPath)</O>
|
||||
<ProjectDirRelativeToBaseDir>$(MSBuildProjectDirectory.Substring($(BaseDir.Length)))</ProjectDirRelativeToBaseDir>
|
||||
<OutputPath Condition="'$(OutputPath)' == ''">$(ObjectRoot)$(ProjectDirRelativeToBaseDir)\$(O)</OutputPath>
|
||||
<OutDir>$(OutputPath)</OutDir>
|
||||
|
||||
<VanillaSfproj>true</VanillaSfproj>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|amd64' " />
|
||||
|
||||
<!-- Redirect to system default props -->
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
|
||||
Condition="'$(MSBuildProjectExtension)' != '.vcxproj' and '$(MSBuildProjectExtension)' != '.nuproj'" />
|
||||
|
||||
<!-- Need to get all PkgXXX figured out -->
|
||||
<Import Project="$(REPOROOT)\ossbuild\packageList.props" />
|
||||
<Import Project="$(CONFROOT)\build.props" />
|
||||
|
||||
<!-- Redirect CoreXT nupkgs to standard locations -->
|
||||
<PropertyGroup>
|
||||
<PkgDotNetFxRefAssemblies_Corext>$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2</PkgDotNetFxRefAssemblies_Corext>
|
||||
<PkgMsTest_Corext>$(DevEnvDir)\PublicAssemblies</PkgMsTest_Corext>
|
||||
<!-- Bug in NuProj -->
|
||||
<NuGetToolPath>$(PkgNuproj)\tools</NuGetToolPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- For projects depended by nuproj. CustomAfterMicrosoftCommonTargets? -->
|
||||
<Import Project="$(PkgNuproj)\tools\Microsoft.Common.Nuproj.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,84 @@
|
|||
#Requires -version 3.0
|
||||
param(
|
||||
[string] $PackagesDirectory = $null
|
||||
)
|
||||
|
||||
# Go to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools, run VsMSBuildCmd.bat,
|
||||
# and start PowerShell.
|
||||
Set-StrictMode -version latest
|
||||
|
||||
function SetEnv
|
||||
{
|
||||
# Get the root directory
|
||||
$repoRoot = Join-Path -Resolve $PSScriptRoot ".."
|
||||
$srcRoot = Join-Path -Resolve $repoRoot "src"
|
||||
$outRoot = Join-Path $repoRoot "out"
|
||||
$buildPropsRoot = Join-Path -Resolve $PSScriptRoot "ossbuildenv.props"
|
||||
$confRoot = Join-Path -Resolve $repoRoot ".config"
|
||||
$verPath = Join-Path -Resolve $confRoot ".inc"
|
||||
$asmVerDefFile = Join-Path -Resolve $verPath "versions.xml"
|
||||
|
||||
$verXml = [XML](Get-Content $asmVerDefFile)
|
||||
$ver = $verXml.root.versions.version.value
|
||||
|
||||
$env:REPOROOT = $repoRoot
|
||||
$env:BaseDir = $repoRoot
|
||||
$env:EnlistmentRoot = $repoRoot
|
||||
$env:INETROOT = $repoRoot
|
||||
$env:OBJECT_ROOT = $repoRoot
|
||||
$env:ROOT = $repoRoot
|
||||
$env:_NTTREE = $repoRoot
|
||||
|
||||
$env:SRCROOT = $srcRoot
|
||||
$env:OUTPUTROOT = $outRoot
|
||||
|
||||
$env:EnvironmentConfig = $buildPropsRoot
|
||||
$env:CONFROOT = $confRoot
|
||||
$env:AssemblyVersionDefinitionFile = $asmVerDefFile
|
||||
|
||||
$env:OSSBUILD = "1"
|
||||
$env:BUILD_COREXT = "0"
|
||||
$env:NOTQBUILD = "1"
|
||||
$env:MsBuildArgs = "/consoleloggerparameters:Summary;ForceNoAlign;Verbosity=minimal"
|
||||
$env:BUILDNUMBER = $ver
|
||||
}
|
||||
|
||||
function CreatePackagesProps($rootDir)
|
||||
{
|
||||
$rootDir = [IO.Path]::GetFullPath($rootDir)
|
||||
$propsFile = Join-Path $PSScriptRoot "packageList.props"
|
||||
|
||||
# Restore all nuget packages
|
||||
$conf = Join-Path -Resolve $PSScriptRoot "..\src\packages.config"
|
||||
& nuget restore $conf -PackagesDirectory $rootDir
|
||||
|
||||
# Then generate packageList.props for MSBuild
|
||||
$content = @()
|
||||
$content += "<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>"
|
||||
$content += " <PropertyGroup>"
|
||||
|
||||
$pkgXml = [XML](Get-Content $conf)
|
||||
$pkgXml.packages.package | % {
|
||||
$id = $_.id
|
||||
$ver = $_.version
|
||||
$dir = Join-Path $rootDir "$id.$ver"
|
||||
$name = "Pkg" + ($id.Replace('.', '_'))
|
||||
$content += " <$name>$dir</$name>"
|
||||
}
|
||||
|
||||
$content += " </PropertyGroup>"
|
||||
$content += "</Project>"
|
||||
$content | Out-File -FilePath $propsFile -Encoding utf8 -Force
|
||||
}
|
||||
|
||||
#######################################################################################################################
|
||||
|
||||
if ([string]::IsNullOrEmpty($PackagesDirectory)) {
|
||||
$PackagesDirectory = Join-Path $PSScriptRoot "..\packages"
|
||||
if (-not (Test-Path -PathType Container $PackagesDirectory)) {
|
||||
mkdir $PackagesDirectory
|
||||
}
|
||||
}
|
||||
|
||||
SetEnv
|
||||
CreatePackagesProps $PackagesDirectory
|
|
@ -6,7 +6,6 @@
|
|||
<Import Project="$(ExtendedTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
|
||||
<TrackFileAccess>false</TrackFileAccess>
|
||||
|
||||
<!--
|
||||
|
@ -63,6 +62,7 @@
|
|||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DisableSpecificWarnings>4091</DisableSpecificWarnings>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32_LEAN_AND_MEAN;</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<CustomBuildStep>
|
||||
<Command>$(PkgVisualCpp_Corext)\bin\x64\$(_BuildArch)\lib.exe /OUT:$(BinariesBuildTypeArchDirectory)\$(TargetName)\$(TargetName)$(TargetExt) "$(BinariesBuildTypeArchDirectory)\RSLib_LF\RSLib_LF.lib" "$(BinariesBuildTypeArchDirectory)\RSLib_Common\RSLib_Common.lib" "$(BinariesBuildTypeArchDirectory)\RSLib_Network\RSLib_Network.lib" "$(BinariesBuildTypeArchDirectory)\RSLibImpl\RSLibImpl.lib" /MACHINE:$(Platform) /NOLOGO /LIBPATH:$(BinariesBuildTypeArchDirectory)</Command>
|
||||
<Command>$(LibCmd) /OUT:$(BinariesBuildTypeArchDirectory)\$(TargetName)\$(TargetName)$(TargetExt) "$(BinariesBuildTypeArchDirectory)\RSLib_LF\RSLib_LF.lib" "$(BinariesBuildTypeArchDirectory)\RSLib_Common\RSLib_Common.lib" "$(BinariesBuildTypeArchDirectory)\RSLib_Network\RSLib_Network.lib" "$(BinariesBuildTypeArchDirectory)\RSLibImpl\RSLibImpl.lib" /MACHINE:$(Platform) /NOLOGO /LIBPATH:$(BinariesBuildTypeArchDirectory)</Command>
|
||||
<Outputs>$(Out)$(TargetName)$(TargetName)$(TargetExt);%(Outputs)</Outputs>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<!-- In case we have C# code -->
|
||||
<package id="FluentAssertions" version="4.3.2" targetFramework="net452" />
|
||||
<package id="Nuproj" version="0.11.30" targetFramework="net452" />
|
||||
<package id="StyleCop.Analyzers" version="1.1.0-beta006" targetFramework="net452" />
|
||||
</packages>
|
Загрузка…
Ссылка в новой задаче