Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
lexaknyazev committed Oct 21, 2024
1 parent fbafbb7 commit f11b98b
Showing 1 changed file with 53 additions and 14 deletions.
67 changes: 53 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# glTF-Validator

<p align="center">
<img src="web/logos/glTF_RGB_June16.svg" alt="" height="250"/>
<img src="web/logos/glTF_RGB_June16.svg" alt="" height="125"/>
</p>

# glTF-Validator

[![Build Status](https://github.com/KhronosGroup/glTF-Validator/workflows/CI/badge.svg)](https://github.com/KhronosGroup/glTF-Validator/actions?query=workflow%3ACI)

Tool to validate [glTF](https://github.com/KhronosGroup/glTF) assets.
Expand All @@ -24,7 +24,7 @@ NuGet package [Third-party contribution]: https://www.nuget.org/packages/GltfVal
- Asset description validation
- All properties and their types from JSON-Schemas (including implicit limitations on valid values).
- Validity and compatibility of internal references.
- Correctness of `Data URI` encoding.
- Correctness of Data URI encoding.
- Binary buffers validation
- Forbidden or incorrect accessor values (e.g., `NaN`, invalid quaternions, indecomposable matrices, etc).
- `accessor.min` and `accessor.max` values.
Expand Down Expand Up @@ -58,8 +58,9 @@ NuGet package [Third-party contribution]: https://www.nuget.org/packages/GltfVal

You can use hosted [web front-end tool](https://github.khronos.org/glTF-Validator). It works completely in the browser without any server-side processing.

#### Command Line Tool Usage
```
### Command Line Tool Usage

```text
Usage: gltf_validator [<options>] <input>
Validation report will be written to `<asset_filename>.report.json`.
Expand All @@ -82,48 +83,86 @@ Shell return code will be non-zero if at least one error was found.
## Building

### Prerequisites

1. Download and install [Dart SDK](https://dart.dev/tools/sdk/archive) for your platform.
2. Add Dart SDK `bin` folder to your PATH.
3. From the repository root folder, run `dart pub get` to get dependencies.
2. Add Dart SDK `bin` directory to your PATH.
3. From the repository root directory, run `dart pub get` to get dependencies.

#### Fetching dependencies from behind a corporate firewall

`dart pub get` downloads dependencies from Google's `pub.dev` server over HTTPS. If you need to specify a proxy, follow these steps:

1. Set `https_proxy` or `HTTPS_PROXY` environment variable in form `hostname:port`.
2. If the proxy requires credentials, use this syntax: `username:password@hostname:port`.

`dart pub get` validates server's SSL certificate. If your corporate network interferes with SSL connections, follow these steps to get it running.

1. Save your corporate self-signed root certificate as X.509 file.
2. (Linux only) Try to add your cert to `/etc/pki/tls/certs/ca-bundle.crt` or `/etc/ssl/certs`.
3. If that doesn't work or if you're on Windows, add environment variable `DART_VM_OPTIONS` with value `--root-certs-file=<cert_file>`.

After doing this, `dart pub get` should be able to download dependencies successfully.

#### Clearing Caches

In rare cases, you may encounter various build issues usually caused by previously cached artifacts and/or packages. To clear all caches and re-download the dependencies, do the following steps:

1. Remove the `.dart_tool` directory and the `pubspec.lock` file from the project root directory.
2. Run `dart pub cache clean --force`.
3. Run `dart pub get`.

### Drag-n-Drop Web Tool
To build a drag-n-drop online validation tool (as hosted [here](https://github.khronos.org/glTF-Validator/)), follow these steps after installation:

To build the drag-n-drop online validation tool (as hosted [here](https://github.khronos.org/glTF-Validator/)), follow these steps after installation:

1. Run `dart run grinder web`.
2. All needed files will be written to `build/web` directory.

To build and package the drag-n-drop online validation tool, follow these steps after installation:

1. Run `dart run grinder web-archive`.
2. An archive will be written to the `build/gltf_validator-VERSION-web.zip` file.

### CLI tool

To build the CLI tool, follow these steps after installation:

1. Run `dart run grinder exe`.
2. Native executable file will be written to `build/bin/gltf_validator` or `build/bin/gltf_validator.exe`.
2. Native executable file will be written to `build/bin/gltf_validator` (Linux and macOS) or `build/bin/gltf_validator.exe` (Windows).

To build and package the CLI tool, follow these steps after installation:

1. Run `dart run grinder exe-archive`.
2. An archive will be written to the `build/gltf_validator-VERSION-PLATFORM.tar.xz` (Linux and macOS) or `build/gltf_validator-VERSION-PLATFORM.zip` (Windows) file.

### NPM Package

To build an npm package for use in Node.js environment, follow these steps after installation:

1. Run `dart run grinder npm`.
2. `gltf-validator` npm package will be written to `build/node`.

Refer to the [npm package documentation](https://www.npmjs.com/package/gltf-validator) for additional information.

#### Publishing

To publish an npm package, follow these steps after installation:

1. Run `dart run grinder npm-publish`.
2. `gltf-validator` npm package will be built to `build/node` and published to npm registry using `npm publish`.

### Post-Build Steps
1. To auto-format all source files, from the root folder run: `dart format --fix .`
2. To run the tests, use: `dart test`

### Validation Issues List

To generate [ISSUES.md](ISSUES.md), follow these steps after installation:

1. Run `dart run grinder issues`.
2. `ISSUES.md` file will be written to the repo root.

## Contributing

Before making a pull request do the following steps:

1. Run `dart format .` (note the dot) to format all source files.
2. Run `dart analyze` to check that there are no analyzer issues.
3. Run `dart test` to check that the tests pass.
4. Run `dart run grinder all` to check that all targets build.

0 comments on commit f11b98b

Please sign in to comment.