Skip to content

Commit 96f60ea

Browse files
author
Gonzalo Diaz
committed
[BREAKING] ⚠️ [REFACTOR] [CONFIG] project (main) rename due namespaces issues: https://stackoverflow.com/a/31741692/6366150
1 parent 08eac26 commit 96f60ea

27 files changed

+28
-28
lines changed

.github/workflows/snyk-code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
with:
2828
dotnet-version: 8.0.x
2929
- name: Restore dependencies
30-
run: dotnet restore algorithm-exercises-csharp.sln
30+
run: dotnet restore algorithm_exercises_csharp.sln
3131
- name: Run Snyk to check for vulnerabilities
3232
continue-on-error: true # To make sure that SARIF upload gets called
3333
run: >
3434
snyk test
35-
algorithm-exercises-csharp/
35+
algorithm_exercises_csharp/
3636
algorithm-exercises-csharp-base/
3737
algorithm-exercises-csharp-test/
3838
--sarif-file-output=snyk-code.sarif

Dockerfile

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ENV WORKDIR=/app
1313
WORKDIR ${WORKDIR}
1414

1515
COPY ./Makefile ${WORKDIR}/
16-
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
17-
COPY ./algorithm-exercises-csharp/algorithm-exercises-csharp.csproj ${WORKDIR}/algorithm-exercises-csharp/algorithm-exercises-csharp.csproj
16+
COPY ./algorithm_exercises_csharp.sln ${WORKDIR}/algorithm_exercises_csharp.sln
17+
COPY ./algorithm_exercises_csharp/algorithm_exercises_csharp.csproj ${WORKDIR}/algorithm_exercises_csharp/algorithm_exercises_csharp.csproj
1818
COPY ./algorithm-exercises-csharp-base/algorithm-exercises-csharp-base.csproj ${WORKDIR}/algorithm-exercises-csharp-base/algorithm-exercises-csharp-base.csproj
1919
COPY ./algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj ${WORKDIR}/algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj
2020

@@ -26,10 +26,9 @@ FROM base AS lint
2626
ENV WORKDIR=/app
2727
WORKDIR ${WORKDIR}
2828

29-
RUN apk add --update --no-cache make nodejs npm
30-
RUN apk add --update --no-cache yamllint
31-
32-
RUN npm install -g --ignore-scripts markdownlint-cli
29+
RUN apk add --update --no-cache make nodejs npm \
30+
&& apk add --update --no-cache yamllint \
31+
&& npm install -g --ignore-scripts markdownlint-cli
3332

3433
# [!TIP] Use a bind-mount to "/app" to override following "copys"
3534
# for lint and test against "current" sources in this stage
@@ -45,10 +44,10 @@ COPY ./LICENSE.md ${WORKDIR}/
4544
COPY ./CODE_OF_CONDUCT.md ${WORKDIR}/
4645

4746
# Code source
48-
COPY ./algorithm-exercises-csharp ${WORKDIR}/algorithm-exercises-csharp
47+
COPY ./algorithm_exercises_csharp.sln ${WORKDIR}/algorithm_exercises_csharp.sln
48+
COPY ./algorithm_exercises_csharp ${WORKDIR}/algorithm_exercises_csharp
4949
COPY ./algorithm-exercises-csharp-base ${WORKDIR}/algorithm-exercises-csharp-base
5050
COPY ./algorithm-exercises-csharp-test ${WORKDIR}/algorithm-exercises-csharp-test
51-
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
5251

5352
# code linting conf
5453
COPY ./.editorconfig ${WORKDIR}/
@@ -65,20 +64,20 @@ CMD ["make", "lint"]
6564
###############################################################################
6665
FROM base AS development
6766

68-
COPY ./algorithm-exercises-csharp ${WORKDIR}/algorithm-exercises-csharp
67+
COPY ./algorithm_exercises_csharp.sln ${WORKDIR}/algorithm_exercises_csharp.sln
68+
COPY ./algorithm_exercises_csharp ${WORKDIR}/algorithm_exercises_csharp
6969
COPY ./algorithm-exercises-csharp-base ${WORKDIR}/algorithm-exercises-csharp-base
7070
COPY ./algorithm-exercises-csharp-test ${WORKDIR}/algorithm-exercises-csharp-test
71-
COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln
7271

73-
RUN make build
74-
RUN ls -alh
72+
RUN make build \
73+
&& ls -alh
7574

7675
# CMD []
7776
###############################################################################
7877
FROM development AS builder
7978

80-
RUN dotnet publish --self-contained --runtime linux-musl-x64
81-
RUN ls -alh
79+
RUN dotnet publish --self-contained --runtime linux-musl-x64 \
80+
&& ls -alh
8281

