Open hajekj opened 7 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.
There are quite few different things to how versions are applied by Microsoft and us:
.csproj
is versioned the same as solution at build time in pipeline, resulting in same version applying everywhereversion
in the repo before build being run, the version is 0.0.<run-number>
and the solution is versioned in a standard way we use nowbundle.js
or so, we can modify it when needed.PowerAppsPackage
triggered after AfterBuild
. They also run ProcessCdsProjectReferencesOutputs
which moves the PCF/Plugin artifacts from referenced projects into the IntermediateOutputPath
and then runs the rest of the stuff like versioning etc.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:
GenerateVersionNumber
before anything else is being built. Infer the version generated by this step by all the referenced projects.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.
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.
Tasks
0.0.<patch>
(reference)0.0.<branch>YYMMDDXXX
- example would be0.0.1240402001
meaning built in 2nd April 2024 fromdevelop
develop
master
.
) and use it as patch numberTalxis*
ApplyVersionNumber
should runAfterTargets="ProcessCdsProjectReferencesOutputs"
- update docsMicrosoft.PowerApps.MSBuild.Solution
and lock it to the current version eg.1.31.2
1.31.6