TALXIS / tools-devkit-build

Customize the build process of Power Platform projects with MSBuild tasks
https://www.talxis.com
MIT License
2 stars 1 forks source link

Support for versioning referenced projects #1

Open hajekj opened 7 months ago

hajekj commented 7 months ago

Tasks

TomProkop commented 6 months ago

I don't understand how changing value of SolutionPackagerMetadataWorkingDirectory breaks the PCF build. I intentionally wanted to use the existing variables to prevent creating multiple copies of the source file. Since I expect multiple types of sources/intermediate files to be present in the obj folder I wanted to change the default value and move the metadata into a specific subfolder. SolutionPackagerMetadataWorkingDirectory should only contain files which will be picked up by the SolutionPackager later in the process. In this folder we can generate files which are necessary during build.

We need to perform some operations (e.g. building the Relationships.xml file, packing Canvas app source into .msapp or replacing version numbers in plugin assembly references) on the source files before we run the SolutionPackager step. This should not be done over source files directly because we don't want to change the source during build and commit those changes. The best place for doing this manipulation is in the obj folder (IntermediateOutputPath) which is how the most MSBuild tasks work.

hajekj commented 6 months ago

There are quite few different things to how versions are applied by Microsoft and us:

I believe we should hook on the AfterTarget of ProcessCdsProjectReferencesOutputs and perform versioning there. That would also remove the requirement of modifying the .cdsproj to add BeforeBuild - this is also problematic for PCFs since they weren't copied via ProcessCdsProjectReferencesOutputs yet.

As for versioning plugins, I would suggest that we build the plugin version based on plugin's folder + references commits and then build a separate version of the solution - this could easily however create a lot of confusion. I can also think of the following:

Additionally, we should lock into specific Microsoft's build target version, so in case they rename something (Cds for example), it will not break us and we will have control over the versions.

TomProkop commented 6 months ago

I believe we should hook on the AfterTarget of ProcessCdsProjectReferencesOutputs and perform versioning there. That would also remove the requirement of modifying the .cdsproj to add BeforeBuild - this is also problematic for PCFs since they weren't copied via ProcessCdsProjectReferencesOutputs yet.

I wanted this package to contain tasks and target definitions only. If someone references it they it doesn't mess up with the build until you explicitly call targets you are interested in. I didn't want to impose all the steps and behavior on everyone since they might be interested in a subset of functionality only. People can create their own NuGet packages and reference this package if they don't want to copy paste the explicit calls in their .csproj files.