1 { lib, stdenv, dotnetfx }:
7 , verbosity ? "detailed"
8 , options ? "/p:Configuration=Debug;Platform=Win32"
11 , modifyPublicMain ? false
12 , mainClassFile ? null
15 assert modifyPublicMain -> mainClassFile != null;
20 buildInputs = [ dotnetfx ];
27 ${lib.optionalString modifyPublicMain ''
28 sed -i -e "s|static void Main|public static void Main|" ${mainClassFile}
36 if [ -f $1/nix-support/dotnet-assemblies ]
38 for i in $(cat $1/nix-support/dotnet-assemblies)
40 windowsPath=$(cygpath --windows $i)
41 assemblySearchPaths="$assemblySearchPaths;$windowsPath"
48 for i in ${toString assemblyInputs}
50 windowsPath=$(cygpath --windows $i)
51 echo "Using assembly path: $windowsPath"
53 if [ "$assemblySearchPaths" = "" ]
55 assemblySearchPaths="$windowsPath"
57 assemblySearchPaths="$assemblySearchPaths;$windowsPath"
63 echo "Assembly search paths are: $assemblySearchPaths"
65 if [ "$assemblySearchPaths" != "" ]
67 echo "Using assembly search paths args: $assemblySearchPathsArg"
68 export AssemblySearchPaths=$assemblySearchPaths
72 MSBuild.exe ${toString slnFile} /nologo /t:${targets} /p:IntermediateOutputPath=$(cygpath --windows $out)\\ /p:OutputPath=$(cygpath --windows $out)\\ /verbosity:${verbosity} ${options}
74 # Because .NET assemblies store strings as UTF-16 internally, we cannot detect
75 # hashes. Therefore a text files containing the proper paths is created
76 # We can also use this file the propagate transitive dependencies.
78 mkdir -p $out/nix-support
80 for i in ${toString assemblyInputs}
82 echo $i >> $out/nix-support/dotnet-assemblies