Skip to content
Open
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
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"flutter": "3.24.0"
"flutter": "3.38.9"
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
"dart.sdkPath": ".fvm/flutter_sdk/bin/cache/dart-sdk",
"dart.lineLength": 180,
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
Expand Down
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ linter:
rules:
- unawaited_futures
- always_declare_return_types
- unsafe_html
- use_full_hex_values_for_flutter_colors
- prefer_final_in_for_each
- prefer_final_fields
Expand Down
403 changes: 0 additions & 403 deletions coverage/lcov_cobertura.py

This file was deleted.

127 changes: 127 additions & 0 deletions coverage/test_coverage_filter.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import 'dart:io';

void main() {
printMessage('Start filtering the lcov.info file');
final file = File('coverage/lcov.info');
if (!file.existsSync()) {
printMessage('"lcov.info" does not exist');
return;
}
const endOfRecord = 'end_of_record';
final sections = <LcovSection>[];
final lines = file.readAsLinesSync();
LcovSection? currentSection;
for (final line in lines) {
if (line.endsWith('.dart')) {
final filePath = line.replaceAll('SF:', '');
currentSection = LcovSection()
..header = line
..filePath = filePath;
} else if (line == endOfRecord) {
final currentSectionTmp = currentSection;
if (currentSectionTmp != null) {
currentSectionTmp.footer = line;
sections.add(currentSectionTmp);
}
} else {
currentSection?.body.add(line);
}
}
final filteredSections = getFilteredSections(sections);
final sb = StringBuffer();
for (final section in filteredSections) {
sb.write(section.toString());
}
file.writeAsStringSync(sb.toString());
printMessage('Filtered the lcov.info file');
}

class LcovSection {
String? filePath;
String? header;
final body = <String>[];
String? footer;

String? getBodyString() {
final filePathTmp = filePath;
if (filePathTmp == null) return null;
final file = File(filePathTmp);
final content = file.readAsLinesSync();
final sb = StringBuffer();
getFilteredBody(body, content).forEach((item) => sb..write(item)..write('\n'));
return sb.toString();
}

@override
String toString() {
return '$header\n${getBodyString()}$footer\n';
}
}

List<LcovSection> getFilteredSections(List<LcovSection> sections) {
return sections.where((section) {
final header = section.header;
if (header == null) return false;
if (header.endsWith('.g.dart')) {
return false;
} else if (header.endsWith('dummy_service.dart')) {
return false;
} else if (header.startsWith('SF:lib/vendor/')) {
return false;
} else if (header.startsWith('SF:lib/util/locale')) {
return false;
} else if (header.contains('widgetbook/')) {
return false;
}
return true;
}).toList();
}

List<String> getFilteredBody(List<String> body, List<String> lines) {
return body.where((line) {
if (line.startsWith('DA:')) {
final sections = line.split(',');
final lineNr = int.parse(sections[0].replaceAll('DA:', ''));
final callCount = int.parse(sections[1]);
if (callCount == 0) {
final fileLine = lines[lineNr - 1].trim();
if (excludedLines.contains(fileLine)) {
return false;
}
for (final line in excludedStartsWithLines) {
if (fileLine.trim().startsWith(line)) {
return false;
}
}
}
}
return true;
}).toList();
}

const excludedLines = [
'AppConstants._();',
'EnvUtils._();',
'FlutterTemplateLogger._();',
'FlutterTemplateThemeData._();',
'Keys._();',
'LicenseUtil._();',
'ThemeAssets._();',
'ThemeColors._();',
'ThemeDimens._();',
'ThemeDurations._();',
'ThemeFonts._();',
'ThemeTextStyles._();',
];

const excludedStartsWithLines = [
'IntColumn get ',
'TextColumn get ',
'BoolColumn get ',
'DateTimeColumn get ',
];

void printMessage(String message) {
// ignore: avoid_print
print(message);
}
8 changes: 4 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ lane :pr do
checkCompilationAndAnalyzer
Dir.chdir ".." do
sh("fvm", "flutter", "test")
#sh("fvm", "flutter", "test", "--coverage")
#sh("dart", "--version")
#sh("dart", "coverage/filter_test_coverage.dart")
#sh("python3", "coverage/lcov_cobertura.py", "coverage/lcov.info", "--output", "coverage/coverage.xml")
sh("fvm", "flutter", "test", "--coverage")
sh("fvm", "dart", "--version")
sh("fvm", "dart", "coverage/test_coverage_filter.dart")
sh("cobertura", "convert", "-i", "coverage/lcov.info", "-o", "coverage/coverage.xml")
end
git_reset
end
Expand Down
3 changes: 3 additions & 0 deletions fastlane/analysis_options_check_compilation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ analyzer:
unused_import: ignore
unused_element: ignore
unused_local_variable: ignore
unused_element_parameter: ignore
deprecated_member_use: ignore
invalid_use_of_internal_member: ignore

linter:
rules:
Expand Down
43 changes: 43 additions & 0 deletions fastlane/report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="fastlane.lanes">




<testcase classname="fastlane.lanes" name="0: Verifying fastlane version" time="0.000183">

</testcase>


<testcase classname="fastlane.lanes" name="1: is_ci" time="8.0e-05">

</testcase>


<testcase classname="fastlane.lanes" name="2: install_provisioning_profiles" time="0.105418">

</testcase>


<testcase classname="fastlane.lanes" name="3: is_ci" time="0.000176">

</testcase>


<testcase classname="fastlane.lanes" name="4: echo No\ build\ nr\ set,\ USING\ DEFAULT\ \(1\)" time="0.006442">

</testcase>


<testcase classname="fastlane.lanes" name="5: clean_build_artifacts" time="0.000139">

</testcase>


<testcase classname="fastlane.lanes" name="6: cobertura convert -i coverage/lcov.info -o coverage/coverage.xml" time="0.270353">

</testcase>

</testsuite>
</testsuites>
2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
<string>13.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.$(CONFIGURATION).xcconfig"
#include "Generated.xcconfig"
32 changes: 32 additions & 0 deletions ios/Flutter/ephemeral/flutter_lldb_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Generated file, do not edit.
#

import lldb

def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
base = frame.register["x0"].GetValueAsAddress()
page_len = frame.register["x1"].GetValueAsUnsigned()

# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
# first page to see if handled it correctly. This makes diagnosing
# misconfiguration (e.g. missing breakpoint) easier.
data = bytearray(page_len)
data[0:8] = b'IHELPED!'

error = lldb.SBError()
frame.GetThread().GetProcess().WriteMemory(base, data, error)
if not error.Success():
print(f'Failed to write into {base}[+{page_len}]', error)
return

def __lldb_init_module(debugger: lldb.SBDebugger, _):
target = debugger.GetDummyTarget()
# Caveat: must use BreakpointCreateByRegEx here and not
# BreakpointCreateByName. For some reasons callback function does not
# get carried over from dummy target for the later.
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
bp.SetAutoContinue(True)
print("-- LLDB integration loaded --")
5 changes: 5 additions & 0 deletions ios/Flutter/ephemeral/flutter_lldbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Generated file, do not edit.
#

command script import --relative-to-command-file flutter_lldb_helper.py
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Loading