Skip to content

Commit

Permalink
Adding changes for DynamicsValue/fake-xrm-easy#160
Browse files Browse the repository at this point in the history
  • Loading branch information
jordimontana82 committed Sep 11, 2024
1 parent 45f9ae9 commit d8be9b6
Show file tree
Hide file tree
Showing 12 changed files with 400 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### Changed

- Moved XrmRealContext to a separate FakeXrmEasy.Integration package to remove dependency on XrmTooling - https://github.com/DynamicsValue/fake-xrm-easy/issues/160
- Resolves an issue in FetchXml queries when using arithmetic values and no early bound assemblies are used. It will now read from injected metadata in absence of proxy type assemblies - https://github.com/DynamicsValue/fake-xrm-easy/issues/158
- Resolves issue in MetadataGenerator where relationship properties were generated in the wrong order, also generates ManyToMany relationship properties - https://github.com/DynamicsValue/fake-xrm-easy/issues/135
- Adds implementation of RelatedEntities in Update message , before it was implemented only for Create - https://github.com/DynamicsValue/fake-xrm-easy/issues/154
Expand Down
14 changes: 10 additions & 4 deletions FakeXrmEasy.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataverseEntities", "tests\DataverseEntities\DataverseEntities.csproj", "{7638E014-9149-4125-860F-D478CFD36C06}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FakeXrmEasy.Integration", "src\FakeXrmEasy.Integration\FakeXrmEasy.Integration.csproj", "{0924D408-0AC0-4184-BF73-8DCBE14A7D69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FakeXrmEasy.Integration.Tests", "tests\FakeXrmEasy.Integration.Tests\FakeXrmEasy.Integration.Tests.csproj", "{73CC2217-C43C-459B-8625-C130F141A645}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
FAKE_XRM_EASY_9|Any CPU = FAKE_XRM_EASY_9|Any CPU
FAKE_XRM_EASY_9|x64 = FAKE_XRM_EASY_9|x64
FAKE_XRM_EASY_9|x86 = FAKE_XRM_EASY_9|x86
FAKE_XRM_EASY_9|Any CPU = FAKE_XRM_EASY_9|Any CPU
FAKE_XRM_EASY_9|x64 = FAKE_XRM_EASY_9|x64
FAKE_XRM_EASY_9|x86 = FAKE_XRM_EASY_9|x86
FAKE_XRM_EASY_2013|Any CPU = FAKE_XRM_EASY_2013|Any CPU
FAKE_XRM_EASY_2013|x64 = FAKE_XRM_EASY_2013|x64
FAKE_XRM_EASY_2013|x86 = FAKE_XRM_EASY_2013|x86
Expand All @@ -46,7 +50,7 @@ Global
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x64.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x64.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x86.ActiveCfg = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x86.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_9|x86.Build.0 = FAKE_XRM_EASY_9|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_2013|Any CPU.ActiveCfg = FAKE_XRM_EASY_2013|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_2013|Any CPU.Build.0 = FAKE_XRM_EASY_2013|Any CPU
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE}.FAKE_XRM_EASY_2013|x64.ActiveCfg = FAKE_XRM_EASY_2013|Any CPU
Expand Down Expand Up @@ -157,6 +161,8 @@ Global
{CE7EE93C-E98A-4AE7-AE84-B4FA7CEB49FE} = {6D8BD300-7945-4BD8-AFA5-30EEF1466332}
{E7FD9BE3-5CD1-4B50-A23E-53EA1AE2EBB8} = {AB19E6BB-17E9-4489-B6C8-A14622C147D9}
{7638E014-9149-4125-860F-D478CFD36C06} = {AB19E6BB-17E9-4489-B6C8-A14622C147D9}
{0924D408-0AC0-4184-BF73-8DCBE14A7D69} = {6D8BD300-7945-4BD8-AFA5-30EEF1466332}
{73CC2217-C43C-459B-8625-C130F141A645} = {AB19E6BB-17E9-4489-B6C8-A14622C147D9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9E98B2F2-E752-4716-ABC6-BE9440866543}
Expand Down
4 changes: 4 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ else
Write-Host " -> Cleaning..." -ForegroundColor Yellow
./clean.ps1 -folderPath "./src/FakeXrmEasy.Core/bin"
./clean.ps1 -folderPath "./src/FakeXrmEasy.Core/obj"
./clean.ps1 -folderPath "./src/FakeXrmEasy.Integration/bin"
./clean.ps1 -folderPath "./src/FakeXrmEasy.Integration/obj"
./clean.ps1 -folderPath "./tests/FakeXrmEasy.Core.Tests/bin"
./clean.ps1 -folderPath "./tests/FakeXrmEasy.Core.Tests/obj"
./clean.ps1 -folderPath "./tests/FakeXrmEasy.Integration.Tests/bin"
./clean.ps1 -folderPath "./tests/FakeXrmEasy.Integration.Tests/obj"

