Skip to content

Apply the Protobuf targets cleanups from #4923 to IceRpc.Slice.Tools.targets #4948

Description

@pepone

Follow-up suggested in the review of #4930: IceRpc.Slice.Tools.targets should take the cleanups made to the Protobuf targets in #4923. The two files mirror each other, and the Protobuf side now has:

  • _SlicecPruneStaleOutputs with BeforeTargets="Slicec;SlicecClean" only. A BeforeTargets target runs even when its target's Condition is false, and SlicecClean has no condition, so CoreCompile and Clean in the list are redundant.
  • <Compile Remove="@(_StaleSlicecOutput)" MatchOnMetadata="FullPath" MatchOnMetadataOptions="PathLike" /> instead of the _StaleSlicecOutputRelative item, its comment and the MakeRelative call. MatchOnMetadata matches the SDK glob's relative identities directly. The unquoted MakeRelative(..., %(Identity)) also splits on a comma in the path and fails with MSB4186.
  • No MakeDir in _SlicecWriteOutputManifest: WriteLinesToFile creates the directory, and PrepareForBuild already created it.
  • No Exists guard on the manifest Delete in SlicecClean: Delete skips missing files.
  • WriteOnlyWhenDifferent="true" on the manifest WriteLinesToFile.

Behavior to keep, verified on the Protobuf side: renaming a Slice file removes the glob's Compile entry and deletes the old outputs; removing the last Slice file still prunes and deletes the manifest; Rebuild and Clean unchanged.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions