Unverified Commit 07215db4 authored by Guillaume Maudoux's avatar Guillaume Maudoux Committed by GitHub
Browse files

Merge pull request #259398 from whonore/update-dafny-4.3.0

parents 173a07ff 4b36cd01
Loading
Loading
Loading
Loading
+23 −15
Original line number Diff line number Diff line
@@ -8,24 +8,32 @@

buildDotnetModule rec {
  pname = "Dafny";
  version = "4.2.0";
  version = "4.3.0";

  src = fetchFromGitHub {
    owner = "dafny-lang";
    repo = "dafny";
    rev = "v${version}";
    sha256 = "sha256-RSGaOgGf3m94t3SKnvSPqz0VHhWr6NmIMtGsmOynMaM=";
    hash = "sha256-bnKaaqh1/921SRwnwqgYb31SJ8vguEBtzywPTz79S6I=";
  };

  postPatch = ''
    cp ${writeScript "fake-gradlew-for-dafny" ''
  postPatch =
    # This version number seems to be hardcoded and didn't get updated with the
    # version bump from 4.2.0 to 4.3.0.
    let dafnyRuntimeJarVersion = "4.2.0";
    in ''
      cp ${
        writeScript "fake-gradlew-for-dafny" ''
          mkdir -p build/libs/
          javac $(find -name "*.java" | grep "^./src/main") -d classes
      jar cf build/libs/DafnyRuntime-${version}.jar -C classes dafny
          jar cf build/libs/DafnyRuntime-${dafnyRuntimeJarVersion}.jar -C classes dafny
        ''} Source/DafnyRuntime/DafnyRuntimeJava/gradlew

      # Needed to fix
    # "error NETSDK1129: The 'Publish' target is not supported without specifying a target framework. The current project targets multiple frameworks, you must specify the framework for the published application."
      # "error NETSDK1129: The 'Publish' target is not supported without
      # specifying a target framework. The current project targets multiple
      # frameworks, you must specify the framework for the published
      # application."
      substituteInPlace Source/DafnyRuntime/DafnyRuntime.csproj \
        --replace TargetFrameworks TargetFramework \
        --replace "netstandard2.0;net452" net6.0