Skip to content

Commit 08b2d00

Browse files
authored
Merge branch 'main' into improve-ds-interop-performance
2 parents fe5ee54 + 4574386 commit 08b2d00

File tree

66 files changed

+4128
-2073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4128
-2073
lines changed

.github/CopyRuntime.ps1

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[string]$OutputPath,
4+
5+
[ValidateSet('arm64','x64')]
6+
[string]
7+
$Arch = "x64"
8+
)
9+
10+
$VsInstances = Get-VSSetupInstance
11+
12+
$VsDirectory = $VsInstances[0].InstallationPath
13+
14+
$DefaultRedistFile = Join-Path $VsDirectory "VC" "Auxiliary" "Build" "Microsoft.VCRedistVersion.default.txt"
15+
16+
$ExpectedVersion = (Get-Content -Path $DefaultRedistFile).Trim()
17+
18+
$RuntimeLocation = Join-Path $VsDirectory "VC" "Redist" "MSVC" $ExpectedVersion $Arch
19+
20+
$CrtLocation = Join-Path $RuntimeLocation "*.CRT" -Resolve
21+
22+
if ($CrtLocation.Length -eq 0) {
23+
throw [System.IO.FileNotFoundException] "$RuntimeLocation CRT folder not resolved"
24+
}
25+
26+
$Copied = Copy-Item -Path "$CrtLocation\*.dll" -Destination $OutputPath -PassThru
27+
28+
if ($Copied.Length -eq 0) {
29+
throw [System.IO.FileNotFoundException] "$CrtLocation No files copied"
30+
}

.github/labeler.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
GUI:
2+
- changed-files:
3+
- any-glob-to-any-file: ['lib/**', 'test/**', 'pubspec.yaml']
4+
5+
ElasticLib:
6+
- changed-files:
7+
- any-glob-to-any-file: ['elasticlib/**']
8+
9+
dependencies:
10+
- changed-files:
11+
- any-glob-to-any-file: ['pubspec.yaml']
12+
13+
workflows:
14+
- changed-files:
15+
- any-glob-to-any-file: ['.github/workflows/**']

.github/workflows/elastic-ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
token: ${{ secrets.CODECOV_TOKEN }}
8080

8181
- name: Generate junit report xml
82+
if: ${{ !cancelled() }}
8283
run: dart pub global run junitreport:tojunit --input reports/test-report.json --output reports/junit-report.xml
8384

8485
- name: Upload test reports to Codecov
@@ -134,6 +135,10 @@ jobs:
134135

135136
- name: Build app
136137
run: flutter build ${{ matrix.build-option }}
138+
139+
- name: Copy runtime files
140+
if: ${{ matrix.build-option == 'windows' }}
141+
run: ./.github/CopyRuntime.ps1 -OutputPath ${{ matrix.artifact-path }}
137142

138143
- name: Zip release
139144
if: ${{ matrix.build-option == 'macos' }}
@@ -161,15 +166,15 @@ jobs:
161166
if: ${{ matrix.build-option == 'macos' }}
162167
uses: L-Super/[email protected]
163168
with:
164-
dmg_name: build/macos/Build/Products/Release/elastic-setup
169+
dmg_name: build/macos/Build/Products/Release/elastic-setup-macos
165170
src_dir: build/macos/Build/Products/Release/elastic_dashboard.app
166171

167172
- name: Upload macOS installer
168173
if: ${{ matrix.build-option == 'macos' }}
169174
uses: actions/upload-artifact@v4
170175
with:
171176
name: ${{ matrix.artifact-name }}_installer
172-
path: build/macos/Build/Products/Release/elastic-setup.dmg
177+
path: build/macos/Build/Products/Release/elastic-setup-macos.dmg
173178
if-no-files-found: error
174179

175180
- name: Create windows installer
@@ -235,6 +240,10 @@ jobs:
235240
- name: Build app
236241
run: flutter build ${{ matrix.build-option }} --dart-define=ELASTIC_WPILIB=true
237242

243+
- name: Copy runtime files
244+
if: ${{ matrix.build-option == 'windows' }}
245+
run: ./.github/CopyRuntime.ps1 -OutputPath ${{ matrix.artifact-path }}
246+
238247
- name: Zip release
239248
if: ${{ matrix.build-option == 'macos' }}
240249
run: |

.github/workflows/pr-labeler.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
labeler:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
15+
- uses: actions/labeler@v5
16+
with:
17+
sync-labels: true

assets/fields/2025-field.png

807 KB
Loading

