Update to ODL 7.6.1 and add some build scripts

This commit is contained in:
Sam Xu 2019-10-03 09:51:35 -07:00
parent 35a35a5f56
commit 35e53bb35e
18 changed files with 687 additions and 9 deletions

19
Build.props Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<!-- Global settings that apply unconditionally. -->
<EnlistmentRoot>$(MSBuildThisFileDirectory.TrimEnd('\'))</EnlistmentRoot>
</PropertyGroup>
<Import Project="$(EnlistmentRoot)\tool\Build.props" />
<PropertyGroup>
<!--OData has some project files with the same name that are targeted for different framework platforms. Isolate their intermediate output folders-->
<IntermediateOutputPath Condition="$(TargetFrameworkFolderName) != ''">$(IntermediateOutputPath.TrimEnd('\'))\$(TargetFrameworkFolderName)</IntermediateOutputPath>
</PropertyGroup>
</Project>

1
build.root Normal file
View File

@ -0,0 +1 @@
Marker file indicating root of build system.

View File

@ -0,0 +1,75 @@
//---------------------------------------------------------------------
// <copyright file="AssemblyInfoCommon.cs" company="Microsoft">
// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
[assembly: AssemblyCompany("Microsoft Corporation")]
// If you want to control this metadata globally but not with the VersionProductName property, hard-code the value below.
// If you want to control this metadata at the individual project level with AssemblyInfo.cs, comment-out the line below.
// If you leave the line below unchanged, make sure to set the property in the root build.props, e.g.: <VersionProductName Condition="'$(VersionProductName)'==''">Your Product Name</VersionProductName>
// [assembly: AssemblyProduct("%VersionProductName%")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyTrademark("Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the U.S. and/or other countries.")]
[assembly: AssemblyCulture("")]
#if (DEBUG || _DEBUG)
[assembly: AssemblyConfiguration("Debug")]
#endif
#if ASSEMBLY_ATTRIBUTE_PRODUCT_VS
[assembly: AssemblyProduct("Microsoft (R) Visual Studio (R) 2010")]
#else
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
#endif
// disable CLSCompliant as the common extensions library decided not to support this
// see https://github.com/aspnet/AspNetCore/issues/2689#issuecomment-354693946
[assembly: CLSCompliant(false)]
#if ASSEMBLY_ATTRIBUTE_COM_VISIBLE
[assembly: ComVisible(true)]
#else
[assembly: ComVisible(false)]
#endif
#if ASSEMBLY_ATTRIBUTE_COM_COMPATIBLE_SIDEBYSIDE
[assembly:ComCompatibleVersion(1,0,3300,0)]
#endif
#if ASSEMBLY_ATTRIBUTE_ALLOW_PARTIALLY_TRUSTED_CALLERS
[assembly: AllowPartiallyTrustedCallers]
#else
#if ASSEMBLY_ATTRIBUTE_CONDITIONAL_APTCA_L2
[assembly:AllowPartiallyTrustedCallers(PartialTrustVisibilityLevel=PartialTrustVisibilityLevel.NotVisibleByDefault)]
#endif
#endif
#if ASSEMBLY_ATTRIBUTE_TRANSPARENT_ASSEMBLY
[assembly: SecurityTransparent]
#endif
#if !SUPPRESS_SECURITY_RULES
#if SECURITY_MIGRATION && !ASSEMBLY_ATTRIBUTE_CONDITIONAL_APTCA_L2
#if ASSEMBLY_ATTRIBUTE_SKIP_VERIFICATION_IN_FULLTRUST
[assembly: SecurityRules(SecurityRuleSet.Level1, SkipVerificationInFullTrust = true)]
#else
[assembly: SecurityRules(SecurityRuleSet.Level1)]
#endif
#else
#if ASSEMBLY_ATTRIBUTE_SKIP_VERIFICATION_IN_FULLTRUST
[assembly: SecurityRules(SecurityRuleSet.Level2, SkipVerificationInFullTrust = true)]
#else
[assembly: SecurityRules(SecurityRuleSet.Level2)]
#endif
#endif
#endif
[assembly:NeutralResourcesLanguageAttribute("en-US")]

View File

@ -0,0 +1,43 @@
//---------------------------------------------------------------------
// <copyright file="AssemblyKeys.cs" company="Microsoft">
// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------
/// <summary>
/// Sets public key string for friend assemblies.
/// </summary>
internal static class AssemblyRef
{
#if DelaySignKeys
/// <summary>ProductPublicKey is an official MS supported public key for external releases.</summary>
internal const string ProductPublicKey = ", PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
/// <summary>TestPublicKey is an unsupported strong key for testing purpose only.</summary>
internal const string TestPublicKey = ", PublicKey=0024000004800000940000000602000000240000525341310004000001000100197c25d0a04f73cb271e8181dba1c0c713df8deebb25864541a66670500f34896d280484b45fe1ff6c29f2ee7aa175d8bcbd0c83cc23901a894a86996030f6292ce6eda6e6f3e6c74b3c5a3ded4903c951e6747e6102969503360f7781bf8bf015058eb89b7621798ccc85aaca036ff1bc1556bb7f62de15908484886aa8bbae";
/// <summary>Product public key token.</summary>
internal const string ProductPublicKeyToken = "31bf3856ad364e35";
#elif TestSignKeys
/// <summary>Dont know what this is</summary>
internal const string TestPublicKey = ", PublicKey=0024000004800000940000000602000000240000525341310004000001000100197c25d0a04f73cb271e8181dba1c0c713df8deebb25864541a66670500f34896d280484b45fe1ff6c29f2ee7aa175d8bcbd0c83cc23901a894a86996030f6292ce6eda6e6f3e6c74b3c5a3ded4903c951e6747e6102969503360f7781bf8bf015058eb89b7621798ccc85aaca036ff1bc1556bb7f62de15908484886aa8bbae";
/// <summary>Dont know what this is</summary>
internal const string ProductPublicKey = TestPublicKey;
/// <summary>Dont know what this is</summary>
internal const string ProductPublicKeyToken = "69c3241e6f0468ca";
#else
/// <summary>No signing</summary>
internal const string ProductPublicKey = "";
/// <summary>No signing</summary>
internal const string TestPublicKey = "";
/// <summary>No signing</summary>
internal const string ProductPublicKeyToken = "";
#endif
}

View File

@ -0,0 +1,21 @@
//---------------------------------------------------------------------
// <copyright file="AssemblyMetadataAttribute.cs" company="Microsoft">
// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------
namespace System.Reflection
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
internal sealed class AssemblyMetadataAttribute : Attribute
{
public AssemblyMetadataAttribute(string key, string value)
{
Key = key;
Value = value;
}
public string Key { get; set; }
public string Value { get; set; }
}
}

View File

@ -0,0 +1,201 @@
//---------------------------------------------------------------------
// <copyright file="AssemblyRefs.cs" company="Microsoft">
// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
/// <summary>Current assembly reference</summary>
/// <remarks>DO NOT FORGET TO ALSO UPDATE AssemblyRefs.vb</remarks>
internal static class DataFxAssemblyRef
{
/// <summary>Current assembly names</summary>
internal static class Name
{
internal const string mscorlib = "mscorlib";
internal const string System = "System";
internal const string SystemCore = "System.Core";
internal const string SystemData = "System.Data";
internal const string SystemDataDataSetExtensions = "System.Data.DataSetExtensions";
internal const string SystemDataEntity = "System.Data.Entity";
internal const string SystemDataLinq = "System.Data.Linq";
internal const string SystemDrawing = "System.Drawing";
internal const string SystemNumerics = "System.Numerics";
internal const string SystemRuntimeRemoting = "System.Runtime.Remoting";
internal const string SystemRuntimeSerialization = "System.Runtime.Serialization";
internal const string SystemServiceModel = "System.ServiceModel";
internal const string SystemWeb = "System.Web";
internal const string SystemWebEntity = "System.Web.Entity";
internal const string SystemWebEntityDesign = "System.Web.Entity.Design";
internal const string SystemXml = "System.Xml";
internal const string SystemXmlLinq = "System.Xml.Linq";
internal const string DataEntity = "System.Data.Entity";
internal const string EntityFramework = "EntityFramework";
internal const string DataEntityDesign = "System.Data.Entity.Design";
internal const string DataServices = "Microsoft.OData.Service";
internal const string DataServicesClient = "Microsoft.OData.Client";
internal const string DataSvcUtil = "DataSvcUtil";
internal const string OData = "Microsoft.OData.Core";
internal const string Spatial = "Microsoft.Spatial";
internal const string EntityDataModel = "Microsoft.OData.Edm";
}
/// <summary>Current assembly file names</summary>
internal static class File
{
/// <summary>base version for data framework</summary>
internal const string DS_BaseVersion = VersionConstants.ReleaseVersion;
/// <summary>where to find desktop reference client sku reference assemblies</summary>
internal const string DotNetFrameworkV4_ClientReferenceAssemblyPath = @"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client";
/// <summary>where to find desktop reference extended sku reference assemblies</summary>
internal const string DotNetFrameworkV4_ReferenceAssemblyPath = @"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0";
/// <summary>where find executable binaries</summary>
internal const string DotNetFrameworkV4_InstallPath = @"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319";
internal const string SilverlightV5_ReferenceAssemblyPath = @"%ProgramFiles%\Microsoft Silverlight\5.1.20913.0";
internal const string SilverlightV5_SdkClientReferenceAssemblyPath = @"%ProgramFiles%\Microsoft SDKs\Silverlight\v5.0\Libraries\Client";
internal const string SilverlightV5_SdkServerReferenceAssemblyPath = @"%ProgramFiles%\Microsoft SDKs\Silverlight\v5.0\Libraries\Server";
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal static string DE_InstallPath
{
get { return GetDE_InstallPath(); }
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal static string DS_InstallPath
{
get { return GetDS_InstallPath(); }
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal static string DS_PortableInstallPath
{
get { return GetDS_PortableInstallPath(); }
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal static string DS_Tools_InstallPath
{
get { return GetDS_Tools_InstallPath(); }
}
/// <summary>where to find desktop reference assemblies</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal static string DE_ReferenceAssemblyPath
{
get { return GetDE_InstallPath(); }
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal static string DS_ReferenceAssemblyPath
{
get { return GetDS_InstallPath(); }
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
private static string GetDE_InstallPath()
{
return RuntimeEnvironment.GetRuntimeDirectory();
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
private static string GetDS_InstallPath()
{
return Environment.ExpandEnvironmentVariables(Environment.Is64BitOperatingSystem
? @"%ProgramFiles(x86)%\Microsoft WCF Data Services\" + DS_BaseVersion + @"\bin\.NetFramework"
: @"%ProgramFiles%\Microsoft WCF Data Services\" + DS_BaseVersion + @"\bin\.NetFramework");
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
private static string GetDS_PortableInstallPath()
{
return Environment.ExpandEnvironmentVariables(Environment.Is64BitOperatingSystem
? @"%ProgramFiles(x86)%\Microsoft WCF Data Services\" + DS_BaseVersion + @"\bin\.NetPortable"
: @"%ProgramFiles%\Microsoft WCF Data Services\" + DS_BaseVersion + @"\bin\.NetPortable");
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
private static string GetDS_Tools_InstallPath()
{
return Environment.ExpandEnvironmentVariables(Environment.Is64BitOperatingSystem
? @"%ProgramFiles(x86)%\Microsoft WCF Data Services\" + DS_BaseVersion + @"\bin\tools"
: @"%ProgramFiles%\Microsoft WCF Data Services\" + DS_BaseVersion + @"\bin\tools");
}
/// <summary>where to find silverlight reference assemblies</summary>
internal const string DS_SilverlightReferenceAssemblyPath = @"%ProgramFiles%\Microsoft WCF Data Services\" + DS_BaseVersion + @"\bin\Silverlight";
internal const string EntityDataModel = "Microsoft.OData.Edm.dll";
internal const string DataEntity = "System.Data.Entity.dll";
internal const string EntityFramework = "EntityFramework.dll";
internal const string DataEntityDesign = "System.Data.Entity.Design.dll";
internal const string DataServices = "Microsoft.OData.Service.dll";
internal const string DataServicesClient = "Microsoft.OData.Client.dll";
internal const string DataServicesSilverlightClient = "Microsoft.OData.Client.SL.dll";
internal const string DataSvcUtil = "DataSvcUtil.exe";
internal const string ODataLib = "Microsoft.OData.Core.dll";
internal const string SpatialCore = "Microsoft.Spatial.dll";
internal const string System = "System.dll";
internal const string SystemCore = "System.Core.dll";
internal const string SystemIO = "System.IO.dll";
internal const string SystemRuntime = "System.Runtime.dll";
internal const string SystemXml = "System.Xml.dll";
internal const string SystemXmlReaderWriter = "System.Xml.ReaderWriter.dll";
}
internal const string DataFxAssemblyVersion = VersionConstants.AssemblyVersion;
internal const string FXAssemblyVersion = "4.0.0.0";
internal const string EcmaPublicKey = "b77a5c561934e089";
internal const string EcmaPublicKeyToken = EcmaPublicKey;
internal const string EcmaPublicKeyFull = "00000000000000000400000000000000";
internal const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
internal const string MicrosoftPublicKeyToken = MicrosoftPublicKey;
internal const string MicrosoftPublicKeyFull = "002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293";
internal const string SharedLibPublicKey = "31bf3856ad364e35";
internal const string SharedLibPublicKeyToken = SharedLibPublicKey;
internal const string SharedLibPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
internal const string SilverlightPublicKey = "31bf3856ad364e35";
internal const string SilverlightPublicKeyToken = SilverlightPublicKey;
internal const string SilverlightPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
internal const string SilverlightPlatformPublicKey = "7cec85d7bea7798e";
internal const string SilverlightPlatformPublicKeyToken = SilverlightPlatformPublicKey;
internal const string SilverlightPlatformPublicKeyFull = "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
private const string DataFxFramework = ", Version=" + DataFxAssemblyVersion + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
private const string MicrosoftFramework = ", Version=" + FXAssemblyVersion + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
private const string NetFxFramework = ", Version=" + FXAssemblyVersion + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
internal const string Mscorlib = Name.mscorlib + NetFxFramework;
internal const string System = Name.System + NetFxFramework;
internal const string SystemCore = Name.SystemCore + NetFxFramework;
internal const string SystemData = Name.SystemData + NetFxFramework;
internal const string SystemDataDataSetExtensions = Name.SystemDataDataSetExtensions + NetFxFramework;
internal const string SystemDataEntity = Name.SystemDataEntity + NetFxFramework;
internal const string SystemDataLinq = Name.SystemDataLinq + NetFxFramework;
internal const string SystemDrawing = Name.SystemDrawing + NetFxFramework;
internal const string SystemNumerics = Name.SystemNumerics + NetFxFramework;
internal const string SystemRuntimeRemoting = Name.SystemRuntimeRemoting + NetFxFramework;
internal const string SystemRuntimeSerialization = Name.SystemRuntimeSerialization + NetFxFramework;
internal const string SystemServiceModel = Name.SystemServiceModel + NetFxFramework;
internal const string SystemWeb = Name.SystemWeb + MicrosoftFramework;
internal const string SystemWebEntity = Name.SystemWebEntity + NetFxFramework;
internal const string SystemWebEntityDesign = Name.SystemWebEntityDesign + NetFxFramework;
internal const string SystemXml = Name.SystemXml + NetFxFramework;
internal const string SystemXmlLinq = Name.SystemXmlLinq + NetFxFramework;
internal const string DataServices = Name.DataServices + DataFxFramework;
internal const string DataServicesClient = Name.DataServicesClient + DataFxFramework;
internal const string EntityDataModel = Name.EntityDataModel + DataFxFramework;
internal const string OData = Name.OData + DataFxFramework;
internal const string Spatial = Name.Spatial + DataFxFramework;
}

13
src/Build.props Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<EnlistmentRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))\</EnlistmentRoot>
</PropertyGroup>
<Import Project="..\Build.props" />
<!-- <Import Project="$(EnlistToolPath)\versioning.props" />
-->
</Project>

View File

@ -19,8 +19,10 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<Import Project="..\Build.props" />
<ItemGroup>
<PackageReference Include="Microsoft.OData.Edm" Version="7.6.1-beta" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.6.1" />
<PackageReference Include="Microsoft.OpenApi" Version="1.1.4" />
</ItemGroup>

View File

@ -32,8 +32,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.OData.Edm, Version=7.6.1.30918, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.OData.Edm.7.6.1-beta\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
<Reference Include="Microsoft.OData.Edm, Version=7.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.OpenApi, Version=1.1.4.0, Culture=neutral, PublicKeyToken=3f5743946376f042, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.OpenApi.1.1.4\lib\net46\Microsoft.OpenApi.dll</HintPath>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.OData.Edm" version="7.6.1-beta" targetFramework="net461" />
<package id="Microsoft.OData.Edm" version="7.6.1" targetFramework="net461" />
<package id="Microsoft.OpenApi" version="1.1.4" targetFramework="net461" />
</packages>

188
tool/After.Common.targets Normal file
View File

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Ensures that if this file changes it forces a rebuild -->
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<BuildDependsOn>
GenerateTextStringResources;
GenerateAssemblyAttributeFile;
GenerateVersionConstantsFile;
ExcludeAssemblyFilesFromSourceAnalysis;
$(BuildDependsOn);
</BuildDependsOn>
</PropertyGroup>
<Target Name="AfterBuild" DependsOnTargets="$(AfterBuildDependsOn)"/>
<!-- ********************************************************************************************* -->
<!-- *** Generate resources from .txt format resource files -->
<!-- ********************************************************************************************* -->
<PropertyGroup>
<GenerateTextStringResourcesDependsOn>
PrepareForBuild;
GenerateStringResources;
</GenerateTextStringResourcesDependsOn>
</PropertyGroup>
<Target Name="GenerateTextStringResources"
Condition="'@(TextStringResource)' != ''"
DependsOnTargets="$(GenerateTextStringResourcesDependsOn)"/>
<Target Name="GenerateStringResources">
<ItemGroup>
<EmbeddedResource Include="@(TextStringResource)" Condition="'%(TextStringResource.GenerateResource)' == 'true'">
<!-- "Resx" indicates it should go through GenerateResource -->
<Type>Resx</Type>
<WithCulture>false</WithCulture>
<ManifestResourceName>%(Filename)</ManifestResourceName>
</EmbeddedResource>
</ItemGroup>
</Target>
<!-- ********************************************************************************************* -->
<!-- ********************************************************************************************* -->
<!-- *** Exclude certain files globally from source analysis. In previous build system, these files-->
<!-- *** were globally excluded in a edit to StyleCop.targets. This replicates the same behavior. -->
<!-- ********************************************************************************************* -->
<Target Name="ExcludeAssemblyFilesFromSourceAnalysis">
<ItemGroup>
<Compile Condition="'%(Filename)%(Extension)'=='AssemblyAttributes.cs'
or '%(Filename)%(Extension)'=='AssemblyRefs.cs'
or '%(Filename)%(Extension)'=='.NETFramework,Version=v4.0.AssemblyAttributes.cs'
or '%(Filename)%(Extension)'=='PlatformHelper.cs'
or '%(Filename)%(Extension)'=='VersionConstants.cs'
or '%(Filename)%(Extension)'=='AssemblyMetadataAttribute.cs'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
</ItemGroup>
</Target>
<!-- ********************************************************************************************* -->
<!-- ********************************************************************************************* -->
<!-- *** Generate a file with assembly attributes and hook it into the build -->
<!-- ********************************************************************************************* -->
<Target Name="GenerateAssemblyAttributeFile"
Inputs="$(MSBuildProjectFile);$(CustomBuildExtensionsPath)\Versioning.props"
Outputs="$(IntermediateOutputPath.TrimEnd('\'))\AssemblyAttributes$(DefaultLanguageSourceExtension)"
Condition="'$(ShouldGenerateAssemblyAttributeFile)' == 'true'">
<PropertyGroup>
<!--Add more templates if we generate AssemblyAttribute files for other project types.-->
<GenerateAssemblyAttributeTemplate>UNDEFINED_GenerateAssemblyAttributeTemplate</GenerateAssemblyAttributeTemplate>
<GenerateAssemblyAttributeTemplateCSharp>
using System.Reflection;
using System.Resources;
[assembly: AssemblyDescription("%AssemblyNameFull%")]
[assembly: AssemblyTitle("%AssemblyNameFull%")]
[assembly: AssemblyDefaultAlias("%AssemblyNameFull%")]
[assembly: AssemblyFileVersion("%VersionFull%")]
[assembly: AssemblyInformationalVersion("%VersionFull%")]
[assembly: AssemblyVersion("%VersionFullSemantic%")]
[assembly: SatelliteContractVersion("%VersionFull%")]
[assembly: AssemblyMetadata("Serviceable", "True")]
</GenerateAssemblyAttributeTemplateCSharp>
</PropertyGroup>
<PropertyGroup Condition="'$(Language)' == 'C#'">
<GenerateAssemblyAttributeTemplate>$(GenerateAssemblyAttributeTemplateCSharp)</GenerateAssemblyAttributeTemplate>
<AssemblyMetadataAttributeFile>$(VersionOutputPath)\AssemblyMetadataAttribute$(DefaultLanguageSourceExtension)</AssemblyMetadataAttributeFile>
<DefineAssemblyMetadataAttribute Condition="'$(TargetFrameworkVersion)' == 'v3.5' or '$(TargetFrameworkVersion)' == 'v4.0'">true</DefineAssemblyMetadataAttribute>
</PropertyGroup>
<PropertyGroup>
<AssemblyAttributeOutputFile>$(IntermediateOutputPath.TrimEnd("\\"))\AssemblyAttributes$(DefaultLanguageSourceExtension)</AssemblyAttributeOutputFile>
<AssemblyNameFull>$(AssemblyName)$(TargetExt)</AssemblyNameFull>
<AssemblyAttributeFileContentsTransformed>$([System.String]::Copy('$(GenerateAssemblyAttributeTemplate)').Replace("%25AssemblyNameFull%25",$(AssemblyNameFull)).Replace("%25VersionFull%25",$(VersionFull)).Replace("%25VersionFullSemantic%25",$(VersionFullSemantic)))</AssemblyAttributeFileContentsTransformed>
</PropertyGroup>
<Message Text="GenerateAssemblyAttributeFile: Generating $(AssemblyAttributeOutputFile)" Importance="high" Condition="'$(DebugMessages)' == 'true'"/>
<MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists($(IntermediateOutputPath))"/>
<WriteLinesToFile
File="$(AssemblyAttributeOutputFile)"
Lines="$(AssemblyAttributeFileContentsTransformed)"
Overwrite="true"
Encoding="Unicode"
ContinueOnError="false"/>
<ItemGroup>
<Compile Include="$(AssemblyAttributeOutputFile)" />
<Compile Include="$(AssemblyMetadataAttributeFile)" Condition="'$(DefineAssemblyMetadataAttribute)' == 'true'" />
</ItemGroup>
</Target>
<!-- ********************************************************************************************* -->
<!-- ********************************************************************************************* -->
<!-- *** Generate a file with version constants and hook it into the build -->
<!-- ********************************************************************************************* -->
<Target Name="GenerateVersionConstantsFile"
Inputs="$(MSBuildProjectFile);$(CustomBuildExtensionsPath)\Versioning.props"
Outputs="$(IntermediateOutputPath.TrimEnd('\'))\VersionConstants$(DefaultLanguageSourceExtension)"
Condition="'$(ShouldGenerateVersionConstantsFile)' == 'true'">
<PropertyGroup>
<!--Add more templates if we generate VersionConstants files for other project types.-->
<GenerateVersionConstantsTemplate>UNDEFINED_GenerateVersionConstantsTemplate</GenerateVersionConstantsTemplate>
<GenerateVersionConstantsTemplateCSharp>
internal static class VersionConstants
{
internal const string ReleaseVersion = "%VersionFullSemantic%";
internal const string AssemblyVersion = "%VersionFullSemantic%";
}
</GenerateVersionConstantsTemplateCSharp>
<GenerateVersionConstantsTemplateVB>
Friend Class VersionConstants
Friend Shared ReleaseVersion As String = "%VersionFullSemantic%"
Friend Shared AssemblyVersion As String = "%VersionFullSemantic%"
End Class
</GenerateVersionConstantsTemplateVB>
</PropertyGroup>
<PropertyGroup Condition="'$(Language)' == 'C#'">
<GenerateVersionConstantsTemplate>$(GenerateVersionConstantsTemplateCSharp)</GenerateVersionConstantsTemplate>
</PropertyGroup>
<PropertyGroup Condition="'$(Language)' == 'VB'">
<GenerateVersionConstantsTemplate>$(GenerateVersionConstantsTemplateVB)</GenerateVersionConstantsTemplate>
</PropertyGroup>
<PropertyGroup>
<VersionConstantsOutputFile>$(IntermediateOutputPath.TrimEnd("\\"))\VersionConstants$(DefaultLanguageSourceExtension)</VersionConstantsOutputFile>
<VersionConstantsFileContentsTransformed>$([System.String]::Copy('$(GenerateVersionConstantsTemplate)').Replace("%25VersionFull%25",$(VersionFull)).Replace("%25VersionFullSemantic%25",$(VersionFullSemantic)))</VersionConstantsFileContentsTransformed>
</PropertyGroup>
<Message Text="GenerateVersionConstantsFile: Generating $(VersionConstantsOutputFile)" Importance="high" Condition="'$(DebugMessages)' == 'true'"/>
<MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists($(IntermediateOutputPath))"/>
<WriteLinesToFile
File="$(VersionConstantsOutputFile)"
Lines="$(VersionConstantsFileContentsTransformed)"
Overwrite="true"
Encoding="Unicode"
ContinueOnError="false"/>
<ItemGroup>
<Compile Include="$(VersionConstantsOutputFile)" />
</ItemGroup>
</Target>
<!-- ********************************************************************************************* -->
<!-- Execute StyleCop for each project -->
<Import Project="$(StyleCopTargets)" Condition="Exists('$(StyleCopTargets)') and '$(RunStyleCop)' == 'true' and '$(EnableStyleCop)' == 'true'"/>
<!-- Chain into the defaults from the toolset -->
<Import Condition="'$(DefaultCustomAfterMicrosoftCommonTargets)' != ''" Project="$(DefaultCustomAfterMicrosoftCommonTargets)" />
</Project>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<VersionRunBeforeTargets>$(VersionRunBeforeTargets);CoreCompile</VersionRunBeforeTargets>
<VersionOutputPath>$(EnlistmentRoot)\src\AssemblyInfo</VersionOutputPath>
<AssemblyInfoCommonFile Condition="'$(AssemblyInfoCommonFile)'==''">AssemblyInfoCommon$(DefaultLanguageSourceExtension)</AssemblyInfoCommonFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(VersionOutputPath)\$(AssemblyInfoCommonFile)">
<ExcludeFromSourceAnalysis>true</ExcludeFromSourceAnalysis>
<Link>$(AssemblyInfoCommonFile)</Link>
</Compile>
</ItemGroup>
</Project>

20
tool/Build.props Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Label="Define Basic Properties">
<EnlistmentRoot Condition=" '$(EnlistmentRoot)'=='' ">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))</EnlistmentRoot>
<EnlistmentRoot>$(EnlistmentRoot.TrimEnd({'\\'}))</EnlistmentRoot>
<EnlistToolPath Condition=" '$(EnlistToolPath)'=='' ">$(EnlistmentRoot)\tool</EnlistToolPath>
</PropertyGroup>
<PropertyGroup>
<!-- Before/After injection Settings -->
<CustomBeforeMicrosoftCommonTargets>$(MSBuildThisFileDirectory)Before.Common.targets</CustomBeforeMicrosoftCommonTargets>
<CustomAfterMicrosoftCommonTargets>$(MSBuildThisFileDirectory)After.Common.targets</CustomAfterMicrosoftCommonTargets>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,34 @@
param(
[string]$BuildSourceDir,
[string]$folderName,
[string]$branchName,
[string]$resultRoot,
[string]$PoliCheckPath
)
#
#Example:
# RunPoliCheck.ps1 -BuildSourceDir "C:\BuildAgent\_work\32\s"
# -folderName "src"
# -branchName "odata.net-master"
# -resultRoot "C:\Users\ODatabld\Documents\PoliCheck\LatestRunResult"
# -PoliCheckPath "C:\Program Files (x86)\Microsoft\PoliCheck\"
#
$targetPath= "${BuildSourceDir}\${folderName}"
Write-Output "targetPath: ${targetPath}"
$result="${resultRoot}\${branchName}\poli_result_${folderName}.xml"
cd "${PoliCheckPath}"
.\Policheck.exe /F:$targetPath /T:9 /Sev:"1|2" /PE:2 /O:$result
$FileContent = Get-Content $result
$PassResult = Select-String -InputObject $FileContent -Pattern "<TermTbl />"
If ($PassResult.Matches.Count -eq 0) {
Write-Error "PoliCheck failed for target ${targetPath}. For details, please check this result file on build machine: ${result}: section <Result TotalOccurences=...>."
exit 1
}
Write-Output "PoliCheck pass for target ${targetPath}"

View File

@ -32,8 +32,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.OData.Edm, Version=7.6.1.30918, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.OData.Edm.7.6.1-beta\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
<Reference Include="Microsoft.OData.Edm, Version=7.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.OpenApi, Version=1.1.4.0, Culture=neutral, PublicKeyToken=3f5743946376f042, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.OpenApi.1.1.4\lib\net46\Microsoft.OpenApi.dll</HintPath>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.OData.Edm" version="7.6.1-beta" targetFramework="net461" />
<package id="Microsoft.OData.Edm" version="7.6.1" targetFramework="net461" />
<package id="Microsoft.OpenApi" version="1.1.4" targetFramework="net461" />
</packages>

View File

@ -5,14 +5,14 @@
<PropertyGroup>
<VersionMajor Condition="'$(VersionMajor)' == ''">1</VersionMajor>
<VersionMinor Condition="'$(VersionMinor)' == ''">0</VersionMinor>
<VersionBuild Condition="'$(VersionBuild)' == ''">0</VersionBuild>
<VersionBuild Condition="'$(VersionBuild)' == ''">1</VersionBuild>
<VersionRelease Condition="'$(VersionRelease)' == ''"></VersionRelease>
</PropertyGroup>
<!-- For NuGet Package Dependencies -->
<PropertyGroup>
<OpenApiCorePackageDependency>[1.1.4, 2.0.0)</OpenApiCorePackageDependency>
<ODataEdmPackageDependency>[7.6.0, 8.0.0)</ODataEdmPackageDependency>
<ODataEdmPackageDependency>[7.6.1, 8.0.0)</ODataEdmPackageDependency>
</PropertyGroup>
<!--

40
tool/versioning.props Normal file
View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Set the version number: major, minor, build and release (i.e. alpha, beta or blank for RTM)-->
<PropertyGroup>
<VersionMajor Condition="'$(VersionMajor)' == ''">1</VersionMajor>
<VersionMinor Condition="'$(VersionMinor)' == ''">0</VersionMinor>
<VersionBuild Condition="'$(VersionBuild)' == ''">1</VersionBuild>
<VersionRelease Condition="'$(VersionRelease)' == ''"></VersionRelease>
</PropertyGroup>
<!-- For NuGet Package Dependencies -->
<PropertyGroup>
<OpenApiCorePackageDependency>[1.1.4, 2.0.0)</OpenApiCorePackageDependency>
<ODataEdmPackageDependency>[7.6.1, 8.0.0)</ODataEdmPackageDependency>
</PropertyGroup>
<!--
Revision number is a date code. Note that this only work for 6 years before the year part (year minus 2017)
overflows the Int16. The system convert below will throw errors when this happens.
-->
<PropertyGroup>
<VersionStartYear Condition="'$(VersionStartYear)' == ''">2017</VersionStartYear>
<VersionDateCode>$([System.Convert]::ToInt16('$([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd"))'))</VersionDateCode>
<VersionRevision Condition="'$(VersionRevision)' == '' OR '$(VersionRevision)' == '0'">$([System.Convert]::ToString($(VersionDateCode)))</VersionRevision>
</PropertyGroup>
<!-- Product Version -->
<PropertyGroup>
<VersionFullSemantic>$(VersionMajor).$(VersionMinor).$(VersionBuild)</VersionFullSemantic>
<VersionFull>$(VersionFullSemantic).$(VersionRevision)</VersionFull>
</PropertyGroup>
<!-- For NuGet Packages -->
<PropertyGroup>
<VersionNuGetSemantic>$(VersionFullSemantic)</VersionNuGetSemantic>
<VersionNuGetSemantic Condition="'$(VersionRelease)'!=''">$(VersionFullSemantic)-$(VersionRelease)</VersionNuGetSemantic>
</PropertyGroup>
</Project>