jb 0.6.0 copy "jb: ^0.6.0" to clipboard
jb: ^0.6.0 copied to clipboard

JBuild front-end. A modern Java build system that leverages Dartle to make building Java projects easy.

example/jb.dart

import 'package:dartle/dartle.dart';
import 'package:jb/jb.dart';

/// jb is meant to be used directly as a CLI tool to build Java projects.
/// However, it is possible to use it also as a Dart library.
///
/// This example shows how a [JbDartle] object can be created, which can
/// then be used to integrate it with a standard Dartle project.
///
/// As a configuration object is created from a const Map, this program can be
/// executed in any directory without the `jbuild.yaml` file, unlike the
/// "official" CLI utility. It looks for Java source code to compile in the
/// `src` directory. As the config object does not specify anything else,
/// the default options are used, which means a jar file is created with the
/// name of the working directory.
Future<void> main(List<String> args) async {
  final stopwatch = Stopwatch()..start();

  final config = await loadConfigString('''
    source-dirs: [ src ]
    resource-dirs: [ res ]
  ''');

  final jbOptions = JbCliOptions.parseArgs(args);
  final dartleOptions = parseOptions(jbOptions.dartleArgs);

  activateLogging(dartleOptions.logLevel,
      colorfulLog: dartleOptions.colorfulLog, logName: 'jbuild');

  final buildRan = await runJb(
      jbOptions, dartleOptions, stopwatch, InstanceConfigSource(config));
  if (buildRan) {
    logger.info(ColoredLogMessage(
        'jb completed successfully in ${stopwatch.elapsed}!', LogColor.green));
  }
}
0
likes
150
pub points
0%
popularity

Publisher

unverified uploader

JBuild front-end. A modern Java build system that leverages Dartle to make building Java projects easy.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

actors, archive, args, collection, conveniently, crypto, dartle, file, io, isolate_current_directory, logging, path, schemake, structured_async, xml, yaml

More

Packages that depend on jb