Skip to content

Commit

Permalink
Add readme and license
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone committed May 16, 2023
1 parent 26c5839 commit 46c11a3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
26 changes: 26 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2018-2022 Ruffle LLC <[email protected]> and Ruffle contributors
(https://github.com/ruffle-rs/api-report/graphs/contributors)

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS 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. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# API Report

This is a tool used to generate a progress report from two given API states, a 'specification' and an 'implementation'.

[Ruffle](https://github.com/ruffle-rs/ruffle/) uses this to create their automatic Flash AVM2 progress report,
[as seen on their website](https://ruffle.rs/avm2.html).

## Building from source

[Follow the official guide](https://www.rust-lang.org/tools/install) to install Rust for your platform.

Then simply `cargo build --release` to build the binary,
or in the instructions below replace `avm_report` with `cargo run --` to run the tool directly.

## Usage

To see the full help info, run `avm_report --help`.

You'll need two files, a `specification` that describes the API and an `implementation` that describes the current state
of the API implemented. We provide an AVM2 specification in the repo for Ruffle's own use.

Run `avm_report -s specification.json -i implementation.json -o report.json`.

## Specification / Implementation format

If you read Rust, there's a general view of the structure over at [src/specification.rs](src/specification.rs).

## Report format

This tool quanitifies progress with a points system:
- Any "item" in `specification` is worth 1 point. If it's a function or a class or a field, doesn't matter. This is totalled in `max_points`.
- If an item from `specification` exists in `implementation`, you gain a point in `impl_points`.
- If that same item is marked as a "stub" in `implementation`, you gain a point in `stub_penalty`.

To calculate a percentage, it's `impl_points / max_points` to see what exists, or `(impl_points - stub_penalty) / max_points` to see what's actually **done**.

This allows you to show the stubs differently on a progress bar, for example.

0 comments on commit 46c11a3

Please sign in to comment.