Skip to content

Migrate from 'pub' to 'dart pub'. #4686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2021
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 app/lib/dartdoc/dartdoc_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class _DartdocRunner implements DartdocRunner {
Future<void> _initializeIfNeeded() async {
if (_initialized) return;
await runProc(
['pub', 'get'],
['dart', 'pub', 'get'],
workingDirectory: resolvePubDartdocDirPath(),
);
_initialized = true;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/frontend/static_files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Future<DateTime> _detectLastModified(Directory dir) async {

Future _runPubGet(Directory dir) async {
final pr = await runProc(
['pub', 'get'],
['dart', 'pub', 'get'],
workingDirectory: dir.path,
timeout: Duration(minutes: 2),
);
Expand Down
4 changes: 2 additions & 2 deletions pkg/code_coverage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ APP_TEST_PID=$!
sleep 15;

cd "${CODE_COVERAGE_DIR}"
pub run coverage:collect_coverage \
dart pub run coverage:collect_coverage \
--uri=http://localhost:20202 \
-o "${OUTPUT_DIR}/raw/app_unit.json" \
--wait-paused \
Expand All @@ -57,7 +57,7 @@ rm ${APP_ALL_TEST_PATH}

echo "Exporting to LCOV"
cd "${APP_DIR}"
pub run coverage:format_coverage \
dart pub run coverage:format_coverage \
--packages "${APP_DIR}/.packages" \
-i "${OUTPUT_DIR}/raw/app_unit.json" \
--base-directory "${PROJECT_DIR}" \
Expand Down
6 changes: 4 additions & 2 deletions pkg/code_coverage/lib/test_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ Future<Process> _startCollect(int port, String outputFile) async {
await File(outputFile).parent.create(recursive: true);
print('[collect-$port-$outputFile] starting...');
final p = await Process.start(
'pub',
'dart',
[
'pub',
'run',
'coverage:collect_coverage',
'--uri=http://localhost:$port',
Expand All @@ -116,8 +117,9 @@ Future<void> _convertToLcov(
if (await out.exists()) return;
await out.parent.create(recursive: true);
await Process.run(
'pub',
'dart',
[
'pub',
'run',
'coverage:format_coverage',
'--packages',
Expand Down
3 changes: 2 additions & 1 deletion pkg/pub_dartdoc/test/self_documenting_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ void main() {
group('generate documentation on self', () {
setUpAll(() async {
tempDir = await Directory.systemTemp.createTemp();
final pr = await Process.run('pub', [
final pr = await Process.run('dart', [
'pub',
'run',
'pub_dartdoc',
'--input',
Expand Down
14 changes: 7 additions & 7 deletions pkg/pub_integration/lib/src/pub_tool_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ class PubToolClient {
}

Future<ProcessResult> getDependencies(String pkgDir) async {
return await runProc('pub', ['get'], workingDirectory: pkgDir);
return await runProc('dart', ['pub', 'get'], workingDirectory: pkgDir);
}

Future<ProcessResult> publish(String pkgDir, {String? expectedError}) async {
return await runProc(
'pub',
['publish', '--force'],
'dart',
['pub', 'publish', '--force'],
workingDirectory: pkgDir,
expectedError: expectedError,
);
}

Future<ProcessResult> addUploader(String pkgDir, String email) async {
return await runProc(
'pub',
['uploader', 'add', email],
'dart',
['pub', 'uploader', 'add', email],
workingDirectory: pkgDir,
expectedError: "We've sent an invitation email to $email.\n"
"They'll be added as an uploader after they accept the invitation.",
Expand All @@ -94,8 +94,8 @@ class PubToolClient {

Future<ProcessResult> removeUploader(String pkgDir, String email) async {
return await runProc(
'pub',
['uploader', 'remove', email],
'dart',
['pub', 'uploader', 'remove', email],
workingDirectory: pkgDir,
);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/web_css/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mkdir -p ${OUTPUT_DIR}
# Change to web_css folder
cd "${WEB_CSS_DIR}";

pub run sass \
dart pub run sass \
--style=compressed \
"${WEB_CSS_DIR}/lib/style.scss" \
"${OUTPUT_DIR}/style.css"