Skip to content

Use MSBuild task for Errors2Enum and Po2Resx tools.#98

Draft
rinrab wants to merge 12 commits intoAmpScm:mainfrom
rinrab:fix-build-tools
Draft

Use MSBuild task for Errors2Enum and Po2Resx tools.#98
rinrab wants to merge 12 commits intoAmpScm:mainfrom
rinrab:fix-build-tools

Conversation

@rinrab
Copy link
Contributor

@rinrab rinrab commented Apr 23, 2024

  • Errors2Enum
  • Po2Resx
  • Copy-Dependencies
  • Check all tests and builds to pass
  • Check diff for unrelated changes
  • Add more tasks

rinrab added 12 commits April 21, 2024 20:31
…is needed for feature usage of it from MSBuild task.
MSBuild requires the class name to be the same as task name.
* src/SharpSvn.MSBuild/Errors2Enum.tasks:
  * Add declaration of task via UsingTask tag.
  * Use Microsoft.Build.Tasks.Core.dll as assembly.
* src/SharpSvn/Directory.Build.targets:
  * Add GenerateErrorEnums target and invoke Errors2Enum task from it.
  * Import Errors2Enum.tasks project.
* src/SharpSvn.MSBuild/Errors2Enum.cs
  * Convert Errors2Enum utility to MSBuild task.
  * Replace args with parameters.
* src/SharpSvn/SharpSvn.vcxproj
  * Remove execution of the Errors2Enum via command line.
  * Include Directory.Build.targets file.
* src/SharpSvn/SharpSvn.vcxproj.filters
  * Include Directory.Build.targets file.
* src/SharpSvn/Directory.Build.targets: fix indentation.
* src/SharpSvn.MSBuild/Errors2Enum.cs
  * Require WinErrorHeaderPath and ErrnoHeaderPath parameters
    instead of VCPath, SDKPath, and UniversalSDKDir.
  * Remove magic with finding headers paths.
  * Use local variable for path of libssh2 header instead of
    LibSsh2HeaderPath parameter.
* src/SharpSvn.MSBuild/Errors2Enum.tasks
  * Update parameter list up to changes of the
    src/SharpSvn.MSBuild/Errors2Enum.cs.
* src/SharpSvn/Directory.Build.targets
  * Find paths of winerror and errno headers.

Logic of finding headers for now is little bit simplified than
it was before.
* src/SharpSvn.MSBuild/Errors2Enum.cs: remove second `if`.
* src/SharpSvn/Directory.Build.targets:
  * Remove draft and commented code for Po2Resx MSBuild task.
* src/SharpSvn/Directory.Build.targets
  * Add property group with all header paths.
  * Pass those properties to the Errors2Enum task.
Prevent regeneration of the errors enum by simply specifying
Inputs and Outputs of the GenerateErrorEnums target.

* src/SharpSvn.MSBuild/Errors2Enum.cs:
  * Remove magic with code generation to temp file and latest
    coping it the destination if nothing has changed.
  * Remove magic with checking for the last changed date of all
    header (source) files and comparing them with the destination
    file. Now it is done by Inputs and Outputs of the GenerateErrorEnums
    target.
* src/SharpSvn/Directory.Build.targets
  * Add the GenerateErrorEnumsInputs ItemGroup.
  * Specify Inputs and Outputs of the GenerateErrorEnums target.
* src/SharpSvn.MSBuild/Errors2Enum.cs
  * Replace all logging to Console with logging to MSBuild logger
    (for example, `Log.LogError("Message")`)
* src/SharpSvn/Directory.Build.targets
  * Add CleanErrorEnums target which deletes the SvnWindowsError.h
    file on rebuild and clean.
@rinrab rinrab changed the title Replace command line utilities with MSBuild task. Use MSBuild task for Errors2Enum and Po2Resx tools. Apr 23, 2024
@rhuijben
Copy link
Member

Nice work. Please ping me if you ever complete this

@rhuijben
Copy link
Member

rhuijben commented Oct 6, 2025

I like the idea of this PR. We should do this from MSBuild.
But this does not belong in SharpSvn.MSBuild, as the output of that project is distributed as nuget package.

We shouldn't have our own in-build tooling in the deliverables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants