<commit_before>parameters: 
  signSteps: []
  
steps:
- task: BatchScript@1
  inputs:
    filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
    arguments: -no_logo
    modifyEnvironment: true
  displayName: Setup Environment Variables

- task: NuGetToolInstaller@0
  displayName: Use NuGet 4.7.0
  inputs:
    versionSpec: 4.7.0

- task: DotNetCoreCLI@2  
  inputs:
    command: custom
    custom: tool
    arguments: install --tool-path . nbgv
  displayName: Install NBGV tool
  condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))

- script: nbgv cloud
  displayName: Set Version
  condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))


- powershell: |
    mkdir $(Build.ArtifactStagingDirectory)\Nightly
    mkdir $(Build.ArtifactStagingDirectory)\Store
    
    # Set versions
    $ver = .\nbgv get-version -f json | ConvertFrom-Json

    # Update appxmanifests. These must be done before build.
    $doc = Get-Content ".\PackageExplorer.Package\package.appxmanifest"    
    $doc | % { $_.Replace("3.25.0", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple)") } | Set-Content ".\PackageExplorer.Package\package.appxmanifest"
    
    $doc = Get-Content ".\PackageExplorer.Package.Nightly\package.appxmanifest"    
    $doc | % { $_.Replace("3.25.0", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple)") } | Set-Content ".\PackageExplorer.Package.Nightly\package.appxmanifest"
    
    $doc = Get-Content ".\Build\PackageExplorer.Package.Nightly.appinstaller"    
    $doc | % { $_.Replace("3.25.0", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple)") } | Set-Content "$(Build.ArtifactStagingDirectory)\Nightly\PackageExplorer.Package.Nightly.appinstaller"

    # Update badges
    $doc = Get-Content ".\Build\ci_badge.svg"    
    $doc | % { $_.Replace("ver_number", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple).0") } | Set-Content "$(Build.ArtifactStagingDirectory)\Nightly\version_badge.svg"
    
    $doc = Get-Content ".\Build\store_badge.svg"    
    $doc | % { $_.Replace("ver_number", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple).0") } | Set-Content "$(Build.ArtifactStagingDirectory)\Store\version_badge.svg"

  displayName: Update manifest and badge versions

- task: MSBuild@1
  displayName: Build NuGet Package Explorer 
  inputs:
    solution: PackageExplorer/NuGetPackageExplorer.csproj
    msbuildArguments: /restore    
    configuration: $(BuildConfiguration)
    maximumCpuCount: true

- task: MSBuild@1
  displayName: Build Nightly Package
  inputs:
    solution: PackageExplorer.Package.Nightly/PackageExplorer.Package.Nightly.wapproj
    msbuildArguments: /p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\Nightly\" /v:diag
    configuration: $(BuildConfiguration)
    maximumCpuCount: true

- task: MSBuild@1
  displayName: Build Store Package
  inputs:
    solution: PackageExplorer.Package/PackageExplorer.Package.wapproj
    msbuildArguments: /p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\Store\" /p:UapAppxPackageBuildMode=StoreUpload
    configuration: $(BuildConfiguration)
    maximumCpuCount: true

- task: MSBuild@1
  displayName: Pack Types Package
  inputs:
    solution: Types/Types.csproj
    msbuildArguments: /t:pack /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\Nightly\NuGet
    configuration: $(BuildConfiguration)
    maximumCpuCount: true
<commit_msg>build via script<commit_after>parameters: 
  signSteps: []
  
steps:
- task: BatchScript@1
  inputs:
    filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
    arguments: -no_logo
    modifyEnvironment: true
  displayName: Setup Environment Variables

- task: NuGetToolInstaller@0
  displayName: Use NuGet 4.7.0
  inputs:
    versionSpec: 4.7.0

- task: DotNetCoreCLI@2  
  inputs:
    command: custom
    custom: tool
    arguments: install --tool-path . nbgv
  displayName: Install NBGV tool
  condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))

- script: nbgv cloud
  displayName: Set Version
  condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))


- powershell: |
    mkdir $(Build.ArtifactStagingDirectory)\Nightly
    mkdir $(Build.ArtifactStagingDirectory)\Store
    
    # Set versions
    $ver = .\nbgv get-version -f json | ConvertFrom-Json

    # Update appxmanifests. These must be done before build.
    $doc = Get-Content ".\PackageExplorer.Package\package.appxmanifest"    
    $doc | % { $_.Replace("3.25.0", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple)") } | Set-Content ".\PackageExplorer.Package\package.appxmanifest"
    
    $doc = Get-Content ".\PackageExplorer.Package.Nightly\package.appxmanifest"    
    $doc | % { $_.Replace("3.25.0", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple)") } | Set-Content ".\PackageExplorer.Package.Nightly\package.appxmanifest"
    
    $doc = Get-Content ".\Build\PackageExplorer.Package.Nightly.appinstaller"    
    $doc | % { $_.Replace("3.25.0", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple)") } | Set-Content "$(Build.ArtifactStagingDirectory)\Nightly\PackageExplorer.Package.Nightly.appinstaller"

    # Update badges
    $doc = Get-Content ".\Build\ci_badge.svg"    
    $doc | % { $_.Replace("ver_number", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple).0") } | Set-Content "$(Build.ArtifactStagingDirectory)\Nightly\version_badge.svg"
    
    $doc = Get-Content ".\Build\store_badge.svg"    
    $doc | % { $_.Replace("ver_number", "$($ver.CloudBuildVersionVars.GitBuildVersionSimple).0") } | Set-Content "$(Build.ArtifactStagingDirectory)\Store\version_badge.svg"

  displayName: Update manifest and badge versions

- task: MSBuild@1
  displayName: Build NuGet Package Explorer 
  inputs:
    solution: PackageExplorer/NuGetPackageExplorer.csproj
    msbuildArguments: /restore    
    configuration: $(BuildConfiguration)
    maximumCpuCount: true

- powershell: |
    msbuild PackageExplorer.Package.Nightly/PackageExplorer.Package.Nightly.wapproj /p:Configuration=$(BuildConfiguration) /m /p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\Nightly\" /v:diag
  displayName: Build Nightly Package (script)

- task: MSBuild@1
  displayName: Build Nightly Package
  inputs:
    solution: PackageExplorer.Package.Nightly/PackageExplorer.Package.Nightly.wapproj
    msbuildArguments: /p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\Nightly\" /v:diag
    configuration: $(BuildConfiguration)
    maximumCpuCount: true

- task: MSBuild@1
  displayName: Build Store Package
  inputs:
    solution: PackageExplorer.Package/PackageExplorer.Package.wapproj
    msbuildArguments: /p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\Store\" /p:UapAppxPackageBuildMode=StoreUpload
    configuration: $(BuildConfiguration)
    maximumCpuCount: true

- task: MSBuild@1
  displayName: Pack Types Package
  inputs:
    solution: Types/Types.csproj
    msbuildArguments: /t:pack /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\Nightly\NuGet
    configuration: $(BuildConfiguration)
    maximumCpuCount: true

{'fraction_non_alphanumeric': 0.12508725394387826, 'fraction_numerical': 0.009493229093955047, 'mean_word_length': 4.306666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '712780', 'n_tokens_mistral': 2351, 'n_tokens_neox': 2209, 'n_words': 396}