assets/fields/2025-reefscape.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"game": "Reefscape",
3+
"source-url": "https://www.chiefdelphi.com/t/4k-field-image-2025-reefscape/478797",
4+
"field-image": "assets/fields/2025-field.png",
5+
"field-corners": {
6+
"top-left": [
7+
421,
8+
91
9+
],
10+
"bottom-right": [
11+
3352,
12+
1437
13+
]
14+
},
15+
"field-size": [
16+
17.548,
17+
8.052
18+
]
19+
}

installer_setup_script.iss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LicenseFile=LICENSE
3232
PrivilegesRequired=lowest
3333
PrivilegesRequiredOverridesAllowed=dialog
3434
OutputDir=build\windows\x64\installer
35-
OutputBaseFilename=elastic-setup
35+
OutputBaseFilename=elastic-setup-windows
3636
SetupIconFile=assets\icon.ico
3737
Compression=lzma
3838
SolidCompression=yes
@@ -46,11 +46,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
4646

4747
[Files]
4848
Source: "build\windows\x64\runner\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
49-
Source: "build\windows\x64\runner\Release\file_selector_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
50-
Source: "build\windows\x64\runner\Release\flutter_windows.dll"; DestDir: "{app}"; Flags: ignoreversion
51-
Source: "build\windows\x64\runner\Release\screen_retriever_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
52-
Source: "build\windows\x64\runner\Release\url_launcher_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
53-
Source: "build\windows\x64\runner\Release\window_manager_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
49+
Source: "build\windows\x64\runner\Release\*.dll"; DestDir: "{app}"; Flags: ignoreversion
5450
Source: "build\windows\x64\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
5551
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
5652

lib/main.dart

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'dart:convert';
22
import 'dart:io';
3-
import 'dart:math';
43

54
import 'package:flutter/material.dart';
65

76
import 'package:collection/collection.dart';
87
import 'package:dot_cast/dot_cast.dart';
98
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
9+
import 'package:logger/logger.dart';
1010
import 'package:package_info_plus/package_info_plus.dart';
1111
import 'package:path_provider/path_provider.dart';
1212
import 'package:screen_retriever/screen_retriever.dart';
@@ -54,6 +54,11 @@ void main() async {
5454
preferences = await SharedPreferences.getInstance();
5555
}
5656

57+
Level logLevel = Settings.logLevels.firstWhereOrNull((level) =>
58+
level.levelName == preferences.getString(PrefKeys.logLevel)) ??
59+
Defaults.logLevel;
60+
Logger.level = logLevel;
61+
5762
await windowManager.ensureInitialized();
5863

5964
NTWidgetBuilder.ensureInitialized();
@@ -66,18 +71,26 @@ void main() async {
6671
await FieldImages.loadFields('assets/fields/');
6772

6873
Display primaryDisplay = await screenRetriever.getPrimaryDisplay();
69-
double scaleFactor = (primaryDisplay.scaleFactor?.toDouble() ?? 1.0);
70-
Size screenSize =
71-
(primaryDisplay.visibleSize ?? primaryDisplay.size) * scaleFactor;
74+
Size screenSize = primaryDisplay.visibleSize ?? primaryDisplay.size;
75+
76+
logger.debug('Display Information: - Screen Size: $screenSize');
7277

73-
double minimumWidth = min(screenSize.width * 0.77 / scaleFactor, 1280.0);
74-
double minimumHeight = min(screenSize.height * 0.7 / scaleFactor, 720.0);
78+
late final double platformWidthAdjust;
79+
if (Platform.isMacOS) {
80+
platformWidthAdjust = 30;
81+
} else if (Platform.isLinux) {
82+
platformWidthAdjust = 10;
83+
} else {
84+
platformWidthAdjust = 0;
85+
}
7586

76-
Size minimumSize = Size(minimumWidth, minimumHeight);
87+
final Size minimumSize = Size(436.5 + platformWidthAdjust, 320.0);
7788

7889
await windowManager.setMinimumSize(minimumSize);
79-
await windowManager.setTitleBarStyle(TitleBarStyle.hidden,
80-
windowButtonVisibility: false);
90+
await windowManager.setTitleBarStyle(
91+
TitleBarStyle.hidden,
92+
windowButtonVisibility: false,
93+
);
8194

8295
if (preferences.getBool(PrefKeys.rememberWindowPosition) ?? false) {
8396
await _restoreWindowPosition(preferences, primaryDisplay, minimumSize);
@@ -145,7 +158,7 @@ Future<void> _backupPreferences(String appFolderPath) async {
145158
if (await File(backup).exists()) await File(backup).delete(recursive: true);
146159
await File(original).copy(backup);
147160

148-
logger.info('Backup up shared_preferences.json to $backup');
161+
logger.info('Backed up shared_preferences.json to $backup');
149162
} catch (_) {
150163
/* Do nothing */
151164
}

0 commit comments

Comments
 (0)