Skip to content

fix: Hot reload breaking #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<ImplicitUsings>true</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Moq" Version="4.20.69" />
<PackageVersion Include="xunit" Version="2.7.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.8" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static HttpExtensionsTests()
[InlineData("https://thisisaverybadurlthatwillnotworkhopefullyever.com/", false)]
[InlineData("https://www.google.com/", true)]
[InlineData("https://github.com/api/meta", true)]
public async void ValidateUri_CheckUrl_SuccessIsAsExpected(string urlUnderTest, bool expected)
public async Task ValidateUri_CheckUrl_SuccessIsAsExpected(string urlUnderTest, bool expected)
{
Assert.Equal(expected, await HttpClient.ValidateUri(new Uri(urlUnderTest), new System.Net.Http.Headers.ProductInfoHeaderValue(new System.Net.Http.Headers.ProductHeaderValue("IntelliTect.Multitool.Testing"))));
}
Expand Down
10 changes: 8 additions & 2 deletions IntelliTect.Multitool.Tests/IntelliTect.Multitool.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../IntelliTect.Multitool/Build/IntelliTect.Multitool.targets" />
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1; net6.0; net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' != 'true'">
<!-- We want to make sure our CI property works properly on the runner, this is just to run tests locally -->
<!-- We don't use the $CI condition since that is the one under test -->
<ReleaseDateAttribute>true</ReleaseDateAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Moq" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
Expand All @@ -20,4 +26,4 @@
<ItemGroup>
<ProjectReference Include="..\IntelliTect.Multitool\IntelliTect.Multitool.csproj" />
</ItemGroup>
</Project>
</Project>
1 change: 0 additions & 1 deletion IntelliTect.Multitool.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntelliTect.Multitool.Tests
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7FB66610-EB11-460E-8CC8-F49044F452D0}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
.github\workflows\deploy.yml = .github\workflows\deploy.yml
Directory.Build.props = Directory.Build.props
Expand Down
23 changes: 18 additions & 5 deletions IntelliTect.Multitool/Build/IntelliTect.Multitool.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<Project>
<ItemGroup>
<AssemblyAttribute Include="IntelliTect.Multitool.ReleaseDate">
<_Parameter1>$([System.DateTime]::UtcNow.ToString("O"))</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Condition="'$(CI)' == 'true' OR '$(ReleaseDateAttribute)' == 'true'" Include="IntelliTect.Multitool.ReleaseDate">
<_Parameter1>$([System.DateTime]::UtcNow.ToString("O"))</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<PropertyGroup Label="CI" Condition="'$(CI)' == ''">
<CI>false</CI>
<!-- GH, CircleCI, GitLab and BitBucket already use CI -->
<CI Condition="'$(TF_BUILD)' == 'true' or
'$(TEAMCITY_VERSION)' != '' or
'$(APPVEYOR)' != '' or
'$(BuildRunner)' == 'MyGet' or
'$(JENKINS_URL)' != '' or
'$(TRAVIS)' == 'true' or
'$(BUDDY)' == 'true' or
'$(CODEBUILD_CI)' == 'true'">true</CI>
</PropertyGroup>

<Target Name="WriteLaunchers" AfterTargets="CopyFilesToOutputDirectory">
<PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
// Result is "Build: 8 Feb, 2023 11:36:31 AM"
```

### Miscellaneous Information:

- To help [hot reload in visual studio work properly](https://github.com/IntelliTect/Multitool/issues/125), the release date attribute will be automatically be generated during compilation on a CI runner, but it won’t generate locally by default. If you want it to generate locally, set the `ReleaseDateAttribute` to true within a property group in your project file. (`<ReleaseDateAttribute>true</ReleaseDateAttribute>`)

## RepositoryPaths - Provides consistent environment-independent normalized pathing within a git repository

### Samples:
Expand Down
Loading