++ed by:
HAMMER KRAUTCAT BRTASTIC ASB XYF
10 non-PAUSE users
Author image Yuki Kimoto

Name

SPVM::Builder::API - SPVM Builder Public APIs

Usage

  # Builder API
  my $api = SPVM::Builder::API->new(
    build_dir => '.spvm_build',
  );
  
  # Compile SPVM
  my $success = $api->compile_spvm('MyLib');
  unless ($success) {
    # Error message
    my $error_messages = $self->get_error_messages;
    for my $error_message (@$error_messages) {
      printf STDERR "[CompileError]$error_message\n";
    }
    exit 255;
  }
  
  # Class names
  my $class_names = $api->get_class_names;
  
  for my $class_name (@$class_names) {
    # Method names
    my $method_names = $api->get_method_names($class_name);
    for my $method_name (@$method_names) {
      print "$class_name->$method_name\n";
    }
  }
  

Description

SPVM::Builder::API is the public APIs of SPVM Builder.

SPVM::Builder is a private modules of SPVM.

The names and arguments of the methods are changed without warnings in the future release.

However, the methods is useful to get the information of SPVM modules.

SPVM::Builder::API provides the public APIs to call the methods. These APIs is public and stable.

Methods

new

  # Builder API
  my $api = SPVM::Builder::API->new;

Create SPVM::Builder::API object.

Options:

  • build_dir

    Build directory.

compile_spvm

  # Compile SPVM
  my $success = $api->compile_spvm('MyLib');

Compile SPVM module. If succeeded, return true value, otherwise false value.

get_error_messages

  # Error message
  my $error_messages = $self->get_error_messages;

Get error messages of the compililation as array reference.

get_class_names

  # Class names
  my $class_names = $api->get_class_names;

Get class names as array reference.

get_method_names

  # Method names
  my $method_names = $api->get_method_names($class_name);

Get method names as array reference.

build_dynamic_lib_dist_precompile

  $api->build_dynamic_lib_dist_precompile($class_name)

Build a precompile dymamic library and copy it to blib/lib.

build_dynamic_lib_dist_native

  $api->build_dynamic_lib_dist_native($class_name)

Build a native dynamic library and copy it into blib/lib.

build_shared_lib_dist_precompile

  $api->build_shared_lib_dist_precompile($class_name)

Same as "build_dynamic_lib_dist_precompile". Remained for backwards compatibility.

build_shared_lib_dist_native

  $api->build_shared_lib_dist_native($class_name)

Same as "build_dynamic_lib_dist_native". Remained for backwards compatibility.