8382
CMD ["ls", "-alh"]
8483

@@ -106,19 +105,20 @@ CMD ["make", "test"]
106105
##
107106
FROM mcr.microsoft.com/dotnet/runtime:8.0.8-alpine3.19-amd64 AS production
108107

108+
RUN apk add --update --no-cache make
109+
109110
ENV LOG_LEVEL=info
110111
ENV BRUTEFORCE=false
111112
ENV WORKDIR=/app
112113
WORKDIR ${WORKDIR}
113114

114-
RUN adduser -D worker
115-
RUN mkdir -p /app
116-
RUN chown worker:worker /app
115+
RUN adduser -D worker \
116+
&& mkdir -p /app \
117+
&& chown worker:worker /app
117118

118-
RUN apk add --update --no-cache make
119119
COPY ./Makefile ${WORKDIR}/
120-
COPY --from=builder /app/algorithm-exercises-csharp/bin/Release/net8.0/algorithm-exercises-csharp.dll ${WORKDIR}/
121-
COPY --from=builder /app/algorithm-exercises-csharp/bin/Release/net8.0/algorithm-exercises-csharp.runtimeconfig.json ${WORKDIR}/
120+
COPY --from=builder /app/algorithm_exercises_csharp/bin/Release/net8.0/algorithm_exercises_csharp.dll ${WORKDIR}/
121+
COPY --from=builder /app/algorithm_exercises_csharp/bin/Release/net8.0/algorithm_exercises_csharp.runtimeconfig.json ${WORKDIR}/
122122

123123
RUN ls -alh
124124

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUNTIME_TOOL=dotnet
3333
PACKAGE_TOOL=dotnet
3434
VERBOSITY_LEVEL=normal
3535

36-
PROJECT_DIRECTORY=algorithm-exercises-csharp
36+
MAIN_PROJECT_DIRECTORY=algorithm_exercises_csharp
3737
BASE_PROJECT_DIRECTORY=algorithm-exercises-csharp-base
3838
TEST_PROJECT_DIRECTORY=algorithm-exercises-csharp-test
3939

@@ -114,9 +114,9 @@ clean:
114114

115115
rm -vfr .mono/ || true
116116
rm -vfr coverage-report/ || true
117-
find ${PROJECT_DIRECTORY} -path "*/TestResults/*" -type d -print -exec rm -vfr {} ';' || true
118-
find ${PROJECT_DIRECTORY} -path "*/bin/*" -print -exec rm -vfr {} ';' || true
119-
find ${PROJECT_DIRECTORY} -path "*/obj/*" -print -exec rm -vfr {} ';' || true
117+
find ${MAIN_PROJECT_DIRECTORY} -path "*/TestResults/*" -type d -print -exec rm -vfr {} ';' || true
118+
find ${MAIN_PROJECT_DIRECTORY} -path "*/bin/*" -print -exec rm -vfr {} ';' || true
119+
find ${MAIN_PROJECT_DIRECTORY} -path "*/obj/*" -print -exec rm -vfr {} ';' || true
120120

121121
find ${BASE_PROJECT_DIRECTORY} -path "*/TestResults/*" -type d -print -exec rm -vfr {} ';' || true
122122
find ${BASE_PROJECT_DIRECTORY} -path "*/bin/*" -print -exec rm -vfr {} ';' || true

algorithm-exercises-csharp-test/algorithm-exercises-csharp-test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</ItemGroup>
4646

4747
<ItemGroup>
48-
<ProjectReference Include="../algorithm-exercises-csharp/algorithm-exercises-csharp.csproj" />
48+
<ProjectReference Include="../algorithm_exercises_csharp/algorithm_exercises_csharp.csproj" />
4949
</ItemGroup>
5050

5151
<Target Name="GenerateHtmlCoverageReport" AfterTargets="GenerateCoverageResultAfterTest">

algorithm-exercises-csharp.sln renamed to algorithm_exercises_csharp.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm-exercises-csharp-test", "algorithm-exercises-csharp-test\algorithm-exercises-csharp-test.csproj", "{817BA968-9A1F-4DDB-8A96-657DCA862227}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm-exercises-csharp", "algorithm-exercises-csharp\algorithm-exercises-csharp.csproj", "{B162EE62-90C6-4871-B278-390804615987}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm_exercises_csharp", "algorithm_exercises_csharp\algorithm_exercises_csharp.csproj", "{B162EE62-90C6-4871-B278-390804615987}"
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "algorithm-exercises-csharp-base", "algorithm-exercises-csharp-base\algorithm-exercises-csharp-base.csproj", "{1BC65C42-83A6-486D-84DB-0DC63002FA24}"
1111
EndProject

0 commit comments

Comments
 (0)