From f11253b5a2d1176a11ca794e490cdadce998cf8b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 29 Oct 2024 13:00:35 +0100 Subject: [PATCH] [csharp] Port csharp scripts in src/ to .NET projects. (#21498) --- scripts/README.md | 45 +++++++++++++++++++ scripts/generate-defines/README.md | 17 +++++++ scripts/generate-defines/fragment.mk | 2 + .../generate-defines/generate-defines.cs | 10 ++--- .../generate-defines/generate-defines.csproj | 5 +++ scripts/generate-errors/README.md | 29 ++++++++++++ scripts/generate-errors/fragment.mk | 2 + .../generate-errors/generate-errors.cs | 24 +++++----- .../generate-errors/generate-errors.csproj | 5 +++ scripts/generate-frameworks/README.md | 29 ++++++++++++ scripts/generate-frameworks/fragment.mk | 2 + .../generate-frameworks.cs | 10 ++--- .../generate-frameworks.csproj | 5 +++ scripts/generate-sourcelink-json/README.md | 18 ++++++++ scripts/generate-sourcelink-json/fragment.mk | 2 + .../generate-sourcelink-json.cs | 15 +++++++ .../generate-sourcelink-json.csproj | 5 +++ scripts/new-script.sh | 34 ++++++++++++++ scripts/versions-check/README.md | 9 ++++ src/Makefile | 11 +++-- src/Makefile.generator | 14 +++--- src/generate-sourcelink-json.csharp | 20 --------- 22 files changed, 256 insertions(+), 57 deletions(-) create mode 100644 scripts/README.md create mode 100644 scripts/generate-defines/README.md create mode 100644 scripts/generate-defines/fragment.mk rename src/generate-defines.csharp => scripts/generate-defines/generate-defines.cs (77%) create mode 100644 scripts/generate-defines/generate-defines.csproj create mode 100644 scripts/generate-errors/README.md create mode 100644 scripts/generate-errors/fragment.mk rename src/generate-errors.csharp => scripts/generate-errors/generate-errors.cs (50%) create mode 100644 scripts/generate-errors/generate-errors.csproj create mode 100644 scripts/generate-frameworks/README.md create mode 100644 scripts/generate-frameworks/fragment.mk rename src/generate-frameworks.csharp => scripts/generate-frameworks/generate-frameworks.cs (92%) create mode 100644 scripts/generate-frameworks/generate-frameworks.csproj create mode 100644 scripts/generate-sourcelink-json/README.md create mode 100644 scripts/generate-sourcelink-json/fragment.mk create mode 100755 scripts/generate-sourcelink-json/generate-sourcelink-json.cs create mode 100644 scripts/generate-sourcelink-json/generate-sourcelink-json.csproj create mode 100755 scripts/new-script.sh create mode 100644 scripts/versions-check/README.md delete mode 100755 src/generate-sourcelink-json.csharp diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 00000000000..7dd1ea2646e --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,45 @@ +# 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: + + ```make + $(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: + + ```make + 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): + + ```make + 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: + + ```make + 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. \ No newline at end of file diff --git a/scripts/generate-defines/README.md b/scripts/generate-defines/README.md new file mode 100644 index 00000000000..e1844fe637b --- /dev/null +++ b/scripts/generate-defines/README.md @@ -0,0 +1,17 @@ +# generate-defines + +This script takes the list of frameworks that are supported for a given +platform, and generates a response file for the C# compiler with a +`HAS_` define for each framework. + +Example output file for iOS: + +``` +-d:HAS_ACCELERATE +-d:HAS_ACCESSIBILITY +-d:HAS_ACCESSORYSETUPKIT +-d:HAS_ACCOUNTS +[...] +-d:HAS_WEBKIT +-d:HAS_XKIT +``` diff --git a/scripts/generate-defines/fragment.mk b/scripts/generate-defines/fragment.mk new file mode 100644 index 00000000000..9e4f50881f5 --- /dev/null +++ b/scripts/generate-defines/fragment.mk @@ -0,0 +1,2 @@ +include $(TOP)/scripts/template.mk +$(eval $(call TemplateScript,GENERATE_DEFINES,generate-defines)) diff --git a/src/generate-defines.csharp b/scripts/generate-defines/generate-defines.cs similarity index 77% rename from src/generate-defines.csharp rename to scripts/generate-defines/generate-defines.cs index b5431f765ac..3397290cfd2 100755 --- a/src/generate-defines.csharp +++ b/scripts/generate-defines/generate-defines.cs @@ -1,15 +1,11 @@ -#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp -s - using System.IO; using System.Text; try { - var args = Args; var expectedArgumentCount = 2; if (args.Length != expectedArgumentCount) { Console.WriteLine ($"Need {expectedArgumentCount} arguments, got {args.Length} arguments"); - Environment.Exit (1); - return; + return 1; } var output = args [0]; @@ -20,8 +16,8 @@ sb.AppendLine ($"-d:HAS_{fw.ToUpperInvariant ()}"); File.WriteAllText (output, sb.ToString ()); - Environment.Exit (0); + return 0; } catch (Exception e) { Console.WriteLine ("Failed: {0}", e); - Environment.Exit (1); + return 1; } diff --git a/scripts/generate-defines/generate-defines.csproj b/scripts/generate-defines/generate-defines.csproj new file mode 100644 index 00000000000..3e1d041e4d5 --- /dev/null +++ b/scripts/generate-defines/generate-defines.csproj @@ -0,0 +1,5 @@ + + + net$(BundledNETCoreAppTargetFrameworkVersion) + + diff --git a/scripts/generate-errors/README.md b/scripts/generate-errors/README.md new file mode 100644 index 00000000000..357d99fbbdd --- /dev/null +++ b/scripts/generate-errors/README.md @@ -0,0 +1,29 @@ +# generate-errors + +This script takes a resource resx as input, and generates a C# file with constants for each resource string (which won't be localizable, because they're constant strings). + +Example input: + +```xml + + + + Unexpected error - Please fill a bug report at https://github.com/xamarin/xamarin-macios/issues/new + + +``` + +Example output: + +```cs +//------------------------------------------------------------------------------ +// +// This code was generated by a tool: generate-errors.csharp +// +//------------------------------------------------------------------------------ +namespace Xamarin.Bundler { + internal class Errors { + internal const string MT0000 = "Unexpected error - Please fill a bug report at https://github.com/xamarin/xamarin-macios/issues/new"; + } +} +``` diff --git a/scripts/generate-errors/fragment.mk b/scripts/generate-errors/fragment.mk new file mode 100644 index 00000000000..9f5adaa9c89 --- /dev/null +++ b/scripts/generate-errors/fragment.mk @@ -0,0 +1,2 @@ +include $(TOP)/scripts/template.mk +$(eval $(call TemplateScript,GENERATE_ERRORS,generate-errors)) diff --git a/src/generate-errors.csharp b/scripts/generate-errors/generate-errors.cs similarity index 50% rename from src/generate-errors.csharp rename to scripts/generate-errors/generate-errors.cs index 6a27fab4801..744ed712026 100755 --- a/src/generate-errors.csharp +++ b/scripts/generate-errors/generate-errors.cs @@ -1,15 +1,14 @@ -#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp -s - using System.IO; +using System.Text; using System.Xml; -var args = Environment.GetCommandLineArgs (); -var dir = Path.GetDirectoryName (args [1]); -var file = Path.Combine (dir, "..", "tools", "mtouch", "Errors.resx"); +var file = args [0]; +var output = args [1]; var doc = new XmlDocument (); doc.Load (file); -Console.Write ( +var sb = new StringBuilder (); +sb.Append ( @"//------------------------------------------------------------------------------ // // This code was generated by a tool: generate-errors.csharp @@ -20,18 +19,17 @@ namespace Xamarin.Bundler { internal class Errors { "); -foreach (XmlNode node in doc.SelectNodes ("/root/data")) { - var name = node.Attributes ["name"].InnerText; +foreach (XmlNode node in doc.SelectNodes ("/root/data")!) { + var name = node.Attributes! ["name"]!.InnerText; if (name == "default") { name = "@" + name; } - var value = node.ChildNodes [1].InnerText + var value = node.ChildNodes [1]!.InnerText .Trim () .Replace ("\\", "\\\\") .Replace ("\"", "\\\""); - Console.WriteLine ($"\t\tinternal const string {name} = \"{value}\";"); + sb.AppendLine ($"\t\tinternal const string {name} = \"{value}\";"); } -Console.WriteLine ("\t}\n}"); - -Environment.Exit (0); +sb.AppendLine ("\t}\n}"); +File.WriteAllText (output, sb.ToString ()); diff --git a/scripts/generate-errors/generate-errors.csproj b/scripts/generate-errors/generate-errors.csproj new file mode 100644 index 00000000000..3e1d041e4d5 --- /dev/null +++ b/scripts/generate-errors/generate-errors.csproj @@ -0,0 +1,5 @@ + + + net$(BundledNETCoreAppTargetFrameworkVersion) + + diff --git a/scripts/generate-frameworks/README.md b/scripts/generate-frameworks/README.md new file mode 100644 index 00000000000..b5ee55a9db4 --- /dev/null +++ b/scripts/generate-frameworks/README.md @@ -0,0 +1,29 @@ +# generate-frameworks + +This script takes the list of frameworks that are supported for all platforms, +and generates a C# file with a hashtable of all the frameworks for each +platform. + +Example output file for iOS: + +```cs +using System.Collections.Generic; + +partial class Frameworks { + internal readonly HashSet iosframeworks = new HashSet { + "Accelerate", + "Accessibility", + "AccessorySetupKit", + /// ... + "WebKit", + "XKit", + }; + internal readonly HashSet macosframeworks = new HashSet { + "Accelerate", + "Accessibility", + /// ... + "WebKit", + "XKit", + }; +} +``` diff --git a/scripts/generate-frameworks/fragment.mk b/scripts/generate-frameworks/fragment.mk new file mode 100644 index 00000000000..b83a7fc24a3 --- /dev/null +++ b/scripts/generate-frameworks/fragment.mk @@ -0,0 +1,2 @@ +include $(TOP)/scripts/template.mk +$(eval $(call TemplateScript,GENERATE_FRAMEWORKS,generate-frameworks)) diff --git a/src/generate-frameworks.csharp b/scripts/generate-frameworks/generate-frameworks.cs similarity index 92% rename from src/generate-frameworks.csharp rename to scripts/generate-frameworks/generate-frameworks.cs index 78a106e67b1..e3d23815bb4 100755 --- a/src/generate-frameworks.csharp +++ b/scripts/generate-frameworks/generate-frameworks.cs @@ -1,15 +1,11 @@ -#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp -s - using System.IO; using System.Text; try { - var args = Args; var actualArgumentCount = 6; if (args.Length != actualArgumentCount) { Console.WriteLine ($"Need {actualArgumentCount} arguments, got {args.Length} arguments"); - Environment.Exit (1); - return; + return 1; } var csharpOutput = args [0]; @@ -67,8 +63,8 @@ File.WriteAllText (csharpOutput, sb.ToString ()); - Environment.Exit (0); + return 0; } catch (Exception e) { Console.WriteLine ("Failed: {0}", e); - Environment.Exit (1); + return 1; } diff --git a/scripts/generate-frameworks/generate-frameworks.csproj b/scripts/generate-frameworks/generate-frameworks.csproj new file mode 100644 index 00000000000..3e1d041e4d5 --- /dev/null +++ b/scripts/generate-frameworks/generate-frameworks.csproj @@ -0,0 +1,5 @@ + + + net$(BundledNETCoreAppTargetFrameworkVersion) + + diff --git a/scripts/generate-sourcelink-json/README.md b/scripts/generate-sourcelink-json/README.md new file mode 100644 index 00000000000..c4157a40160 --- /dev/null +++ b/scripts/generate-sourcelink-json/README.md @@ -0,0 +1,18 @@ +# generate-sourcelink-json + +This script generates a SourceLink.json file that maps paths of local source +code into links to GitHub source code. + +This SourceLink.json file is then passed to the C# compiler, which embeds it +in the pdb file, and which is then consumed by debuggers or IDEs to find the +source code online for any given source file the pdb refers to. + +Example output file: + +```json +{ + "documents": { + "/local/path/to/xamarin-macios/src*": "https://raw.githubusercontent.com/xamarin/xamarin-macios/c2c617bf000c4ff864cbba9d65421f915941136b/src*" + } +} +``` diff --git a/scripts/generate-sourcelink-json/fragment.mk b/scripts/generate-sourcelink-json/fragment.mk new file mode 100644 index 00000000000..da84737c3cb --- /dev/null +++ b/scripts/generate-sourcelink-json/fragment.mk @@ -0,0 +1,2 @@ +include $(TOP)/scripts/template.mk +$(eval $(call TemplateScript,GENERATE_SOURCELINK_JSON,generate-sourcelink-json)) diff --git a/scripts/generate-sourcelink-json/generate-sourcelink-json.cs b/scripts/generate-sourcelink-json/generate-sourcelink-json.cs new file mode 100755 index 00000000000..6597a9b912e --- /dev/null +++ b/scripts/generate-sourcelink-json/generate-sourcelink-json.cs @@ -0,0 +1,15 @@ +using System.IO; +using System.Text; + +var idx = 0; +var latestCommit = args [idx++]; +var src = args [idx++]; +var outputPath = args [idx++]; + +using (var writer = new StreamWriter (outputPath)) { + writer.WriteLine ("{"); + writer.WriteLine (" \"documents\": {"); + writer.WriteLine ($" \"{src}*\": \"https://raw.githubusercontent.com/xamarin/xamarin-macios/{latestCommit}/src*\""); + writer.WriteLine (" }"); + writer.WriteLine ("}"); +} diff --git a/scripts/generate-sourcelink-json/generate-sourcelink-json.csproj b/scripts/generate-sourcelink-json/generate-sourcelink-json.csproj new file mode 100644 index 00000000000..3e1d041e4d5 --- /dev/null +++ b/scripts/generate-sourcelink-json/generate-sourcelink-json.csproj @@ -0,0 +1,5 @@ + + + net$(BundledNETCoreAppTargetFrameworkVersion) + + diff --git a/scripts/new-script.sh b/scripts/new-script.sh new file mode 100755 index 00000000000..1bc20ef313e --- /dev/null +++ b/scripts/new-script.sh @@ -0,0 +1,34 @@ +#!/bin/bash -e + +echo 'Run this script to create a new script!' + +echo "" +if test -z "$SCRIPT_NAME"; then + read -p "What's the name of your new script? " SCRIPT_NAME + if test -z "$SCRIPT_NAME"; then + echo "Exiting, no script name provided" + exit 0 + fi +fi + +echo "Name of the new script: $SCRIPT_NAME" + +UPPER_NAME=$(echo "$SCRIPT_NAME" | tr 'a-z' "A-Z" | tr '-' '_') +echo "Variable name: $UPPER_NAME" + +mkdir -p "$SCRIPT_NAME" + +printf 'include $(TOP)/scripts/template.mk\n' > "$SCRIPT_NAME/fragment.mk" +printf "\$(eval \$(call TemplateScript,$UPPER_NAME,$SCRIPT_NAME))\n" >> "$SCRIPT_NAME/fragment.mk" + +printf '\n' > "$SCRIPT_NAME/$SCRIPT_NAME.csproj" +printf ' \n' >> "$SCRIPT_NAME/$SCRIPT_NAME.csproj" +printf ' net$(BundledNETCoreAppTargetFrameworkVersion)\n' >> "$SCRIPT_NAME/$SCRIPT_NAME.csproj" +printf ' \n' >> "$SCRIPT_NAME/$SCRIPT_NAME.csproj" +printf '\n' >> "$SCRIPT_NAME/$SCRIPT_NAME.csproj" + +printf "Console.WriteLine (\"Hello $SCRIPT_NAME\");\n" > "$SCRIPT_NAME/$SCRIPT_NAME.cs" + +printf "# $SCRIPT_NAME\n" > "$SCRIPT_NAME/README.md" + +echo "Your new script is located in ./$SCRIPT_NAME. Read the README.md in this directory for how to use it." diff --git a/scripts/versions-check/README.md b/scripts/versions-check/README.md new file mode 100644 index 00000000000..14b2b09c633 --- /dev/null +++ b/scripts/versions-check/README.md @@ -0,0 +1,9 @@ +# versions-check + +This script verifies the OS versions listed in `xamarin-macios/builds/Versions-.list.in`: + +* No versions below the minimum deployment target. +* Both minimum deployment target and current deployment target must be listed. +* That the `SupportedTargetPlatformVersions` list is coherent with the + `KnownVersions` list (all versions in `KnownVersions` must also be in + `SupportedTargetPlatformVersions`). \ No newline at end of file diff --git a/src/Makefile b/src/Makefile index 4863aee6ab0..fb335c95364 100644 --- a/src/Makefile +++ b/src/Makefile @@ -109,8 +109,9 @@ include ./generator-diff.mk SHARED_RESX = $(TOP)/tools/mtouch/Errors.resx SHARED_DESIGNER_CS = $(DOTNET_BUILD_DIR)/common/Errors.Designer.cs -$(SHARED_DESIGNER_CS): $(SHARED_RESX) | $(DOTNET_BUILD_DIR)/common - $(Q_GEN) ./generate-errors.csharp > $(SHARED_DESIGNER_CS) +include $(TOP)/scripts/generate-errors/fragment.mk +$(SHARED_DESIGNER_CS): $(SHARED_RESX) $(GENERATE_ERRORS) | $(DOTNET_BUILD_DIR)/common + $(Q_GEN) $(GENERATE_ERRORS_EXEC) $(SHARED_RESX) $(SHARED_DESIGNER_CS) DOTNET_TARGETS_DIRS += $(DOTNET_BUILD_DIR)/common @@ -340,6 +341,8 @@ $(MACCATALYST_DOTNET_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $ ### .NET ### +include $(TOP)/scripts/generate-sourcelink-json/fragment.mk + define BuildDotNetIntermediateAssembly $($(2)_DOTNET_BUILD_DIR)/core-$(3).dll: $($(2)_DOTNET_CORE_SOURCES) frameworks.sources $(RSP_DIR)/dotnet/$(3)-defines-dotnet.rsp | $($(2)_DOTNET_BUILD_DIR) $$(Q_DOTNET_GEN) \ @@ -388,8 +391,8 @@ dotnet-gen:: dotnet-gen-$(3) $($(2)_DOTNET_BUILD_DIR)/ILLink.LinkAttributes.xml: $(TOP)/src/ILLink.LinkAttributes.xml.in | $($(2)_DOTNET_BUILD_DIR) $$(call Q_PROF_GEN,$(3)) sed < $$< > $$@ 's|@PRODUCT_NAME@|Microsoft.$(1)|g;' -$($(2)_DOTNET_BUILD_DIR)/SourceLink.json: $($(2)_DOTNET_BUILD_DIR) - $$(Q) $(TOP)/src/generate-sourcelink-json.csharp "$(PACKAGE_HEAD_REV)" "$(abspath $(TOP)/src)" "$$@" +$($(2)_DOTNET_BUILD_DIR)/SourceLink.json: $($(2)_DOTNET_BUILD_DIR) $(GENERATE_SOURCELINK_JSON) + $$(Q) $(GENERATE_SOURCELINK_JSON_EXEC) "$(PACKAGE_HEAD_REV)" "$(abspath $(TOP)/src)" "$$@" $($(2)_DOTNET_BUILD_DIR)/embed-files.rsp: $($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources $($(2)_DOTNET_SOURCES) $(TOP)/src/generate-embed-files.sh $$(Q) $(TOP)/src/generate-embed-files.sh $($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources "$($(2)_DOTNET_SOURCES)" > $$@.tmp diff --git a/src/Makefile.generator b/src/Makefile.generator index f640bcee20c..3c144c8567a 100644 --- a/src/Makefile.generator +++ b/src/Makefile.generator @@ -52,22 +52,24 @@ DOTNET_TARGETS_DIRS += \ # Common # -$(DOTNET_BUILD_DIR)/generator-frameworks.g.cs: frameworks.sources Makefile.generator generate-frameworks.csharp +include $(TOP)/scripts/generate-frameworks/fragment.mk +$(DOTNET_BUILD_DIR)/generator-frameworks.g.cs: frameworks.sources Makefile.generator $(GENERATE_FRAMEWORKS) @mkdir -p $(dir $@) - $(Q) ./generate-frameworks.csharp $@.tmp '$(IOS_FRAMEWORKS)' '$(MACOS_FRAMEWORKS)' '$(WATCHOS_FRAMEWORKS)' '$(TVOS_FRAMEWORKS)' '$(MACCATALYST_FRAMEWORKS)' + $(Q) $(GENERATE_FRAMEWORKS_EXEC) $@.tmp '$(IOS_FRAMEWORKS)' '$(MACOS_FRAMEWORKS)' '$(WATCHOS_FRAMEWORKS)' '$(TVOS_FRAMEWORKS)' '$(MACCATALYST_FRAMEWORKS)' $(Q) if ! diff $@ $@.tmp >/dev/null; then $(CP) $@.tmp $@; git diff "$@"; echo "The file $@ has been automatically re-generated; please commit the changes."; exit 1; fi $(Q) mv $@.tmp $@ # This rule means: generate a -defines.rsp for the frameworks in the variable _FRAMEWORKS -$(RSP_DIR)/%-defines.rsp: frameworks.sources Makefile.generator generate-defines.csharp +include $(TOP)/scripts/generate-defines/fragment.mk +$(RSP_DIR)/%-defines.rsp: frameworks.sources Makefile.generator $(GENERATE_DEFINES) @mkdir -p $(dir $@) - $(Q) ./generate-defines.csharp $@.tmp '$($(shell echo $* | tr a-z A-Z)_FRAMEWORKS)' + $(Q) $(GENERATE_DEFINES_EXEC) $@.tmp '$($(shell echo $* | tr a-z A-Z)_FRAMEWORKS)' $(Q) mv $@.tmp $@ # This rule means: generate a -defines.rsp for the frameworks in the variable _FRAMEWORKS -$(RSP_DIR)/dotnet/%-defines-dotnet.rsp: frameworks.sources Makefile.generator generate-defines.csharp +$(RSP_DIR)/dotnet/%-defines-dotnet.rsp: frameworks.sources Makefile.generator $(GENERATE_DEFINES) @mkdir -p $(dir $@) - $(Q) ./generate-defines.csharp $@.tmp '$(filter-out $(DOTNET_REMOVED_$(shell echo $* | tr a-z A-Z)_FRAMEWORKS),$($(shell echo $* | tr a-z A-Z)_FRAMEWORKS))' + $(Q) $(GENERATE_DEFINES_EXEC) $@.tmp '$(filter-out $(DOTNET_REMOVED_$(shell echo $* | tr a-z A-Z)_FRAMEWORKS),$($(shell echo $* | tr a-z A-Z)_FRAMEWORKS))' $(Q) mv $@.tmp $@ $(DOTNET_BUILD_DIR)/Xamarin.Apple.BindingAttributes.dll: bgen/Attributes.cs bgen/PlatformName.cs Makefile.generator | $(DOTNET_BUILD_DIR) diff --git a/src/generate-sourcelink-json.csharp b/src/generate-sourcelink-json.csharp deleted file mode 100755 index 965628a5278..00000000000 --- a/src/generate-sourcelink-json.csharp +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp -s - -using System.IO; -using System.Text; - -var args = Args; -var idx = 0; -var latestCommit = args [idx++]; -var src = args [idx++]; -var outputPath = args [idx++]; - -using (var writer = new StreamWriter (outputPath)) { - writer.WriteLine ("{"); - writer.WriteLine (" \"documents\": {"); - writer.WriteLine ($" \"{src}*\": \"https://raw.githubusercontent.com/xamarin/xamarin-macios/{latestCommit}/src*\""); - writer.WriteLine (" }"); - writer.WriteLine ("}"); -} - -Environment.Exit(0)