diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 09bd897ee2..8c356dab99 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -40,7 +40,7 @@ jobs: name: ${{ matrix.BENCHMARK_NAME }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - name: Run ${{ matrix.BENCHMARK_NAME }} working-directory: ${{ env.BENCHMARKS_PATH }} run: dotnet run --exporters json --configuration Release --filter '*${{ matrix.BENCHMARK_NAME }}*' diff --git a/.github/workflows/code-ql.yml b/.github/workflows/code-ql.yml index cb76dd9018..14d6e5221a 100644 --- a/.github/workflows/code-ql.yml +++ b/.github/workflows/code-ql.yml @@ -34,6 +34,6 @@ jobs: - uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - run: dotnet build - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c47027c72a..3aef0558f1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -46,7 +46,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/configure-pages@v3 - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - run: dotnet tool restore - run: dotnet build - uses: actions/setup-node@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9da7ac82da..89e52f42d2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - run: dotnet tool restore - run: dotnet csharpier --check . # don't run dotnet format for whitespace formatting as this is done by csharpier diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 452fa6308c..6d47f74a99 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,10 @@ on: description: 'The created version' value: ${{ jobs.release.outputs.version }} +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: true + jobs: release: runs-on: ubuntu-latest @@ -28,7 +32,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - uses: actions/setup-node@v3 with: node-version: '18' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a272a03fb..84cc2bee1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,13 +22,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - run: dotnet run --project ./samples/Riok.Mapperly.Sample test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - run: dotnet build /p:TreatWarningsAsErrors=true - run: dotnet test --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - uses: codecov/codecov-action@v3 @@ -39,7 +39,7 @@ jobs: steps: - uses: actions/checkout@v4 - run: sudo apt update && sudo apt -y install zipmerge # zipmerge is used to merge the multi target nupkg - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - run: dotnet tool restore - run: RELEASE_VERSION="0.0.1-dev.$GITHUB_RUN_ID" ./build/package.sh - uses: actions/upload-artifact@v3 @@ -56,7 +56,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 - run: dotnet tool restore - uses: actions/download-artifact@v3 with: @@ -84,7 +84,7 @@ jobs: - run: apk add --no-cache bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib # delete global.json since we want to use custom versions here - run: rm global.json - - uses: actions/setup-dotnet@v3.2.0 + - uses: actions/setup-dotnet@v3 with: dotnet-version: ${{ matrix.dotnet }} - run: dotnet --list-sdks diff --git a/Directory.Build.props b/Directory.Build.props index 5f80726258..1212b92c88 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - net7.0 + net8.0 true embedded enable diff --git a/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj b/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj index 4a85b40f98..1403a7b9e4 100644 --- a/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj +++ b/benchmarks/Riok.Mapperly.Benchmarks/Riok.Mapperly.Benchmarks.csproj @@ -8,11 +8,11 @@ - - - - - + + + + + diff --git a/build/package.sh b/build/package.sh index 546a98d229..d676f54122 100755 --- a/build/package.sh +++ b/build/package.sh @@ -5,7 +5,7 @@ set -Eeuo pipefail # pack a nupkg for each roslyn version that is supported by Mapperly # and merge them together into one nupkg -roslyn_versions=('4.0' '4.4' '4.5') +roslyn_versions=('4.0' '4.4' '4.5' '4.7') RELEASE_VERSION=${RELEASE_VERSION:-"0.0.1-dev.$(date +%s)"} RELEASE_NOTES=${RELEASE_NOTES:-''} diff --git a/docs/docs/configuration/generated-source.mdx b/docs/docs/configuration/generated-source.mdx index f65f7ed483..781d16fc1d 100644 --- a/docs/docs/configuration/generated-source.mdx +++ b/docs/docs/configuration/generated-source.mdx @@ -35,7 +35,7 @@ dotnet build /p:EmitCompilerGeneratedFiles=true By default the files are written to `{BaseIntermediateOutpath}/generated/{Assembly}/Riok.Mapperly/{GeneratedFile}`. -With `BaseIntermediateOutpath` for example being `obj/Debug/net7.0`. +With `BaseIntermediateOutpath` for example being `obj/Debug/net8.0`. The output path can be customized via the `CompilerGeneratedFilesOutputPath` property. This can be used to check the generated files into VCS. diff --git a/docs/prebuild.ts b/docs/prebuild.ts index dd7204ffa8..d1ba454319 100644 --- a/docs/prebuild.ts +++ b/docs/prebuild.ts @@ -95,7 +95,7 @@ async function buildSamples(): Promise { const projectFilesToCopy = ['CarMapper.cs', 'Car.cs', 'CarDto.cs']; const generatedMapperFile = join( sampleProject, - 'obj/Debug/net7.0/generated/Riok.Mapperly/Riok.Mapperly.MapperGenerator/CarMapper.g.cs', + 'obj/Debug/net8.0/generated/Riok.Mapperly/Riok.Mapperly.MapperGenerator/CarMapper.g.cs', ); // Copy generated mapper to target dir diff --git a/global.json b/global.json index 7aed64df9d..d1f845ad62 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.200", + "version": "8.0.100-rc.1.23455.8", "rollForward": "latestPatch" } } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e9f4bdaa58..58dfc2f477 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -12,7 +12,7 @@ (a lot of features get polyfilled by Meziantou.Polyfill) however we need to be careful with the available features! --> - 11 + preview diff --git a/src/Riok.Mapperly/Descriptors/Mappings/UserMappings/IDelegateUserMapping.cs b/src/Riok.Mapperly/Descriptors/Mappings/UserMappings/IDelegateUserMapping.cs index 7fe53e337b..4533eb3c97 100644 --- a/src/Riok.Mapperly/Descriptors/Mappings/UserMappings/IDelegateUserMapping.cs +++ b/src/Riok.Mapperly/Descriptors/Mappings/UserMappings/IDelegateUserMapping.cs @@ -9,10 +9,4 @@ public interface IDelegateUserMapping : IUserMapping /// Gets the delegate mapping or null if none is set (yet). /// INewInstanceMapping? DelegateMapping { get; } - - /// - /// Sets the delegate mapping. - /// - /// The mapping. - void SetDelegateMapping(INewInstanceMapping mapping); } diff --git a/src/Riok.Mapperly/Riok.Mapperly.Roslyn4.7.props b/src/Riok.Mapperly/Riok.Mapperly.Roslyn4.7.props new file mode 100644 index 0000000000..1135a89bf8 --- /dev/null +++ b/src/Riok.Mapperly/Riok.Mapperly.Roslyn4.7.props @@ -0,0 +1,11 @@ + + + + $(DefineConstants);ROSLYN4_4_OR_GREATER + + + + + + + diff --git a/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj b/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj index 4a817150f7..6efa08fa2c 100644 --- a/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj +++ b/test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj @@ -2,7 +2,7 @@ - net7.0 + net8.0 $(MapperlyIntegrationTestsTargetFramework) true @@ -11,6 +11,8 @@ disable + preview + 9.0 diff --git a/test/Riok.Mapperly.Templates.Tests/PreserveReferenceHandlerTest.cs b/test/Riok.Mapperly.Templates.Tests/PreserveReferenceHandlerTest.cs index 9ff7055b79..8b02d837fc 100644 --- a/test/Riok.Mapperly.Templates.Tests/PreserveReferenceHandlerTest.cs +++ b/test/Riok.Mapperly.Templates.Tests/PreserveReferenceHandlerTest.cs @@ -10,7 +10,7 @@ public class PreserveReferenceHandlerTest [Fact] public void EmptyReferenceHandlerShouldReturnFalse() { - _handler.TryGetReference(new MyObj(), out MyDto _).Should().BeFalse(); + _handler.TryGetReference(new MyObj(), out MyDto? _).Should().BeFalse(); } [Fact] diff --git a/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj b/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj index ab1f229429..47198094a6 100644 --- a/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj +++ b/test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj @@ -1,7 +1,7 @@ - +