clarified signature: more operations;
authorwenzelm
Tue, 26 Mar 2024 17:27:35 +0100
changeset 80009 ac10e32938df
parent 80008 914c4a81027d
child 80010 6964a23f595a
clarified signature: more operations;
src/Pure/System/isabelle_platform.scala
src/Pure/Tools/dotnet_setup.scala
--- a/src/Pure/System/isabelle_platform.scala	Tue Mar 26 17:06:23 2024 +0100
+++ b/src/Pure/System/isabelle_platform.scala	Tue Mar 26 17:27:35 2024 +0100
@@ -43,6 +43,11 @@
   val ISABELLE_WINDOWS_PLATFORM64: String = get("ISABELLE_WINDOWS_PLATFORM64")
   val ISABELLE_APPLE_PLATFORM64: String = get("ISABELLE_APPLE_PLATFORM64")
 
+  def ISABELLE_PLATFORM(windows: Boolean = false, apple: Boolean = false): String =
+    proper_string(if_proper(windows, ISABELLE_WINDOWS_PLATFORM64)) orElse
+    proper_string(if_proper(apple, ISABELLE_APPLE_PLATFORM64)) orElse
+    proper_string(ISABELLE_PLATFORM64) getOrElse error("Missing ISABELLE_PLATFORM64")
+
   def is_arm: Boolean =
     ISABELLE_PLATFORM64.startsWith("arm64-") ||
     ISABELLE_APPLE_PLATFORM64.startsWith("arm64-")
--- a/src/Pure/Tools/dotnet_setup.scala	Tue Mar 26 17:06:23 2024 +0100
+++ b/src/Pure/Tools/dotnet_setup.scala	Tue Mar 26 17:27:35 2024 +0100
@@ -36,13 +36,8 @@
 
   /* dotnet download and setup */
 
-  def default_platform: String = {
-    val self = Isabelle_Platform.self
-    proper_string(self.ISABELLE_WINDOWS_PLATFORM64).getOrElse(
-      proper_string(self.ISABELLE_APPLE_PLATFORM64).getOrElse(
-        self.ISABELLE_PLATFORM64))
-  }
-
+  def default_platform: String =
+    Isabelle_Platform.self.ISABELLE_PLATFORM(windows = true, apple = true)
   def default_target_dir: Path = Components.default_components_base
   def default_install_url: String = "https://dot.net/v1/dotnet-install"
   def default_version: String = Isabelle_System.getenv_strict("ISABELLE_DOTNET_VERSION")