diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..02eac6989ad --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +### AL ### +#Template for AL projects for Dynamics 365 Business Central +#launch.json folder +.vscode/ +#Cache folder +.alcache/ +#Symbols folder +.alpackages/ +#Snapshots folder +.snapshots/ +#Testing Output folder +.output/ +#Extension App-file +*.app +#Rapid Application Development File +rad.json +#Translation Base-file +*.g.xlf +#License-file +*.flf +#Test results file +TestResults.xml \ No newline at end of file diff --git a/Misc-apps.code-workspace b/Misc-apps.code-workspace new file mode 100644 index 00000000000..414de46067b --- /dev/null +++ b/Misc-apps.code-workspace @@ -0,0 +1,80 @@ +{ + "folders": [ + { + "name": "API V1 App", + "path": "APIV1/source" + }, + { + "name": "API V1 Tests", + "path": "APIV1/test" + }, + { + "name": "API V2 App", + "path": "APIV2/source" + }, + { + "name": "API V2 Tests", + "path": "APIV2/test" + }, + { + "name": "Client AddIns", + "path": "ClientAddIns/source" + }, + { + "name": "Company Hub", + "path": "CompanyHub/source" + }, + { + "name": "Headlines App", + "path": "EssentialBusinessHeadlines/source" + }, + { + "name": "Headlines Tests", + "path": "EssentialBusinessHeadlines/test" + }, + { + "name": "Late Payment Predictor App", + "path": "LatePaymentPredictor/source" + }, + { + "name": "Late Payment Predictor Tests", + "path": "LatePaymentPredictor/test" + }, + { + "name": "PayPal App", + "path": "paypalpaymentsstandard/source" + }, + { + "name": "PayPal Tests", + "path": "paypalpaymentsstandard/test" + }, + { + "name": "Sales/Inventory Forecast App", + "path": "salesandinventoryforecast/source" + }, + { + "name": "Sales/Inventory Forecast Tests", + "path": "salesandinventoryforecast/test" + }, + { + "name": "Send to Email Printer", + "path": "sendtoemailprinter/source" + }, + { + "name": "UK send remittance advice", + "path": "uksendremittanceadvice/source" + }, + { + "name": "Test Framework", + "path": "TestFramework" + }, + ], + "settings": { + "allint.enabled": false, + "al.enableCodeActions": false, + "al.enableCodeAnalysis": false, + "search.exclude": { + "**.xlf": true + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000000..daaa6a787e8 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Business Central Code History Repository + +This repository holds all versions of the Buisness Central Apps. The purpose is to quickly be able to compare every version to find changes. + +There is one separate branch per country-major version. + + +## Disclaimer + +All code is owned by Microsoft. You can not do any pull request on this repository. \ No newline at end of file diff --git a/base-app.code-workspace b/base-app.code-workspace new file mode 100644 index 00000000000..d178f6414e9 --- /dev/null +++ b/base-app.code-workspace @@ -0,0 +1,21 @@ +{ + "folders": [ + { + "name": "Base App", + "path": "BaseApp/Source/Base Application" + }, + { + "name": "Base App Tests", + "path": "BaseApp/Test" + } + ], + "settings": { + "allint.enabled": false, + "al.enableCodeActions": false, + "al.enableCodeAnalysis": false, + "al.backgroundCodeAnalysis": false, + "search.exclude": { + "**.xlf": true + } + } +} \ No newline at end of file diff --git a/scripts/Auto_load_versions.ps1 b/scripts/Auto_load_versions.ps1 new file mode 100644 index 00000000000..1208ad0644f --- /dev/null +++ b/scripts/Auto_load_versions.ps1 @@ -0,0 +1,86 @@ +$ErrorActionPreference = "SilentlyContinue" + +Set-Alias sz "C:\Program Files\7-Zip\7z.exe" + +[System.Collections.ArrayList]$Versions = @() +Get-BCArtifactUrl -select All -Type OnPrem | % { + $Url = $_ + $TempString = $Url.Substring(41) + [version]$Version = $TempString.Substring(0, $TempString.IndexOf('/')) + $country = $TempString.Substring($TempString.IndexOf('/') + 1) + + [hashtable]$objectProperty = @{} + $objectProperty.Add('Version', $Version) + $objectProperty.Add('Country', $country) + $objectProperty.Add('URL', $Url) + $ourObject = New-Object -TypeName psobject -Property $objectProperty + + if ($Version -ge [version]::Parse('15.0.0.0')) { + $Versions.Add($ourObject) + } +} + +$Versions | Sort-Object -Property Country, Version | % { + [version]$Version = $_.Version + $country = $_.Country + + $CommitDoesNotExist = (git log --all --grep="$($country)-$($version.ToString())") -eq $null + + if ($CommitDoesNotExist) { + Write-Host "###############################################" + Write-Host "Processing $($country) - $($Version.ToString())" + Write-Host "###############################################" + + + $LatestCommitIDOfBranchEmpty = git log -n 1 --pretty=format:"%h" "empty" + if ($LatestCommitIDOfBranchEmpty -eq $null) { + $LatestCommitIDOfBranchEmpty = git log -n 1 --pretty=format:"%h" "origin/empty" + } + + if ($Version.Major -gt 15 -and $Version.Build -gt 5) { + $CommitIDLastCUFromPreviousMajor = git log --all --grep="$($country)-$($version.Major - 1).5" --pretty=format:"%h" + } + else { + $CommitIDLastCUFromPreviousMajor = $null + } + + $BranchAlreadyExists = ((git branch --list -r "*$($country)-$($Version.Major)*") -ne $null) -or ((git branch --list "*$($country)-$($Version.Major)*") -ne $null) + + if ($BranchAlreadyExists) { + git checkout "$($country)-$($Version.Major)" + } + else { + if ($CommitIDLastCUFromPreviousMajor -ne $null) { + git checkout -b "$($country)-$($Version.Major)" $CommitIDLastCUFromPreviousMajor + } + else { + git checkout -b "$($country)-$($Version.Major)" $LatestCommitIDOfBranchEmpty + } + } + + $Paths = Download-Artifacts -artifactUrl $_.URL -includePlatform + $TargetPathOfVersion = $Paths[0] + + if (-not (Test-Path (Join-Path $TargetPathOfVersion 'Applications'))) { + $TargetPathOfVersion = $Paths[1] + } + + & "$PSScriptRoot\UpdateALRepo.ps1" -SourcePath (Join-Path $TargetPathOfVersion Applications) -RepoPath (Split-Path $PSScriptRoot -Parent) + & "$PSScriptRoot\BuildTestsWorkSpace.ps1" + + git add -A | out-null + git commit -a -m "$($country)-$($version.ToString())" | out-null + git gc | out-null + + Remove-Item $Paths[0] -Recurse + + Write-Host "$($country)-$($version.ToString())" + } + else { + Write-Host "###############################################" + Write-Host "Skipped version $($country) - $($version.ToString())" + Write-Host "###############################################" + } +} + + \ No newline at end of file diff --git a/scripts/BuildTestsWorkSpace.ps1 b/scripts/BuildTestsWorkSpace.ps1 new file mode 100644 index 00000000000..8353d70ffcf --- /dev/null +++ b/scripts/BuildTestsWorkSpace.ps1 @@ -0,0 +1,24 @@ +$Directories = Get-ChildItem -Directory -Filter "*test*" -Recurse + +$workspace = @{} +$workspace["folders"] = @() + +$Directories | % { + $Childs = Get-ChildItem -Path $_.FullName -Directory -Filter "*test*" + if ($Childs.Count -eq 0 ) { + $path = @{} + $path["path"] = (Get-Item $_.FullName | Resolve-Path -Relative) + + $workspace["folders"] += $path + } +} + +$workspace["settings"] = @{} + +$workspace["settings"]["allint.enabled"] = $false +$workspace["settings"]["al.enableCodeActions"] = $false +$workspace["settings"]["al.enableCodeAnalysis"] = $false +$workspace["settings"]["search.exclude"] = @{"**.xlf" = $true } + +$workspace | ConvertTo-Json | Out-File "test-apps.code-workspace" -Encoding utf8 + diff --git a/scripts/UpdateALRepo.ps1 b/scripts/UpdateALRepo.ps1 new file mode 100644 index 00000000000..4b4b39d9ca8 --- /dev/null +++ b/scripts/UpdateALRepo.ps1 @@ -0,0 +1,26 @@ +param( + $Localization = '', + $Version = '', + $BuildFolder = '', + $SourcePath, + $RepoPath = '', + $7zipExe = 'C:\Program Files\7-Zip\7z.exe' +) + +if (-not $SourcePath) { + $SourcePath = "C:\bcartifacts.cache\onprem\$Version\$Localization\Applications" +} + +Set-Alias sz $7zipExe +$zips = Get-ChildItem -Path $SourcePath -Filter *.zip -Recurse +Get-ChildItem -Path $RepoPath -Directory -Exclude scripts, .git | Remove-Item -Recurse -Force + +foreach ($zip in $zips) { + $RelativePath = $zip.FullName -ireplace [regex]::Escape($SourcePath + '\'), '' + $ZipTargetPath = Join-Path $RepoPath (Split-Path -Path $RelativePath) + $ZipNameForTarget = (Split-Path -Path $RelativePath -Leaf).Replace('.zip', '').Replace('..Source', '').Replace('.Source', '') + $ZipTargetPath = (Join-Path $ZipTargetPath $ZipNameForTarget) + sz x $zip.FullName -o"$ZipTargetPath" -r -y | out-null +} + + diff --git a/system-app.code-workspace b/system-app.code-workspace new file mode 100644 index 00000000000..0c61423c3b1 --- /dev/null +++ b/system-app.code-workspace @@ -0,0 +1,21 @@ +{ + "folders": [ + { + "name": "System App", + "path": "system application/source" + }, + { + "name": "System App Tests", + "path": "system application/test" + } + ], + "settings": { + "allint.enabled": false, + "al.enableCodeActions": false, + "al.enableCodeAnalysis": false, + "al.backgroundCodeAnalysis": false, + "search.exclude": { + "**.xlf": true + } + } +} \ No newline at end of file diff --git a/test-apps.code-workspace b/test-apps.code-workspace new file mode 100644 index 00000000000..66439ebd22e --- /dev/null +++ b/test-apps.code-workspace @@ -0,0 +1,184 @@ +{ + "settings": { + "allint.enabled": false, + "al.enableCodeAnalysis": false, + "al.enableCodeActions": false, + "al.backgroundCodeAnalysis": false, + "search.exclude": { + "**.xlf": true + } + }, + "folders": [ + { + "path": ".\\APIV1\\Test\\_Exclude_APIV1_ Tests" + }, + { + "path": ".\\APIV2\\Test\\_Exclude_APIV2_ Tests" + }, + { + "path": ".\\BaseApp\\Source\\Base Application\\Test Framework" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Bank" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Cash Flow" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Cost Accounting" + }, + { + "path": ".\\BaseApp\\Test\\Tests-CRM integration" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Data Exchange" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Dimension" + }, + { + "path": ".\\BaseApp\\Test\\Tests-ERM" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Fixed Asset" + }, + { + "path": ".\\BaseApp\\Test\\Tests-General Journal" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Graph" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Integration" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Invoicing" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Job" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Local" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Marketing" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Misc" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Monitor Sensitive Fields" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Permissions" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Physical Inventory" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Prepayment" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Rapid Start" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Report" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Resource" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Reverse" + }, + { + "path": ".\\BaseApp\\Test\\Tests-SCM" + }, + { + "path": ".\\BaseApp\\Test\\Tests-SINGLESERVER" + }, + { + "path": ".\\BaseApp\\Test\\Tests-SMB" + }, + { + "path": ".\\BaseApp\\Test\\Tests-SMTP" + }, + { + "path": ".\\BaseApp\\Test\\Tests-TestLibraries" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Upgrade" + }, + { + "path": ".\\BaseApp\\Test\\Tests-User" + }, + { + "path": ".\\BaseApp\\Test\\Tests-VAT" + }, + { + "path": ".\\BaseApp\\Test\\Tests-Workflow" + }, + { + "path": ".\\CompanyHub\\Test\\Company Hub Tests" + }, + { + "path": ".\\DataArchive\\test\\Data Archive Tests" + }, + { + "path": ".\\Email - Current User Connector\\Test\\Email - Current User Connector Tests" + }, + { + "path": ".\\Email - Microsoft 365 Connector\\Test\\Email - Microsoft 365 Connector Tests" + }, + { + "path": ".\\Email - Outlook REST API\\Test" + }, + { + "path": ".\\Email - SMTP Connector\\Test\\Email - SMTP Connector Tests" + }, + { + "path": ".\\EssentialBusinessHeadlines\\Test\\Essential Business Headlines Test" + }, + { + "path": ".\\LatePaymentPredictor\\Test\\Late Payment Prediction Tests" + }, + { + "path": ".\\onprem permissions\\test\\OnPrem Permissions Tests" + }, + { + "path": ".\\paypalpaymentsstandard\\test\\PayPal Payments Standard Tests" + }, + { + "path": ".\\recommendedapps\\test\\Recommended Apps Tests" + }, + { + "path": ".\\salesandinventoryforecast\\test\\Sales and Inventory Forecast Tests" + }, + { + "path": ".\\system application\\source\\System Application\\Email\\src\\Test Email" + }, + { + "path": ".\\system application\\test\\System Application Test" + }, + { + "path": ".\\system application\\test\\System Application Test Library" + }, + { + "path": ".\\system application\\test\\System Application Test\\Extension Management\\testArtifacts" + }, + { + "path": ".\\testframework\\TestLibraries" + }, + { + "path": ".\\testframework\\performancetoolkit\\Performance Toolkit Tests" + }, + { + "path": ".\\testframework\\performancetoolkit\\Performance Toolkit Tests\\src\\Mock Tests" + }, + { + "path": ".\\testframework\\TestRunner\\Test Runner" + }, + { + "path": ".\\vatgroupmanagement\\test\\VAT Group Management Tests" + } + ] +} \ No newline at end of file