1
- #! /bin/bash -ex
1
+ #! /bin/bash -e
2
2
3
3
# Go to the top level directory
4
4
cd " $( git rev-parse --show-toplevel) "
@@ -23,6 +23,7 @@ IFS=$'\n'
23
23
SED=(sed -i)
24
24
fi
25
25
26
+ echo ' Changing "== null" and "!= null" to "is null" and "is not null"...'
26
27
for file in $( git ls-files -- ' *.cs' ' :(exclude)tests/monotouch-test/Foundation/UrlTest.cs' ' :(exclude)tests/monotouch-test/AVFoundation/AVAudioFormatTest.cs' ) ; do
27
28
if [[ -L " $file " ]]; then
28
29
echo " Skipping $file because it's a symlink"
@@ -33,44 +34,63 @@ IFS=$'\n'
33
34
done
34
35
)
35
36
36
- # Go one directory up, to avoid any global.json in xamarin- macios
37
+ # Go one directory up, to avoid any global.json in dotnet/ macios
37
38
cd ..
38
39
40
+ if test -z " ${DOTNET:- } " ; then
41
+ DOTNET=dotnet
42
+ fi
43
+
44
+ function af_whitespace ()
45
+ {
46
+ echo " Processing $1 ..."
47
+ $DOTNET format whitespace " $1 "
48
+ }
49
+
39
50
# Start formatting!
40
- dotnet format whitespace " $SRC_DIR /tests/cecil-tests/cecil-tests.csproj"
41
- dotnet format whitespace " $SRC_DIR /tests/dotnet/UnitTests/DotNetUnitTests.csproj"
42
- dotnet format whitespace " $SRC_DIR /msbuild/Messaging/Xamarin.Messaging.Build/Xamarin.Messaging.Build.csproj"
43
- dotnet format whitespace " $SRC_DIR /msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj"
44
- dotnet format whitespace " $SRC_DIR /msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj"
45
- dotnet format whitespace " $SRC_DIR /msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Tasks.Windows.csproj"
46
- dotnet format whitespace " $SRC_DIR /src/bgen/bgen.csproj"
47
- dotnet format whitespace " $SRC_DIR /tools/dotnet-linker/dotnet-linker.csproj"
48
- dotnet format whitespace " $SRC_DIR /tools/mmp/mmp.csproj"
49
- dotnet format whitespace " $SRC_DIR /tools/mtouch/mtouch.csproj"
50
- dotnet format whitespace " $SRC_DIR /tests/xharness/xharness.sln"
51
- dotnet format whitespace " $SRC_DIR /tests/introspection/dotnet/iOS/introspection.csproj"
52
- dotnet format whitespace " $SRC_DIR /tests/introspection/dotnet/MacCatalyst/introspection.csproj"
53
- dotnet format whitespace " $SRC_DIR /tests/introspection/dotnet/macOS/introspection.csproj"
54
- dotnet format whitespace " $SRC_DIR /tests/introspection/dotnet/tvOS/introspection.csproj"
55
- dotnet format whitespace " $SRC_DIR /tests/monotouch-test/dotnet/iOS/monotouch-test.csproj"
56
- dotnet format whitespace " $SRC_DIR /tests/monotouch-test/dotnet/MacCatalyst/monotouch-test.csproj"
57
- dotnet format whitespace " $SRC_DIR /tests/monotouch-test/dotnet/macOS/monotouch-test.csproj"
58
- dotnet format whitespace " $SRC_DIR /tests/monotouch-test/dotnet/tvOS/monotouch-test.csproj"
59
- dotnet format whitespace " $SRC_DIR /tests/xtro-sharpie/xtro-sharpie/xtro-sharpie.csproj"
60
- dotnet format whitespace " $SRC_DIR /tests/xtro-sharpie/u2ignore/u2ignore.csproj"
61
- dotnet format whitespace " $SRC_DIR /tests/xtro-sharpie/u2todo/u2todo.csproj"
62
- dotnet format whitespace " $SRC_DIR /tests/xtro-sharpie/xtro-report/xtro-report.csproj"
63
- dotnet format whitespace " $SRC_DIR /tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj"
64
- dotnet format whitespace " $SRC_DIR /tools/api-tools/mono-api-html/mono-api-html.csproj"
65
- dotnet format whitespace " $SRC_DIR /tools/api-tools/mono-api-info/mono-api-info.csproj"
66
- dotnet format whitespace " $SRC_DIR /tests/common/MonoTouch.Dialog/MonoTouch.Dialog.iOS.csproj"
67
- dotnet format whitespace " $SRC_DIR /tests/common/MonoTouch.Dialog/MonoTouch.Dialog.MacCatalyst.csproj"
68
- dotnet format whitespace " $SRC_DIR /tests/common/MonoTouch.Dialog/MonoTouch.Dialog.tvOS.csproj"
69
- dotnet format whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.iOS.csproj"
70
- dotnet format whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.MacCatalyst.csproj"
71
- dotnet format whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.macOS.csproj"
72
- dotnet format whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.tvOS.csproj"
73
- dotnet format whitespace --folder " $SRC_DIR "
51
+ af_whitespace " $SRC_DIR /tests/cecil-tests/cecil-tests.csproj"
52
+ af_whitespace " $SRC_DIR /tests/dotnet/UnitTests/DotNetUnitTests.csproj"
53
+ af_whitespace " $SRC_DIR /msbuild/Messaging/Xamarin.Messaging.Build/Xamarin.Messaging.Build.csproj"
54
+ af_whitespace " $SRC_DIR /msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj"
55
+ af_whitespace " $SRC_DIR /msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj"
56
+ af_whitespace " $SRC_DIR /msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Tasks.Windows.csproj"
57
+ af_whitespace " $SRC_DIR /src/bgen/bgen.csproj"
58
+ af_whitespace " $SRC_DIR /src/rgen/Microsoft.Macios.Binding.Common/Microsoft.Macios.Binding.Common.csproj"
59
+ af_whitespace " $SRC_DIR /src/rgen/Microsoft.Macios.Bindings.Analyzer.Sample/Microsoft.Macios.Bindings.Analyzer.Sample.csproj"
60
+ af_whitespace " $SRC_DIR /src/rgen/Microsoft.Macios.Bindings.Analyzer/Microsoft.Macios.Bindings.Analyzer.csproj"
61
+ af_whitespace " $SRC_DIR /src/rgen/Microsoft.Macios.Bindings.CodeFixers/Microsoft.Macios.Bindings.CodeFixers.csproj"
62
+ af_whitespace " $SRC_DIR /src/rgen/Microsoft.Macios.Generator.Sample/Microsoft.Macios.Generator.Sample.csproj"
63
+ af_whitespace " $SRC_DIR /src/rgen/Microsoft.Macios.Generator/Microsoft.Macios.Generator.csproj"
64
+ af_whitespace " $SRC_DIR /src/rgen/Microsoft.Macios.Transformer/Microsoft.Macios.Transformer.csproj"
65
+ af_whitespace " $SRC_DIR /tools/dotnet-linker/dotnet-linker.csproj"
66
+ af_whitespace " $SRC_DIR /tools/mmp/mmp.csproj"
67
+ af_whitespace " $SRC_DIR /tools/mtouch/mtouch.csproj"
68
+ af_whitespace " $SRC_DIR /tests/xharness/xharness.sln"
69
+ af_whitespace " $SRC_DIR /tests/introspection/dotnet/iOS/introspection.csproj"
70
+ af_whitespace " $SRC_DIR /tests/introspection/dotnet/MacCatalyst/introspection.csproj"
71
+ af_whitespace " $SRC_DIR /tests/introspection/dotnet/macOS/introspection.csproj"
72
+ af_whitespace " $SRC_DIR /tests/introspection/dotnet/tvOS/introspection.csproj"
73
+ af_whitespace " $SRC_DIR /tests/monotouch-test/dotnet/iOS/monotouch-test.csproj"
74
+ af_whitespace " $SRC_DIR /tests/monotouch-test/dotnet/MacCatalyst/monotouch-test.csproj"
75
+ af_whitespace " $SRC_DIR /tests/monotouch-test/dotnet/macOS/monotouch-test.csproj"
76
+ af_whitespace " $SRC_DIR /tests/monotouch-test/dotnet/tvOS/monotouch-test.csproj"
77
+ af_whitespace " $SRC_DIR /tests/xtro-sharpie/xtro-sharpie/xtro-sharpie.csproj"
78
+ af_whitespace " $SRC_DIR /tests/xtro-sharpie/u2ignore/u2ignore.csproj"
79
+ af_whitespace " $SRC_DIR /tests/xtro-sharpie/u2todo/u2todo.csproj"
80
+ af_whitespace " $SRC_DIR /tests/xtro-sharpie/xtro-report/xtro-report.csproj"
81
+ af_whitespace " $SRC_DIR /tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj"
82
+ af_whitespace " $SRC_DIR /tools/api-tools/mono-api-html/mono-api-html.csproj"
83
+ af_whitespace " $SRC_DIR /tools/api-tools/mono-api-info/mono-api-info.csproj"
84
+ af_whitespace " $SRC_DIR /tests/common/MonoTouch.Dialog/MonoTouch.Dialog.iOS.csproj"
85
+ af_whitespace " $SRC_DIR /tests/common/MonoTouch.Dialog/MonoTouch.Dialog.MacCatalyst.csproj"
86
+ af_whitespace " $SRC_DIR /tests/common/MonoTouch.Dialog/MonoTouch.Dialog.tvOS.csproj"
87
+ af_whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.iOS.csproj"
88
+ af_whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.MacCatalyst.csproj"
89
+ af_whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.macOS.csproj"
90
+ af_whitespace " $SRC_DIR /tests/common/Touch.Unit/Touch.Client/dotnet/Touch.Client.tvOS.csproj"
91
+
92
+ echo " Processing $SRC_DIR ..."
93
+ $DOTNET format whitespace --folder " $SRC_DIR "
74
94
75
95
for file in " $SRC_DIR " /dotnet/Templates/Microsoft.* .Templates/* /* /.template.config/localize/* .json " $SRC_DIR " /dotnet/Templates/Microsoft.* .Templates/* /.template.config/localize/* .json; do
76
96
tr -d $' \r ' < " $file " > " $file " .tmp
0 commit comments