File Coverage

blib/lib/SPVM/Builder/Util/API.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 6 66.6
pod 3 3 100.0
total 17 21 80.9


line stmt bran cond sub pod time code
1             package SPVM::Builder::Util::API;
2              
3 280     280   2186 use strict;
  280         677  
  280         13196  
4 280     280   2898 use warnings;
  280         1891  
  280         10063  
5 280     280   2871 use SPVM::Builder::Util;
  280         650  
  280         32229  
6              
7 0     0 1 0 sub create_make_rule_native { SPVM::Builder::Util::create_make_rule_native(@_) }
8              
9 0     0 1 0 sub create_make_rule_precompile { SPVM::Builder::Util::create_make_rule_precompile(@_) }
10              
11 315     315 1 1688 sub create_default_config { SPVM::Builder::Util::create_default_config(@_) }
12              
13             1;
14              
15             =head1 Name
16              
17             SPVM::Builder::Util::API - Defining Public Functions of SPVM::Builder::Util
18              
19             =head1 Description
20              
21             The SPVM::Builder::Util::API class defines the public functions of the L class.
22              
23             =head1 Usage
24              
25             my $native_make_rule = SPVM::Builder::Util::API::create_make_rule_native('Foo');
26            
27             my $precompile_make_rule = SPVM::Builder::Util::API::create_make_rule_precompile('Foo');
28              
29             =head1 Functions
30              
31             =head2 create_make_rule_native
32              
33             my $make_rule = SPVM::Builder::Util::API::create_make_rule_native($basic_type_name);
34              
35             Creates a rule written by C commands to generate a dynamic library for the class $basic_type_name that contains native methods, and returns the rule.
36              
37             Examples:
38              
39             # Makefile.PL
40             sub MY::postamble {
41            
42             my $make_rule = '';
43            
44             # Native compile make rule
45             $make_rule .= SPVM::Builder::Util::API::create_make_rule_native('Foo');
46            
47             return $make_rule;
48             }
49              
50             =head2 create_make_rule_precompile
51              
52             my $make_rule = SPVM::Builder::Util::API::create_make_rule_precompile($basic_type_name);
53              
54             Creates a rule written by C commands to generate a dynamic library for the class $basic_type_name that contains precompiled methods, and returns the rule.
55              
56             Examples:
57              
58             # Makefile.PL
59             sub MY::postamble {
60            
61             my $make_rule = '';
62            
63             # Precompile make rule
64             $make_rule .= SPVM::Builder::Util::API::create_make_rule_precompile('Foo');
65            
66             return $make_rule;
67             }
68              
69             =head2 create_default_config
70              
71             my $config = SPVM::Builder::Util::API::create_default_config();
72              
73             Creates a default config, and returns it. The config is a L object.
74              
75             The current implementation is the following one.
76              
77             my $config = SPVM::Builder::Config->new_gnu99(file_optional => 1);
78              
79             =head1 Copyright & License
80              
81             Copyright (c) 2023 Yuki Kimoto
82              
83             MIT License