objd_cli 0.0.2

objD CLI #

The objD CLI is an additional package to handle execution, building and deploying of your project. To activate the global package(will be available anywhere on your system), run this command:

pub global activate objd_cli

This will add the commands to your console. To run a command run:

objd [command] [args]


pub global run objd:[command] [args]

If the objd command is not available, you have to add the pub cache to your system path. Follow this tutorial: https://www.dartlang.org/tools/pub/cmd/pub-global#running-a-script-from-your-path

Commands #

  • help - opens a help menu with all commands
  • new [project_name] - generates a new project from a boilerplate
  • run [project_root] - builds one project
  • serve [directory] [project_root] - watches the directory to change and builds the project on change
  • server inject [jar-file] - injects a server file(use bukkit with plugins to reload automatically) before starting the server(The file is not included in the package due to legal reasons)
  • server start [world_dir] - copies the world into the server directory and starts the server

Build Options #

You can use certain arguments to pass options to the build methods. This argument list can directly be edited in createProject:

	["arg1","arg2", ... ] // arguments as optional List

OR (what I recommend) you can just take the program arguments from main:

void main(List<String> args) {

This allows you to use the arguments in the execution command, like:

  • dart index.dart arg1 --min
  • objd run index.dart arg1 --min
  • objd serve . index.dart --min

All Available Arguments:

  • --hotreload: Saves the state of your project and compares just the latest changes.
  • --full: Generates the full project(just for objd serve!).
  • --min: This minifies the file amount by ignoring the mcmeta and tag files
  • --prod: This creates a production build of your project and saves it into another datapack((prod) added). In Production Comments and line breaks are removed and every widget can access the prod value in Context to get notified.
  • --debug: This creates a debug json file in your project root, that lists all properties and other generated files

Hotreload #

The hotreload option is an experimental feature, that just looks at the things you changed since the last build. This can improve performance significantly especially for big projects with many generated mcfunctions.

This feature is enabled by default for objd serve, if you include the args. You can disable it with the -full option.

How it works:

objD saves a representation of your project in the objd.json file of your project. For each new build or reload it checks which parts of the project you changed and just generates the new necessary files to implement your change in the datapack.

0.0.2 #

  • added zip options in the help menu

0.0.1 #

  • added Documentation
  • added hotreload shortcut -r
  • added proper version display with ascii logo

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate objd_cli

2. Use it

The package has the following executables:

$ objd

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  objd_cli: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:objd_cli/cli/build.dart';
import 'package:objd_cli/cli/new.dart';
import 'package:objd_cli/cli/run.dart';
import 'package:objd_cli/cli/serve.dart';
import 'package:objd_cli/cli/server.dart';
import 'package:objd_cli/server.dart';
import 'package:objd_cli/utils/copy.dart';
import 'package:objd_cli/utils/run_command.dart';
import 'package:objd_cli/utils/start_server.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix bin/objd.dart. (-1 points)

Analysis of bin/objd.dart reported 2 hints:

line 10 col 31: Unnecessary new keyword.

line 68 col 30: DO use curly braces for all flow control structures.

Fix lib/cli/run.dart. (-0.50 points)

Analysis of lib/cli/run.dart reported 1 hint:

line 6 col 7: Use isEmpty instead of length

Format lib/cli/build.dart.

Run dartfmt to format lib/cli/build.dart.

Fix additional 7 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/cli/new.dart (Run dartfmt to format lib/cli/new.dart.)
  • lib/cli/serve.dart (Run dartfmt to format lib/cli/serve.dart.)
  • lib/cli/server.dart (Run dartfmt to format lib/cli/server.dart.)
  • lib/server.dart (Run dartfmt to format lib/server.dart.)
  • lib/utils/copy.dart (Run dartfmt to format lib/utils/copy.dart.)
  • lib/utils/run_command.dart (Run dartfmt to format lib/utils/run_command.dart.)
  • lib/utils/start_server.dart (Run dartfmt to format lib/utils/start_server.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and objd_cli.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
args ^1.5.2 1.5.2
http ^0.12.0+2 0.12.0+4
watcher ^0.9.7+12 0.9.7+13
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6