Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
trigger:
- master

name: 'ODataConnectedService'
name: 'ODataCodeGenTools'

pool:
vmImage: 'windows-latest'
Expand All @@ -17,14 +17,18 @@ variables:
productFiles: 'Microsoft.OData.ConnectedService.*?(*.dll|*.config|*.pdb)'
productBinPathVs2022Plus: '$(connectedServiceDir)\src\ODataConnectedService_VS2022Plus\bin\$(BuildConfiguration)'
productFilesVs2022Plus: 'Microsoft.OData.ConnectedService.VS2022Plus.*?(*.dll|*.config|*.pdb)'
productFilesODataCLI: 'Microsoft.OData.Cli.*?(*.dll|*.config|*.pdb)'
testBinPath: '$(connectedServiceDir)\test\ODataConnectedService.Tests\bin\$(BuildConfiguration)\'
vsixPath: '$(productBinPath)'
vsixFile: 'Microsoft.OData.ConnectedService.vsix'
vsixFileVs2022Plus: 'Microsoft.OData.ConnectedService.VS2022Plus.vsix'
nupkgFileODataCLI: 'Microsoft.OData.Cli.nupkg'
signingFiles: 'Microsoft.OData.ConnectedService.dll'
signingFilesVs2022Plus: 'Microsoft.OData.ConnectedService.VS2022Plus.dll'
signingFilesODataCLI: 'Microsoft.OData.Cli.dll'
mainDll: 'Microsoft.OData.ConnectedService.dll'
mainDllVs2022Plus: 'Microsoft.OData.ConnectedService.VS2022Plus.dll'
mainDllODataCLI: 'Microsoft.OData.Cli.dll'
testDll: 'ODataConnectedService.Tests.dll'
snExe: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe'
snExe64: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe'
Expand All @@ -51,6 +55,14 @@ stages:
solution: '$(sln)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

- task: DotNetCoreCLI@2
displayName: 'Pack Microsoft.OData.Cli package'
inputs:
command: pack
packagesToPack: src/Microsoft.OData.Cli/Microsoft.OData.Cli.csproj
outputDir: '$(Build.ArtifactStagingDirectory)\ODataCLINupkg'
nobuild: true

- task: VSTest@2
displayName: 'Run tests'
Expand Down Expand Up @@ -106,6 +118,13 @@ stages:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\VSIX2022Plus'
ArtifactName: 'VSIX2022Plus'
publishLocation: 'Container'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact - ODataCLINupkg'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\ODataCLINupkg'
ArtifactName: 'ODataCLINupkg'
publishLocation: 'Container'

- publish: configs
displayName: Publish Signing Scripts
Expand Down Expand Up @@ -199,4 +218,47 @@ stages:
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/SignedVSIX2022Plus'
ArtifactName: 'SignedVSIX2022Plus'
publishLocation: 'Container'

- stage: CodeSignODataCLI
condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
jobs:
- deployment: CodeSign
displayName: Code Signing
pool:
vmImage: windows-latest
environment: Code Sign - Approvals
variables:
- group: Code Signing
strategy:
runOnce:
deploy:
steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
displayName: Install SignTool tool

# Sign the vsix archive as well as files contained in the vsix that are listed in config/filelist.txt
# For more info about the SignClient tool, visit: https://github.com/dotnet/SignService
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\ODataCLINupkg" `
--input "$(nupkgFileODataCLI)" `
--output "$(Build.ArtifactStagingDirectory)\SignedODataCLINupkg" `
--config "$(Pipeline.Workspace)\configs\SignClient.json" `
--filelist "$(Pipeline.Workspace)\configs\filelist.txt" `
--user "$(SignClientUser)" `
--secret "$(SignClientSecret)" `
--name "OData CLI" `
--description "OData CLI" `
--descriptionUrl "https://github.com/OData/ODataConnectedService"
displayName: Code signing - ODataCLINupkg
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact - Nuget Packages'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\SignedODataCLINupkg'
ArtifactName: SignedODataCLINupkg
publishLocation: 'Container'
24 changes: 24 additions & 0 deletions src/Microsoft.OData.Cli/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The MIT License (MIT)

Copyright (c) .NET Foundation and Contributors

OData Cli
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 21 additions & 4 deletions src/Microsoft.OData.Cli/Microsoft.OData.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<RootNamespace>Microsoft.OData.Cli</RootNamespace>
<AssemblyName>odata-cli</AssemblyName>
<AssemblyName>Microsoft.OData.Cli</AssemblyName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<Version>0.1.0</Version>
<Authors>Microsoft</Authors>
<Product>Microsoft.OData.Cli</Product>
<Description>The odata-cli is a CLI tool for generating strongly typed C# and Visual Basic client code for a specified OData service. It generates a DataServiceContext class to interact with the service and CLR types for each entity type and complex type in the service model. It does exactly what the OData Connected Service does. </Description>
<PackageTags>odata</PackageTags>
<Copyright>Copyright 2022</Copyright>
<RepositoryUrl>https://github.com/OData/ODataConnectedService/tree/master/src/Microsoft.OData.Cli</RepositoryUrl>
<PackageLicenseFile>License.txt</PackageLicenseFile>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>tools\OcsKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="17.0.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.0.0" />
<PackageReference Include="Microsoft.Build" Version="17.0.0" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.4.1" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.0.0" ExcludeAssets="runtime" />
<PackageReference Include="NuGet.PackageManagement" Version="6.1.0" />
<PackageReference Include="NuGet.Protocol" Version="6.3.1" />
<PackageReference Include="System.CodeDom" Version="7.0.0-preview.1.22076.8" />
Expand All @@ -21,4 +34,8 @@
<ProjectReference Include="..\Microsoft.OData.CodeGen\Microsoft.OData.CodeGen.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="LICENSE.txt" Pack="true" Visible="false" PackagePath="$(PackageLicenseFile)" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Microsoft.OData.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Program
{
static async Task Main(string[] args)
{
Build.Locator.MSBuildLocator.RegisterDefaults();
GenerateCommand generateCommand = new GenerateCommand();
RootCommand app = new RootCommand {
generateCommand
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.OData.Cli/ProjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ internal static Project CreateProjectInstance(string projectPath)
if (path.Length > 0)
{
string pathProject = path[0];
ProjectCollection buildEngine = new ProjectCollection();
project = new Project(pathProject);
}

Expand Down
Binary file added src/Microsoft.OData.Cli/tools/OcsKey.snk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
Expand Down Expand Up @@ -91,18 +92,14 @@
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.4.33103.184" ExcludeAssets="runtime">
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.4.2120">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.ConnectedServices">
<Version>16.2.45</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.SDK">
<Version>17.3.32804.24</Version>
</PackageReference>
<PackageReference Include="Microsoft.VSSDK.BuildTools">
<Version>17.3.2094</Version>
<Version>17.4.2124</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down