Write-Host " -> Restoring dependencies: configuration='$($configuration)', targetFramework='$($targetFrameworks)' PackTests=$($packTests)" -ForegroundColor Yellow
if($targetFrameworks -eq "all")
Expand Down
29 changes: 29 additions & 0 deletions pack-src-project.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
param (
[string]$versionSuffix = "",
[string]$targetFrameworks = "netcoreapp3.1",
[string]$packageIdPrefix = "",
[string]$projectName = "",
[string]$projectPath = "",
)

Write-Host "Running with versionSuffix '$($versionSuffix)'..."

$tempNupkgFolder = './nupkgs'

Write-Host "Packing All Configurations for project $($projectName)" -ForegroundColor Green

if($targetFrameworks -eq "netcoreapp3.1")
{
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_9"
}
else {
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_2013"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_2015"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_2016"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_9"
}

Write-Host "Pack Succeeded :)" -ForegroundColor Green
24 changes: 10 additions & 14 deletions pack-src.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
param (
[string]$versionSuffix = "",
[string]$targetFrameworks = "netcoreapp3.1"
[string]$targetFrameworks = "netcoreapp3.1",
)

Write-Host "Running with versionSuffix '$($versionSuffix)'..."
Expand All @@ -13,18 +13,14 @@ $projectPath = "src/FakeXrmEasy.Core"

Write-Host "Packing All Configurations for project $($projectName)" -ForegroundColor Green

if($targetFrameworks -eq "netcoreapp3.1")
{
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_9"
}
else {
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_2013"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_2015"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_2016"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -configuration "FAKE_XRM_EASY_9"
}
./pack-src-project.ps1 -targetFrameworks $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix

$packageIdPrefix = "FakeXrmEasy.Integration"
$projectName = "FakeXrmEasy.Integration"
$projectPath = "src/FakeXrmEasy.Integration"

Write-Host "Packing All Configurations for project $($projectName)" -ForegroundColor Green

./pack-src-project.ps1 -targetFrameworks $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix

Write-Host "Pack Succeeded :)" -ForegroundColor Green
29 changes: 29 additions & 0 deletions pack-tests-project.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
param (
[string]$versionSuffix = "",
[string]$targetFrameworks = "netcoreapp3.1",
[string]$packageIdPrefix = "",
[string]$projectName = "",
[string]$projectPath = "",
)

Write-Host "Running with versionSuffix '$($versionSuffix)'..."

$tempNupkgFolder = './nupkgs'

Write-Host "Packing All Configurations for project $($projectName)" -ForegroundColor Green

if($targetFrameworks -eq "netcoreapp3.1")
{
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_9"
}
else {
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_2013"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_2015"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_2016"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_9"
}

Write-Host "Pack Succeeded :)" -ForegroundColor Green
22 changes: 9 additions & 13 deletions pack-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ $projectPath = "tests/FakeXrmEasy.Core.Tests"

Write-Host "Packing All Configurations for project $($projectName)" -ForegroundColor Green

if($targetFrameworks -eq "netcoreapp3.1")
{
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_9"
}
else {
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_2013"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_2015"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_2016"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_365"
./pack-configuration.ps1 -targetFramework $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix -packTests "true" -configuration "FAKE_XRM_EASY_9"
}
./pack-tests-project.ps1 -targetFrameworks $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix

$packageIdPrefix = "FakeXrmEasy.IntegrationTests"
$projectName = "FakeXrmEasy.Integration.Tests"
$projectPath = "tests/FakeXrmEasy.Integration.Tests"

Write-Host "Packing All Configurations for project $($projectName)" -ForegroundColor Green

./pack-tests-project.ps1 -targetFrameworks $targetFrameworks -projectName $projectName -projectPath $projectPath -packageIdPrefix $packageIdPrefix -versionSuffix $versionSuffix

Write-Host "Pack Succeeded :)" -ForegroundColor Green
5 changes: 0 additions & 5 deletions src/FakeXrmEasy.Core/FakeXrmEasy.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,23 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net462' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="9.0.2.52" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="9.1.1.45" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' And '$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="[8.2.0.2,9.0)" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="[8.2.0.1,9.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452' And '$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="[8.2.0.1,9.0)" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="[8.2.0.1,9.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452' And '$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="[8.1.0.2,8.2)" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="[8.1.0.2,8.2)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452' And '$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="[7.1.1,8.0)" />
<PackageReference Include="Microsoft.CrmSdk.Extensions" Version="[7.1.0.1,8.0)" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="[7.0.0.1,8.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452' And '$(Configuration)'=='FAKE_XRM_EASY_2013'">
Expand Down
Loading

0 comments on commit d8be9b6

Please sign in to comment.