首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将自定义的单元引擎添加到arcanist中

如何将自定义的单元引擎添加到arcanist中
EN

Stack Overflow用户
提问于 2015-09-08 09:25:19
回答 1查看 670关注 0票数 0

我正在使用圆弧作为代码检查的工具。bin/弧线不在git中,但我想在git中添加一个测试引擎。因此,我在测试引擎中创建了测试引擎目录:

代码语言:javascript
复制
__phutil_library_init__.php
__phutil_library_map__.php,
src/PyEngine.php

the phutil_library_init.php:

代码语言:javascript
复制
    <?php

    phutil_register_library('PyEngine', __FILE__);

the __phutil_library_map__.php:

    phutil_register_library_map(array(
        '__library_version__' => 2,
        'class' =>
        array(
          'PyEngine' => 'src/PyEngine.php',
        ),
        'function' =>
        array(
        ),
        'xmap' =>
        array(
          'PyEngine' => 'ArcanistUnitTestEngine',
        ),
    ));

.arcconfig:

代码语言:javascript
复制
{
    "phabricator.uri" : "blabla",
    "load" : [
      "test-engine"
    ],
    "unit.engine" : "PyEngine"
}

但是当我运行弧形单元时,它会报告错误:

代码语言:javascript
复制
 phutil_register_library_map(array(
      '__library_version__' => 2,
      'class' =>
      array(
        'PyEngine' => 'src/PyEngine.php',
      ),
      'function' =>
      array(
      ),
      'xmap' =>
      array(
        'PyEngine' => 'ArcanistUnitTestEngine',
      ),
    ));[2015-09-08 09:11:55] ERROR 8: Undefined index: PyEngine at [~/Documents/codes/arcanist/libphutil/src/moduleutils/PhutilBootloader.php:136]
    PyEngine(head=dev, ref.master=fc7de2baac4e, ref.dev=615bad5693e1), arcanist(head=master, ref.master=968f4ae5d73e), phutil(head=master, ref.master=55f554b618b9)
      #0 PhutilBootloader::getLibraryMap(string) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:194]
      #1 PhutilSymbolLoader::selectAndLoadSymbols() called at [<phutil>/src/moduleutils/PhutilBootloader.php:78]
      #2 PhutilBootloader::registerLibrary(string, string) called at [<phutil>/src/moduleutils/core.php:4]
      #3 phutil_register_library(string, string) called at [<PyEngine>/__phutil_library_init__.php:3]
      #4 include_once(string) called at [<phutil>/src/moduleutils/PhutilBootloader.php:226]
      #5 PhutilBootloader::executeInclude(string) called at [<phutil>/src/moduleutils/PhutilBootloader.php:207]
      #6 PhutilBootloader::loadLibrary(string) called at [<phutil>/src/moduleutils/core.php:12]
      #7 phutil_load_library(string) called at [<arcanist>/scripts/arcanist.php:611]
      #8 arcanist_load_libraries(array, boolean, string, ArcanistWorkingCopyIdentity) called at [<arcanist>/scripts/arcanist.php:162]
    phutil_register_library_map(array(
      '__library_version__' => 2,
      'class' =>
      array(
        'PyEngine' => 'src/PyEngine.php',
      ),
      'function' =>
      array(
      ),
      'xmap' =>
      array(
        'PyEngine' => 'ArcanistUnitTestEngine',
      ),
    ));[2015-09-08 09:11:55] ERROR 8: Undefined index: PyEngine at [~/Documents/codes/arcanist/libphutil/src/moduleutils/PhutilBootloader.php:136]
    PyEngine(head=dev, ref.master=fc7de2baac4e, ref.dev=615bad5693e1), arcanist(head=master, ref.master=968f4ae5d73e), phutil(head=master, ref.master=55f554b618b9)
      #0 PhutilBootloader::getLibraryMap(string) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:194]
      #1 PhutilSymbolLoader::selectAndLoadSymbols() called at [<phutil>/src/__phutil_library_init__.php:22]
      #2 __phutil_autoload(string)
      #3 spl_autoload_call(string)
      #4 call_user_func_array(array, array) called at [<phutil>/src/console/format.php:7]
      #5 phutil_console_format(string, string) called at [<arcanist>/scripts/arcanist.php:413]
    [2015-09-08 09:11:55] EXCEPTION: (Exception) libphutil v1 libraries are no longer supported. at [<phutil>/src/moduleutils/PhutilBootloader.php:144]
    PyEngine(head=dev, ref.master=fc7de2baac4e, ref.dev=615bad5693e1), arcanist(head=master, ref.master=968f4ae5d73e), phutil(head=master, ref.master=55f554b618b9)
      #0 PhutilBootloader::getLibraryMap(string) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:194]
      #1 PhutilSymbolLoader::selectAndLoadSymbols() called at [<phutil>/src/__phutil_library_init__.php:22]
      #2 __phutil_autoload(string)
      #3 spl_autoload_call(string)
      #4 call_user_func_array(array, array) called at [<phutil>/src/console/format.php:7]
      #5 phutil_console_format(string, string) called at [<arcanist>/scripts/arcanist.php:413]

如何正确地添加单元引擎?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-23 09:51:21

在添加类之后,您是否再次运行了arc liberate (它最初是否用于创建库)?

您可以在这里获得一些信息(这还不是官方支持的):classes/

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32454007

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档