Skip to content
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

Prepare the Dart FFI package for publish #4299

Closed
wants to merge 14 commits into from
18 changes: 18 additions & 0 deletions .github/workflows/publish-dart.yaml
mosuem marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# A CI configuration to auto-publish pub packages.

name: Publish

on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/publish-dart.yml'
- 'ffi/capi/dart/**'
push:
tags: [ '[0-9A-z]+-v[0-9]+.[0-9]+.[0-9]+' ]

jobs:
publish:
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
with:
write-comments: false
16 changes: 16 additions & 0 deletions .github/workflows/write-comments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Comment on the pull request

on:
# Trigger this workflow after the Health workflow completes. This workflow will have permissions to
# do things like create comments on the PR, even if the original workflow couldn't.
workflow_run:
workflows:
- Publish
types:
- completed

jobs:
upload:
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main
permissions:
pull-requests: write
3 changes: 3 additions & 0 deletions ffi/capi/dart/package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

- Initial version.
44 changes: 44 additions & 0 deletions ffi/capi/dart/package/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
UNICODE LICENSE V3

COPYRIGHT AND PERMISSION NOTICE

Copyright © 2020-2023 Unicode, Inc.

NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.

Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.

THE DATA FILES AND SOFTWARE ARE 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 OF
THIRD PARTY RIGHTS.

IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.


Portions of ICU4X may have been adapted from ICU4C and/or ICU4J.
ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others.
16 changes: 16 additions & 0 deletions ffi/capi/dart/package/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Dart bindings for ICU4X
[![Docs](https://docs.rs/icu/badge.svg)](https://docs.rs/icu) [![Build Status](https://github.com/unicode-org/icu4x/actions/workflows/build-test.yml/badge.svg)](https://github.com/unicode-org/icu4x/actions) [![pub package](https://img.shields.io/pub/v/icu.svg)](https://pub.dev/packages/icu) [![package publisher](https://img.shields.io/pub/publisher/icu.svg)](https://pub.dev/packages/icu/publisher)
mosuem marked this conversation as resolved.
Show resolved Hide resolved

Experimental Dart bindings for ICU4X.

Example:

```dart
main() {
mosuem marked this conversation as resolved.
Show resolved Hide resolved
//TODO: Implement build.dart, `@Native` annotations, and compiled targets storage to remove this.
init(path.absolute('path/to/dynamic/library'));

final x = FixedDecimal.fromDoubleWithLowerMagnitude(1.49403, -7);
print(x); //prints '1.4940300'
}
```
9 changes: 5 additions & 4 deletions ffi/capi/dart/package/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: icu
version: 0.0.0
repository: https://github.com/unicode-org/icu4x
version: 0.1.0
description: Dart bindings for ICU4X.
repository: https://github.com/unicode-org/icu4x/tree/main/ffi/capi/dart/package

environment:
sdk: '>=2.18.0'

dependencies:
ffi: '>=1.1.0'
ffi: ^2.1.0
robertbastian marked this conversation as resolved.
Show resolved Hide resolved

dev_dependencies:
lints: ^2.0.0
lints: ^3.0.0
test: ^1.21.0
path: ^1.0.0
2 changes: 1 addition & 1 deletion tools/make/tidy.toml
mosuem marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exit_on_error true
glob_pattern_array = array "./**/*.rs" "./**/*.yml" "./**/*.toml" "./**/*.rst" "./**/*.bat" "./**/*.c" "./**/*.cpp"

# Skip the files matching these patterns.
glob_skip_pattern_array = array "**/target/**/*" "ffi/capi/**/docs/**/*" "**/node_modules/**/*" "**/data/**/*" "ffi/gn/vendor/**/*" "ffi/gn/third_party_tools/**/*" "ffi/capi/c/examples/fixeddecimal_tiny/baked_data/**/*"
glob_skip_pattern_array = array "**/target/**/*" "ffi/capi/**/docs/**/*" "**/node_modules/**/*" "**/data/**/*" "ffi/gn/vendor/**/*" "ffi/gn/third_party_tools/**/*" "ffi/capi/c/examples/fixeddecimal_tiny/baked_data/**/*" ".github/workflows/**/*"

blank_line = set ""

Expand Down
Loading