diff --git a/packages/custom_lint/CHANGELOG.md b/packages/custom_lint/CHANGELOG.md index 5483beda..65fcbc27 100644 --- a/packages/custom_lint/CHANGELOG.md +++ b/packages/custom_lint/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased fix + +- Fix Android Studio/InteliJ (thanks to @EricSchlichting) + ## 0.7.1 - 2025-01-08 - Support analyzer 7.0.0 diff --git a/packages/custom_lint/lib/src/workspace.dart b/packages/custom_lint/lib/src/workspace.dart index 60de1fb8..399034c8 100644 --- a/packages/custom_lint/lib/src/workspace.dart +++ b/packages/custom_lint/lib/src/workspace.dart @@ -744,8 +744,7 @@ publish_to: 'none' /// Run "pub get" in the client project. Future runPubGet(Directory tempDir) async { - final command = isUsingFlutter ? 'flutter' : 'dart'; - + final command = Platform.resolvedExecutable; final result = await runProcess( command, const ['pub', 'get'], diff --git a/packages/custom_lint/test/src/workspace_test.dart b/packages/custom_lint/test/src/workspace_test.dart index bf156053..4655f1ec 100644 --- a/packages/custom_lint/test/src/workspace_test.dart +++ b/packages/custom_lint/test/src/workspace_test.dart @@ -947,51 +947,10 @@ dependency_overrides: completes, ); - expect( - processes.removeFirst(), - (executable: 'dart', args: const ['pub', 'get'], runInShell: false), - ); - expect(processes, isEmpty); - }); - - test('uses fluter pub get if isUsingFlutter is true', - timeout: const Timeout.factor(2), () async { - final workingDir = await createSimpleWorkspace([ - 'flutter', - 'custom_lint_builder', - Pubspec( - 'plugin1', - environment: {'sdk': VersionConstraint.parse('^3.0.0')}, - dependencies: {'custom_lint_builder': HostedDependency()}, - ), - Pubspec( - 'a', - environment: {'sdk': VersionConstraint.parse('^3.0.0')}, - devDependencies: { - 'plugin1': PathDependency('../plugin1'), - 'flutter': PathDependency('../flutter'), - }, - ), - ]); - - final processes = spyProcess(); - - final workspace = await fromContextRootsFromPaths( - ['a'], - workingDirectory: workingDir, - ); - - expect(processes, isEmpty); - - await expectLater( - workspace.runPubGet(workingDir.dir('a')), - completes, - ); - expect( processes.removeFirst(), ( - executable: 'flutter', + executable: Platform.resolvedExecutable, args: const ['pub', 'get'], runInShell: false, ),