-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
46 lines (34 loc) · 1.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
SONAR_VERSION=$(shell xmllint --xpath 'string(/Project/ItemGroup/PackageReference[@Include="SonarAnalyzer.CSharp"]/@Version)' src/Analyzer/Analyzer.csproj | tr -d '\n')
BUILD_CMD=dotnet build --no-restore /property:GenerateFullPaths=true
RESOURCE_FOLDER=.res
all: configure build
configure:
dotnet restore
build-all:
$(BUILD_CMD)
build:
$(BUILD_CMD) src/Analyzer
build-docs:
$(BUILD_CMD) src/DocsGenerator
update-docs:
curl -L "https://github.com/SonarSource/sonar-dotnet/releases/download/$(SONAR_VERSION)/sonar-csharp-plugin-$(SONAR_VERSION).jar" \
-o sonar-csharp-plugin.jar
mkdir -p $(RESOURCE_FOLDER)
unzip sonar-csharp-plugin.jar -d '$(RESOURCE_FOLDER)/sonar-csharp-plugin'
cp $(RESOURCE_FOLDER)/sonar-csharp-plugin/org/sonar/plugins/csharp/Rules.json "$(RESOURCE_FOLDER)"
cp $(RESOURCE_FOLDER)/sonar-csharp-plugin/org/sonar/plugins/csharp/S*.json "$(RESOURCE_FOLDER)"
cp $(RESOURCE_FOLDER)/sonar-csharp-plugin/org/sonar/plugins/csharp/S*.html "$(RESOURCE_FOLDER)"
rm $(RESOURCE_FOLDER)/Sonar_way_profile.json
rm sonar-csharp-plugin.jar
rm -rf $(RESOURCE_FOLDER)/sonar-csharp-plugin/
documentation: update-docs build-docs
documentation:
echo $(SONAR_VERSION) > .SONAR_VERSION
dotnet "src/DocsGenerator/bin/Debug/net6/DocsGenerator.dll"
rm .SONAR_VERSION
run:
dotnet run --project src/Analyzer -f net6
publish:
dotnet publish -c Release -f net6
clean:
rm -rf .res packages