-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge package:package_config into the tools monorepo
- Loading branch information
Showing
29 changed files
with
4,315 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Set update schedule for GitHub Actions | ||
# See https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
labels: | ||
- autosubmit | ||
groups: | ||
github-actions: | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Dart CI | ||
|
||
on: | ||
# Run on PRs and pushes to the default branch. | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
env: | ||
PUB_ENVIRONMENT: bot.github | ||
|
||
jobs: | ||
# Check code formatting and static analysis on a single OS (linux) | ||
# against Dart dev. | ||
analyze: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sdk: [dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Check formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
if: always() && steps.install.outcome == 'success' | ||
- name: Analyze code | ||
run: dart analyze --fatal-infos | ||
if: always() && steps.install.outcome == 'success' | ||
|
||
# Run tests on a matrix consisting of two dimensions: | ||
# 1. OS: ubuntu-latest, (macos-latest, windows-latest) | ||
# 2. release channel: dev | ||
test: | ||
needs: analyze | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
sdk: [3.4, dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Run tests | ||
run: dart test -p chrome,vm | ||
if: always() && steps.install.outcome == 'success' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.packages | ||
.pub | ||
.dart_tool/ | ||
.vscode/ | ||
packages | ||
pubspec.lock | ||
doc/api/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Below is a list of people and organizations that have contributed | ||
# to the project. Names should be added to the list like so: | ||
# | ||
# Name/Organization <email address> | ||
|
||
Google Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
## 2.1.1-wip | ||
|
||
- Require Dart 3.4 | ||
|
||
## 2.1.0 | ||
|
||
- Adds `minVersion` to `findPackageConfig` and `findPackageConfigVersion` | ||
which allows ignoring earlier versions (which currently only means | ||
ignoring version 1, aka. `.packages` files.) | ||
|
||
- Changes the version number of `SimplePackageConfig.empty` to the | ||
current maximum version. | ||
|
||
- Improve file read performance; improve lookup performance. | ||
- Emit an error when a package is inside the package root of another package. | ||
- Fix a link in the readme. | ||
|
||
## 2.0.2 | ||
|
||
- Update package description and README. | ||
- Change to package:lints for style checking. | ||
- Add an example. | ||
|
||
## 2.0.1 | ||
|
||
- Use unique library names to correct docs issue. | ||
|
||
## 2.0.0 | ||
|
||
- Migrate to null safety. | ||
- Remove legacy APIs. | ||
- Adds `relativeRoot` property to `Package` which controls whether to | ||
make the root URI relative when writing a configuration file. | ||
|
||
## 1.9.3 | ||
|
||
- Fix `Package` constructor not accepting relative `packageUriRoot`. | ||
|
||
## 1.9.2 | ||
|
||
- Updated to support new rules for picking `package_config.json` over | ||
a specified `.packages`. | ||
- Deduce package root from `.packages` derived package configuration, | ||
and default all such packages to language version 2.7. | ||
|
||
## 1.9.1 | ||
|
||
- Remove accidental transitive import of `dart:io` from entrypoints that are | ||
supposed to be cross-platform compatible. | ||
|
||
## 1.9.0 | ||
|
||
- Based on new JSON file format with more content. | ||
- This version includes all the new functionality intended for a 2.0.0 | ||
version, as well as the, now deprecated, version 1 functionality. | ||
When we release 2.0.0, the deprecated functionality will be removed. | ||
|
||
## 1.1.0 | ||
|
||
- Allow parsing files with default-package entries and metadata. | ||
A default-package entry has an empty key and a valid package name | ||
as value. | ||
Metadata is attached as fragments to base URIs. | ||
|
||
## 1.0.5 | ||
|
||
- Fix usage of SDK constants. | ||
|
||
## 1.0.4 | ||
|
||
- Set max SDK version to <3.0.0. | ||
|
||
## 1.0.3 | ||
|
||
- Removed unneeded dependency constraint on SDK. | ||
|
||
## 1.0.2 | ||
|
||
- Update SDK constraint to be 2.0.0 dev friendly. | ||
|
||
## 1.0.1 | ||
|
||
- Fix test to not write to sink after it's closed. | ||
|
||
## 1.0.0 | ||
|
||
- Public API marked stable. | ||
|
||
## 0.1.5 | ||
|
||
- `FilePackagesDirectoryPackages.getBase(..)` performance improvements. | ||
|
||
## 0.1.4 | ||
|
||
- Strong mode fixes. | ||
|
||
## 0.1.3 | ||
|
||
- Invalid test cleanup (to keep up with changes in `Uri`). | ||
|
||
## 0.1.1 | ||
|
||
- Syntax updates. | ||
|
||
## 0.1.0 | ||
|
||
- Initial implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Want to contribute? Great! First, read this page (including the small print at | ||
the end). | ||
|
||
### Before you contribute | ||
Before we can use your code, you must sign the | ||
[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual) | ||
(CLA), which you can do online. The CLA is necessary mainly because you own the | ||
copyright to your changes, even after your contribution becomes part of our | ||
codebase, so we need your permission to use and distribute your code. We also | ||
need to be sure of various other things—for instance that you'll tell us if you | ||
know that your code infringes on other people's patents. You don't have to sign | ||
the CLA until after you've submitted your code for review and a member has | ||
approved it, but you must do it before we can put your code into our codebase. | ||
|
||
Before you start working on a larger contribution, you should get in touch with | ||
us first through the issue tracker with your idea so that we can help out and | ||
possibly guide you. Coordinating up front makes it much easier to avoid | ||
frustration later on. | ||
|
||
### Code reviews | ||
All submissions, including submissions by project members, require review. | ||
|
||
### File headers | ||
All files in the project must start with the following header. | ||
|
||
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
### The small print | ||
Contributions made by corporations are covered by a different agreement than the | ||
one above, the | ||
[Software Grant and Corporate Contributor License Agreement](https://developers.google.com/open-source/cla/corporate). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2019, the Dart project authors. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google LLC nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[![Build Status](https://github.com/dart-lang/package_config/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/package_config/actions?query=workflow%3A"Dart+CI"+branch%3Amaster) | ||
[![pub package](https://img.shields.io/pub/v/package_config.svg)](https://pub.dev/packages/package_config) | ||
[![package publisher](https://img.shields.io/pub/publisher/package_config.svg)](https://pub.dev/packages/package_config/publisher) | ||
|
||
Support for working with **Package Configuration** files as described | ||
in the Package Configuration v2 [design document](https://github.com/dart-lang/language/blob/master/accepted/2.8/language-versioning/package-config-file-v2.md). | ||
|
||
A Dart package configuration file is used to resolve Dart package names (e.g. | ||
`foobar`) to Dart files containing the source code for that package (e.g. | ||
`file:///Users/myuser/.pub-cache/hosted/pub.dartlang.org/foobar-1.1.0`). The | ||
standard package configuration file is `.dart_tool/package_config.json`, and is | ||
written by the Dart tool when the command `dart pub get` is run. | ||
|
||
The primary libraries of this package are | ||
* `package_config.dart`: | ||
Defines the `PackageConfig` class and other types needed to use | ||
package configurations, and provides functions to find, read and | ||
write package configuration files. | ||
|
||
* `package_config_types.dart`: | ||
Just the `PackageConfig` class and other types needed to use | ||
package configurations. This library does not depend on `dart:io`. | ||
|
||
The package includes deprecated backwards compatible functionality to | ||
work with the `.packages` file. This functionality will not be maintained, | ||
and will be removed in a future version of this package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file | ||
# for details. All rights reserved. Use of this source code is governed by a | ||
# BSD-style license that can be found in the LICENSE file. | ||
|
||
include: package:dart_flutter_team_lints/analysis_options.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'dart:io' show Directory; | ||
|
||
import 'package:package_config/package_config.dart'; | ||
|
||
void main() async { | ||
var packageConfig = await findPackageConfig(Directory.current); | ||
if (packageConfig == null) { | ||
print('Failed to locate or read package config.'); | ||
} else { | ||
print('This package depends on ${packageConfig.packages.length} packages:'); | ||
for (var package in packageConfig.packages) { | ||
print('- ${package.name}'); | ||
} | ||
} | ||
} |
Oops, something went wrong.