Skip to content
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
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutter": "3.32.8",
"flutter": "3.35.2",
"flavors": {}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ jobs:
PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p")
echo "score: $PANA_SCORE"
IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; TOTAL=SCORE_ARR[1]
if (( $SCORE < $TOTAL )); then echo $PANA; echo "minimum score not met!"; exit 1; fi
if (( $SCORE < $TOTAL - 10 )); then echo $PANA; echo "minimum score not met!"; exit 1; fi
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dart.flutterSdkPath": ".fvm/versions/3.32.8",
"dart.flutterSdkPath": ".fvm/versions/3.35.2",
"dart.sdkPath": ".fvm/flutter_sdk/bin/cache/dart-sdk",
"search.exclude": {
"**/.fvm": true
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

## Version 0.23
## Version 0.23.0-dev
- technical: use package_config to interact with package configs
- fix: problem resolving external packages

## Version 0.22.1
- feat: Support git references for package analysis
Expand Down
14 changes: 11 additions & 3 deletions lib/src/tooling/dart_interaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,19 @@ abstract class DartInteraction {
packageEntry['rootUri'] = Uri.file(toPackage).toString();
}
}
if (packageNameReplacementInfo != null &&
packageEntry['name'] == packageNameReplacementInfo.oldPackageName) {
packageEntry['name'] = packageNameReplacementInfo.newPackageName;
if (packageNameReplacementInfo != null) {
// adapt rootUri of root package
if (packageConfigJson['name'] ==
packageNameReplacementInfo.newPackageName) {
packageEntry['rootUri'] = '../';
}
}
}
// remove old package
if (packageNameReplacementInfo != null) {
(packageConfigJson['packages'] as List<dynamic>).removeWhere((entry) =>
entry['name'] == packageNameReplacementInfo.oldPackageName);
}
await packageConfigFile.writeAsString(jsonEncode(packageConfigJson));
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
analyzer: ^7.0.0
analyzer: ^7.5.9
args: ^2.3.1
collection: ^1.19.0
colorize: ^3.0.0
Expand All @@ -25,7 +25,7 @@ dependencies:
pubspec_parse: ^1.5.0
stack: ^0.2.1
tuple: ^2.0.0
yaml: ^3.1.2
yaml: ^3.1.3

dev_dependencies:
build_runner: ^2.2.0
Expand Down
49 changes: 47 additions & 2 deletions test/integration_tests/cli/extract_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void main() {
'Can handle ffigen dependency overrides correctly (pub ref)',
() async {
final packageName = 'ffigen';
final packageVersion = '16.0.0';
final packageVersion = '19.1.0';

final exitCode = await runner.run([
'extract',
Expand All @@ -260,7 +260,7 @@ void main() {
'Can handle ffigen dependency overrides correctly (git ref)',
() async {
final gitUrl = 'https://github.com/dart-lang/native.git';
final gitRef = 'cb477002e2d2559975d76165210eeca98821688d';
final gitRef = '20556d0c84404b3c74d8b91e40b30ee7f2b2577e';
final relativePath = 'pkgs/ffigen';

// create temporary directory
Expand Down Expand Up @@ -299,6 +299,51 @@ void main() {
timeout: integrationTestTimeout,
);

test(
'Can handle hooks:0.20.0 external types',
() async {
final pubRef = 'pub://hooks/0.20.0';

final tempDir = await Directory.systemTemp.createTemp();
final tempFilePath =
path.join(tempDir.path, 'handles_external_types.json');

try {
final exitCode = await runner.run([
'extract',
'--input',
pubRef,
'--output',
tempFilePath,
]);
expect(exitCode, 0);

final jsonReportFile = File(tempFilePath);
expect(await jsonReportFile.exists(), isTrue);

final jsonReport = jsonDecode(await jsonReportFile.readAsString());

final interfaceDeclarations =
jsonReport['packageApi']['interfaceDeclarations'] as List;
final builderInterface = interfaceDeclarations
.singleWhere((id) => id['name'] == 'Builder');
final builderExecutableDeclarations =
builderInterface['executableDeclarations'] as List;
final builderRunExecutable = builderExecutableDeclarations
.singleWhere((id) => id['name'] == 'run');
final builderRunExecutableParameters =
builderRunExecutable['parameters'] as List;
final builderRunExecutableLoggerParameter =
builderRunExecutableParameters
.singleWhere((id) => id['name'] == 'logger');
expect(builderRunExecutableLoggerParameter['typeName'], 'Logger?');
} finally {
tempDir.deleteSync(recursive: true);
}
},
timeout: integrationTestTimeout,
);

test(
'can handle packages in a workspace',
() async {
Expand Down
Loading