Skip to content

Conversation

@jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Aug 10, 2017

Context: #181 (in comments)

In several places throughout the build, we are running a command such
as the following, which will not work on Windows:

<Exec Command="touch -m -t `git log -1 --format=%25cd --date=format-local:%25Y%25m%25d%25H%25M.%25S` Makefile" />

The solution is to create an MSBuild task in xa-prep-tasks named
GitCommitTime that will work cross-platform. GitCommitTime returns
a string value that can be passed to the Touch MSBuild task.

@dnfclas
Copy link

dnfclas commented Aug 10, 2017

@jonathanpeppers,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

WorkingDirectory="..\..\external\mxe"
/>
<GitCommitTime
WorkingDirectory="..\..\external\mxe"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our indentation convention for XML is...different. :-)

Attributes should be one per line -- as you've done -- and attributes should be indented one "tab stop" (two spaces) further than nested elements. This is to make attributes and elements easier to distinguish visually:

<GitCommitTime
    WorkingDirector="..\..\external\mxe"
    ToolPath="$(GitToolPath)"
    ToolExe="$(GitToolExe)">
  <Output  TaskParameter="Time" PropertyName="_MxeCommitTime" />
</GitCommitTime>

Context: dotnet#181 (in comments)

In several places throughout the build, we are running a command such
as `<Exec Command="touch -m -t `git log -1 --format=%25cd
--date=format-local:%25Y%25m%25d%25H%25M.%25S` Makefile" />`, which
will not work on Windows.

The solution is to create an MSBuild task in xa-prep-tasks named
`GitCommitTime` that will work cross-platform. `GitCommitTime` returns
a string value that can be passed to the `Touch` MSBuild task.
@jonpryor jonpryor merged commit 1409f89 into dotnet:master Aug 10, 2017
@jonathanpeppers jonathanpeppers deleted the git-commit-time branch August 10, 2017 19:44
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants