Skip to content

Commit 0903f42

Browse files
committed
Create sonarcloud.yml
Added LiveSplit.Core.dll Using submodules for SpeedrunComSharp Simplified submodules by dropping UpdateManager
1 parent 1a00023 commit 0903f42

File tree

8 files changed

+86
-12
lines changed

8 files changed

+86
-12
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: SonarCloud
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: windows-latest
12+
steps:
13+
- name: Set up JDK 11
14+
uses: actions/setup-java@v1
15+
with:
16+
java-version: 1.11
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
20+
- name: Cache SonarCloud packages
21+
uses: actions/cache@v1
22+
with:
23+
path: ~\sonar\cache
24+
key: ${{ runner.os }}-sonar
25+
restore-keys: ${{ runner.os }}-sonar
26+
- name: Cache SonarCloud scanner
27+
id: cache-sonar-scanner
28+
uses: actions/cache@v1
29+
with:
30+
path: .\.sonar\scanner
31+
key: ${{ runner.os }}-sonar-scanner
32+
restore-keys: ${{ runner.os }}-sonar-scanner
33+
- name: Install SonarCloud scanner
34+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
35+
shell: powershell
36+
run: |
37+
New-Item -Path .\.sonar\scanner -ItemType Directory
38+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
39+
- name: Build and analyze
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
42+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43+
shell: powershell
44+
run: |
45+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"Avasam_LiveSplit.AverageTime" /o:"avasam" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
46+
git submodule update --init --recursive
47+
dotnet build
48+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "SpeedrunComSharp"]
2+
path = SpeedrunComSharp
3+
url = https://github.com/LiveSplit/SpeedrunComSharp.git

LiveSplit.AverageTime.csproj

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,15 @@
4343
<Prefer32Bit>false</Prefer32Bit>
4444
</PropertyGroup>
4545
<ItemGroup>
46-
<Reference Include="LiveSplit.Core">
47-
<HintPath>..\..\..\..\..\Program Files\LiveSplit_1.7.6\LiveSplit.Core.dll</HintPath>
48-
<Private>False</Private>
49-
</Reference>
50-
<Reference Include="SpeedrunComSharp">
51-
<HintPath>..\..\..\..\..\Program Files\LiveSplit_1.7.6\SpeedrunComSharp.dll</HintPath>
52-
<Private>False</Private>
46+
<Reference Include="LiveSplit.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47+
<SpecificVersion>False</SpecificVersion>
48+
<HintPath>.\LiveSplit.Core.dll</HintPath>
5349
</Reference>
5450
<Reference Include="System" />
5551
<Reference Include="System.Core" />
5652
<Reference Include="System.Drawing" />
5753
<Reference Include="System.Windows.Forms" />
5854
<Reference Include="System.Xml" />
59-
<Reference Include="UpdateManager">
60-
<HintPath>..\..\..\..\..\Program Files\LiveSplit_1.7.6\UpdateManager.dll</HintPath>
61-
<Private>False</Private>
62-
</Reference>
6355
</ItemGroup>
6456
<ItemGroup>
6557
<Compile Include="Extensions\DictionaryExtensions.cs" />
@@ -79,6 +71,12 @@
7971
<DependentUpon>AverageTimeSettings.cs</DependentUpon>
8072
</EmbeddedResource>
8173
</ItemGroup>
74+
<ItemGroup>
75+
<ProjectReference Include="SpeedrunComSharp\SpeedrunComSharp\SpeedrunComSharp.csproj">
76+
<Project>{924aaffe-5b89-49e2-99ad-ec9373cc838d}</Project>
77+
<Name>SpeedrunComSharp</Name>
78+
</ProjectReference>
79+
</ItemGroup>
8280
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
8381
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
8482
Other similar extension points exist, see Microsoft.Common.targets.

LiveSplit.AverageTime.sln

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,32 @@ VisualStudioVersion = 16.0.30804.86
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveSplit.AverageTime", "LiveSplit.AverageTime.csproj", "{B0470637-949C-4A41-9C8C-0CE46561037F}"
77
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpeedrunComSharp", "SpeedrunComSharp\SpeedrunComSharp\SpeedrunComSharp.csproj", "{924AAFFE-5B89-49E2-99AD-EC9373CC838D}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug with API Calls|Any CPU = Debug with API Calls|Any CPU
1013
Debug|Any CPU = Debug|Any CPU
1114
Release Candidate|Any CPU = Release Candidate|Any CPU
1215
Release|Any CPU = Release|Any CPU
1316
EndGlobalSection
1417
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{B0470637-949C-4A41-9C8C-0CE46561037F}.Debug with API Calls|Any CPU.ActiveCfg = Debug|Any CPU
19+
{B0470637-949C-4A41-9C8C-0CE46561037F}.Debug with API Calls|Any CPU.Build.0 = Debug|Any CPU
1520
{B0470637-949C-4A41-9C8C-0CE46561037F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1621
{B0470637-949C-4A41-9C8C-0CE46561037F}.Debug|Any CPU.Build.0 = Debug|Any CPU
1722
{B0470637-949C-4A41-9C8C-0CE46561037F}.Release Candidate|Any CPU.ActiveCfg = Release Candidate|Any CPU
1823
{B0470637-949C-4A41-9C8C-0CE46561037F}.Release Candidate|Any CPU.Build.0 = Release Candidate|Any CPU
1924
{B0470637-949C-4A41-9C8C-0CE46561037F}.Release|Any CPU.ActiveCfg = Release|Any CPU
2025
{B0470637-949C-4A41-9C8C-0CE46561037F}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Debug with API Calls|Any CPU.ActiveCfg = Debug with API Calls|Any CPU
27+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Debug with API Calls|Any CPU.Build.0 = Debug with API Calls|Any CPU
28+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Release Candidate|Any CPU.ActiveCfg = Release|Any CPU
31+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Release Candidate|Any CPU.Build.0 = Release|Any CPU
32+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Release|Any CPU.ActiveCfg = Release|Any CPU
33+
{924AAFFE-5B89-49E2-99AD-EC9373CC838D}.Release|Any CPU.Build.0 = Release|Any CPU
2134
EndGlobalSection
2235
GlobalSection(SolutionProperties) = preSolution
2336
HideSolutionNode = FALSE

LiveSplit.Core.dll

1.17 MB
Binary file not shown.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ Based on [LiveSplit/LiveSplit.WorldRecord@bb6c710](https://github.com/LiveSplit/
66

77
I mainly did this for personnal use, with minimal changes, so some references (like versionning) to LiveSplit.WorldRecord are still left in. If someone really wants it, I can clean up and make this its own proper component.
88

9-
Excludes the last 5% and rounds down to the nearestsecond when miliseconds are not included.
9+
Excludes the last 5% and rounds down to the nearest second when miliseconds are not included.
10+
11+
Run `git submodule update --init --recursive` to download LiveSplit and its submodules as a submodule so it can be built

SpeedrunComSharp

Submodule SpeedrunComSharp added at 2c54f53

UI/Components/AverageTimeFactory.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55

66
[assembly:ComponentFactory(typeof(LiveSplit.AverageTime.UI.Components.AverageTimeFactory))]
77

8+
public interface IComponentFactory
9+
{
10+
string ComponentName { get; }
11+
string Description { get; }
12+
ComponentCategory Category { get; }
13+
14+
IComponent Create(LiveSplitState state);
15+
}
16+
817
namespace LiveSplit.AverageTime.UI.Components
918
{
1019
public class AverageTimeFactory : IComponentFactory

0 commit comments

Comments
 (0)