xamarin-macios/scripts
Peter Collins 4681428636
[vs-workload.props] Append xcode info to VSMAN (#21657)
Context:
06fea905cf

In order to add .NET 9 Xcode16.1 builds to VS we'll need to insert packs
from two different commits on the `release/9.0.1xx-preview` branch.

Xcode information will now be added to the VS manifest that we generate
to allow us to produce unique manifests across the same branch.
2024-11-19 19:14:01 -05:00
..
generate-defines [csharp] Port csharp scripts in src/ to .NET projects. (#21498) 2024-10-29 13:00:35 +01:00
generate-errors [csharp] Port csharp scripts in src/ to .NET projects. (#21498) 2024-10-29 13:00:35 +01:00
generate-frameworks [csharp] Port csharp scripts in src/ to .NET projects. (#21498) 2024-10-29 13:00:35 +01:00
generate-sourcelink-json [csharp] Port csharp scripts in src/ to .NET projects. (#21498) 2024-10-29 13:00:35 +01:00
generate-target-platforms [csharp] Port csharp scripts in dotnet/ to .NET projects. (#21554) 2024-10-31 18:37:18 +01:00
generate-vs-workload [vs-workload.props] Append xcode info to VSMAN (#21657) 2024-11-19 19:14:01 -05:00
generate-workloadmanifest-json [csharp] Port csharp scripts in dotnet/ to .NET projects. (#21554) 2024-10-31 18:37:18 +01:00
generate-workloadmanifest-targets [csharp] Port csharp scripts in dotnet/ to .NET projects. (#21554) 2024-10-31 18:37:18 +01:00
run-with-timeout [csharp] Port the run-with-timeout script in tests/ to a .NET project. (#21563) 2024-11-01 08:56:38 +01:00
versions-check Remove a lot of legacy logic. (#21576) 2024-11-06 11:34:39 +01:00
Directory.Build.props
README.md [csharp] Port csharp scripts in src/ to .NET projects. (#21498) 2024-10-29 13:00:35 +01:00
new-script.sh [csharp] Port csharp scripts in src/ to .NET projects. (#21498) 2024-10-29 13:00:35 +01:00
template.mk

README.md

Scripts

This directory contains numerous short C# scripts, each in their own directory with its own project file.

To create a new script, the easy way is to run the new-script.sh script.

The harder way is to copy an existing script directory, and:

  • Rename the csproj file to match the directory name.

  • Add your C# code, and document what it's supposed to do in a README.md file.

  • Edit the arguments to the TemplateScript template in the fragment.mk file according to how you named your script (directory). The first argument will be used in other makefiles that use the script, the second is the name of the script (directory). Say your script is my-script, then that would be:

    $(eval $(call TemplateScript,MY_SCRIPT,my-script))
    
    

To use the new script:

  1. In the consuming Makefile, import the fragment.mk file from the script directory:

    include $(TOP)/scripts/my-script/fragment.mk
    
  2. In the target where you want to execute the script, depend on the script executable, which is named MY_SCRIPT (from the call to the TemplateScript template):

    dostuff: $(MY_SCRIPT)
        echo "Doing stuff"
    

    This makes sure the script is actually built before you want to execute it.

  3. The actual invocation to call the script, is the same variable, but with _EXEC appended:

    dostuff: $(MY_SCRIPT)
        $(MY_SCRIPT_EXEC) --arguments to/my/script
    

Sidenote: if https://github.com/dotnet/designs/pull/296 were ever implemented, we could dispense with the project file, making these C# files actual scripts.