Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a42c766
initial commit
Jul 30, 2018
a5ff723
add example, fix link
Jul 30, 2018
0f00ef2
fix smooth command parsing
Aug 2, 2018
a95496f
Fix decomposeCubic logic
dnfield Oct 25, 2018
11687b4
uncomment/format tests
dnfield Oct 25, 2018
a74a6f7
Fixes and bump
dnfield May 7, 2019
f0df45a
Null safe (#3)
dnfield Nov 9, 2020
6d0d265
Null safe (#4)
dnfield Nov 9, 2020
efb8ea7
cirrus
dnfield Nov 9, 2020
d1739c4
Nullsafe stable release
dnfield Apr 6, 2021
1c57912
Update .cirrus.yml (#7)
dnfield May 5, 2021
9eb9ad5
Improve path_parsing performance. (#6)
jefflim-google May 5, 2021
787fa6c
versioning bump
dnfield May 5, 2021
94c7958
1.0.0
dnfield Dec 2, 2021
74a10e9
Use radians when rotating matrix (#9)
dnfield Aug 4, 2022
ebafcce
inlined the reading of code units (#10)
gaaclarke Oct 5, 2022
b89a564
Merge remote-tracking branch 'path-parsing/master' into import-path-p…
stuartmorgan-g Oct 21, 2024
6fd4a9e
Remove Cirrus config
stuartmorgan-g Oct 21, 2024
fb82a4b
CHANGELOG format
stuartmorgan-g Oct 21, 2024
ca49442
Remove analysis options, update code accordingly
stuartmorgan-g Oct 21, 2024
c0a1530
No pubspec lock files checked in, per repo convention
stuartmorgan-g Oct 21, 2024
8c35dc4
Pubspec validation
stuartmorgan-g Oct 21, 2024
d258416
Version bump
stuartmorgan-g Oct 21, 2024
cc3de83
README
stuartmorgan-g Oct 21, 2024
e7525a1
CODEOWNER
stuartmorgan-g Oct 24, 2024
299d7af
METADATA file
stuartmorgan-g Oct 24, 2024
dade4c7
Update license check to find and recognize this license
stuartmorgan-g Oct 24, 2024
f4e409a
Autolabeler
stuartmorgan-g Oct 24, 2024
3727fa0
Merge branch 'main' into import-path-parsing
stuartmorgan-g Oct 24, 2024
ccafa75
README EOL
stuartmorgan-g Oct 25, 2024
7f0a596
Merge branch 'main' into import-path-parsing
stuartmorgan-g Oct 25, 2024
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
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@
- any-glob-to-any-file:
- packages/palette_generator/**/*

'p: path_parsing':
- changed-files:
- any-glob-to-any-file:
- third_party/packages/path_parsing/**/*

'p: path_provider':
- changed-files:
- any-glob-to-any-file:
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ packages/webview_flutter/** @bparrishMines
packages/xdg_directories/** @stuartmorgan
third_party/packages/cupertino_icons/** @MitchellGoodwin
third_party/packages/cupertino_icons/test/goldens/** @LongCatIsLooong
third_party/packages/path_parsing/** @domesticmouse

# Plugin platform implementation rules. These should stay last, since the last
# matching entry takes precedence.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ These are the packages hosted in this repository:
| [metrics\_center](./packages/metrics_center/) | [![pub package](https://img.shields.io/pub/v/metrics_center.svg)](https://pub.dev/packages/metrics_center) | [![pub points](https://img.shields.io/pub/points/metrics_center)](https://pub.dev/packages/metrics_center/score) | [![popularity](https://img.shields.io/pub/popularity/metrics_center)](https://pub.dev/packages/metrics_center/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20metrics_center?label=)](https://github.com/flutter/flutter/labels/p%3A%20metrics_center) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20metrics_center?label=)](https://github.com/flutter/packages/labels/p%3A%20metrics_center) |
| [multicast\_dns](./packages/multicast_dns/) | [![pub package](https://img.shields.io/pub/v/multicast_dns.svg)](https://pub.dev/packages/multicast_dns) | [![pub points](https://img.shields.io/pub/points/multicast_dns)](https://pub.dev/packages/multicast_dns/score) | [![popularity](https://img.shields.io/pub/popularity/multicast_dns)](https://pub.dev/packages/multicast_dns/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20multicast_dns?label=)](https://github.com/flutter/flutter/labels/p%3A%20multicast_dns) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20multicast_dns?label=)](https://github.com/flutter/packages/labels/p%3A%20multicast_dns) |
| [palette\_generator](./packages/palette_generator/) | [![pub package](https://img.shields.io/pub/v/palette_generator.svg)](https://pub.dev/packages/palette_generator) | [![pub points](https://img.shields.io/pub/points/palette_generator)](https://pub.dev/packages/palette_generator/score) | [![popularity](https://img.shields.io/pub/popularity/palette_generator)](https://pub.dev/packages/palette_generator/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20palette_generator?label=)](https://github.com/flutter/flutter/labels/p%3A%20palette_generator) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20palette_generator?label=)](https://github.com/flutter/packages/labels/p%3A%20palette_generator) |
| [path\_parsing](./third_party/packages/path_parsing/) | [![pub package](https://img.shields.io/pub/v/path_parsing.svg)](https://pub.dev/packages/path_parsing) | [![pub points](https://img.shields.io/pub/points/path_parsing)](https://pub.dev/packages/path_parsing/score) | [![popularity](https://img.shields.io/pub/popularity/path_parsing)](https://pub.dev/packages/path_parsing/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20path_parsing?label=)](https://github.com/flutter/flutter/labels/p%3A%20path_parsing) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20path_parsing?label=)](https://github.com/flutter/packages/labels/p%3A%20path_parsing) |
| [path\_provider](./packages/path_provider/) | [![pub package](https://img.shields.io/pub/v/path_provider.svg)](https://pub.dev/packages/path_provider) | [![pub points](https://img.shields.io/pub/points/path_provider)](https://pub.dev/packages/path_provider/score) | [![popularity](https://img.shields.io/pub/popularity/path_provider)](https://pub.dev/packages/path_provider/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20path_provider?label=)](https://github.com/flutter/flutter/labels/p%3A%20path_provider) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20path_provider?label=)](https://github.com/flutter/packages/labels/p%3A%20path_provider) |
| [pigeon](./packages/pigeon/) | [![pub package](https://img.shields.io/pub/v/pigeon.svg)](https://pub.dev/packages/pigeon) | [![pub points](https://img.shields.io/pub/points/pigeon)](https://pub.dev/packages/pigeon/score) | [![popularity](https://img.shields.io/pub/popularity/pigeon)](https://pub.dev/packages/pigeon/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20pigeon?label=)](https://github.com/flutter/flutter/labels/p%3A%20pigeon) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20pigeon?label=)](https://github.com/flutter/packages/labels/p%3A%20pigeon) |
| [pointer\_interceptor](./packages/pointer_interceptor/) | [![pub package](https://img.shields.io/pub/v/pointer_interceptor.svg)](https://pub.dev/packages/pointer_interceptor) | [![pub points](https://img.shields.io/pub/points/pointer_interceptor)](https://pub.dev/packages/pointer_interceptor/score) | [![popularity](https://img.shields.io/pub/popularity/pointer_interceptor)](https://pub.dev/packages/pointer_interceptor/score) | [![GitHub issues by-label](https://img.shields.io/github/issues/flutter/flutter/p%3A%20pointer_interceptor?label=)](https://github.com/flutter/flutter/labels/p%3A%20pointer_interceptor) | [![GitHub pull requests by-label](https://img.shields.io/github/issues-pr/flutter/packages/p%3A%20pointer_interceptor?label=)](https://github.com/flutter/packages/labels/p%3A%20pointer_interceptor) |
Expand Down
37 changes: 35 additions & 2 deletions script/tool/lib/src/license_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ const Set<String> _ignoredFullBasenameList = <String>{
'resource.h', // Generated by VS.
};

// Third-party packages where the code doesn't have file-level annotation, just
// the package-level LICENSE file. Each entry must be a directory relative to
// third_party/packages, as that is the only directory where this is allowed.
const Set<String> _unannotatedFileThirdPartyDirectories = <String>{
'path_parsing',
};

// Copyright and license regexes for third-party code.
//
// These are intentionally very simple, since there is very little third-party
Expand Down Expand Up @@ -69,6 +76,16 @@ final List<RegExp> _thirdPartyLicenseBlockRegexes = <RegExp>[
r'// Use of this source code is governed by a BSD-style license that can be\n'
r'// found in the LICENSE file\.\n',
),
// packages/third_party/path_parsing.
RegExp(
r'Copyright \(c\) 2018 Dan Field\n\n'
r'Permission is hereby granted, free of charge, to any person obtaining a copy\n'
r'of this software and associated documentation files \(the "Software"\), to deal\n'
r'in the Software without restriction, including without limitation the rights\n'
r'to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n'
r'copies of the Software, and to permit persons to whom the Software is\n'
r'furnished to do so, subject to the following conditions:',
),
];

// The exact format of the BSD license that our license files should contain.
Expand Down Expand Up @@ -217,10 +234,26 @@ class LicenseCheckCommand extends PackageCommand {

for (final File file in codeFiles) {
print('Checking ${file.path}');
// Some third-party directories have code that doesn't annotate each file,
// so for those check the LICENSE file instead. This is done even though
// it's redundant to re-check it for each file because it ensures that we
// are still validating every file individually, rather than having a
// codepath where whole directories of files are ignored, which would have
// a much worse failure mode.
String content;
if (_unannotatedFileThirdPartyDirectories.any(
(String dir) => file.path.contains('/third_party/packages/$dir/'))) {
Directory packageDir = file.parent;
while (packageDir.parent.basename != 'packages') {
packageDir = packageDir.parent;
}
content = await packageDir.childFile('LICENSE').readAsString();
} else {
content = await file.readAsString();
}
// On Windows, git may auto-convert line endings on checkout; this should
// still pass since they will be converted back on commit.
final String content =
(await file.readAsString()).replaceAll('\r\n', '\n');
content = content.replaceAll('\r\n', '\n');

final String firstParyLicense =
firstPartyLicenseBlockByExtension[p.extension(file.path)] ??
Expand Down
10 changes: 10 additions & 0 deletions third_party/packages/path_parsing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
.dart_tool/

.packages
.pub/
.idea/

build/

.flutter-plugins
47 changes: 47 additions & 0 deletions third_party/packages/path_parsing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## 1.0.2

* Transfers the package source from https://github.com/google/process.dart to
https://github.com/dnfield/dart_path_parsing.

## 1.0.1

* Fix [bug in arc decomposition](https://github.com/dnfield/flutter_svg/issues/742).
* Minor code cleanup for analysis warnings.

## 1.0.0

* Stable release.

## 0.2.1

* Performance improvements to parsing.

## 0.2.0

* Stable nullsafe release

## 0.2.0-nullsafety.0

* Nullsafety migration.

## 0.1.4

* Fix implementation of `_PathOffset`'s `==` operator.

## 0.1.3

* Fix a bug in decompose cubic curve - avoid trying to call `toInt()` on `double.infinity`
* Bump test dependency.

## 0.1.2

* Fix bug with smooth curve commands
* Add deep testing

## 0.1.1

* Fix link to homepage in pubspec, add example

## 0.1.0

* Initial release, based on the 0.2.4 release of path_drawing
19 changes: 19 additions & 0 deletions third_party/packages/path_parsing/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2018 Dan Field

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions third_party/packages/path_parsing/METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "path_parsing"
description:
"A pure Dart parsing library for SVG paths."

third_party {
identifier {
type: "Git"
value: "https://github.com/dnfield/dart_path_parsing/"
primary_source: true
version: "6785396f6c5528c720adb14833b196e529e78998"
}
version: "6785396f6c5528c720adb14833b196e529e78998"
last_upgrade_date { year: 2024 month: 10 day: 24 }
license_type: NOTICE
}
5 changes: 5 additions & 0 deletions third_party/packages/path_parsing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# path_parsing

Split from the Flutter path drawing library to create a pure Dart parsing
library for SVG paths and code generation (without dependencies on Flutter
runtime).
51 changes: 51 additions & 0 deletions third_party/packages/path_parsing/example/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// ignore_for_file: avoid_print

import 'package:path_parsing/path_parsing.dart';

/// A [PathProxy] that dumps Flutter `Path` commands to the console.
class PathPrinter extends PathProxy {
@override
void close() {
print('Path.close();');
}

@override
void cubicTo(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
) {
print('Path.cubicTo($x1, $y1, $x2, $y2, $x3, $y3);');
}

@override
void lineTo(double x, double y) {
print('Path.lineTo($x, $y);');
}

@override
void moveTo(double x, double y) {
print('Path.moveTo($x, $y);');
}
}

void main() {
const String pathData =
'M22.1595 3.80852C19.6789 1.35254 16.3807 -4.80966e-07 12.8727 '
'-4.80966e-07C9.36452 -4.80966e-07 6.06642 1.35254 3.58579 '
'3.80852C1.77297 5.60333 0.53896 7.8599 0.0171889 10.3343C-0.0738999 '
'10.7666 0.206109 11.1901 0.64265 11.2803C1.07908 11.3706 1.50711 11.0934 '
'1.5982 10.661C2.05552 8.49195 3.13775 6.51338 4.72783 4.9391C9.21893 '
'0.492838 16.5262 0.492728 21.0173 4.9391C25.5082 9.38548 25.5082 16.6202 '
'21.0173 21.0667C16.5265 25.5132 9.21893 25.5133 4.72805 21.0669C3.17644 '
'19.5307 2.10538 17.6035 1.63081 15.4937C1.53386 15.0627 1.10252 14.7908 '
'0.66697 14.887C0.231645 14.983 -0.0427272 15.4103 0.0542205 '
'15.8413C0.595668 18.2481 1.81686 20.4461 3.5859 22.1976C6.14623 '
'24.7325 9.50955 26 12.8727 26C16.236 26 19.5991 24.7326 22.1595 '
'22.1976C27.2802 17.1277 27.2802 8.87841 22.1595 3.80852Z';

writeSvgPathDataToPath(pathData, PathPrinter());
}
9 changes: 9 additions & 0 deletions third_party/packages/path_parsing/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: path_parsing_example
publish_to: none

environment:
sdk: ^3.3.0

dependencies:
path_parsing:
path: ../
1 change: 1 addition & 0 deletions third_party/packages/path_parsing/lib/path_parsing.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'src/path_parsing.dart';
Loading