Skip to content

Latest commit

 

History

History
122 lines (74 loc) · 4.68 KB

README_ZH.md

File metadata and controls

122 lines (74 loc) · 4.68 KB

HMS Toolkit Convertor

License Apache-2.0

中文 | English

内容列表

简介

Convertor工具是为开发者提供的代码转换工具,支持Java和Kotlin工程。可以帮助开发者将应用程序调用GMS(Google Mobile Services)相关的API接口自动转换为HMS相对应的API接口,实现快速转换和集成HMS的能力。HMS Convertor提供如下功能:

  • New Conversion:实现应用调用GMS的API接口到HMS对应API接口的自动转换。

  • Open Last Conversion:打开上一次转换结果。

  • Save All:即时保存当前工程以及转换信息。

  • Restore Project:使用备份文件恢复工程。

构建

依赖

基本要求:

  • Gradle(>= 5.2.1)
  • JDK(>= 8)

运行 git clone命令下载代码,切换至Convertor/src文件夹,运行以下命令:

$ ./gradlew -p IDE/intellij-plugin buildPlugin

构建完成后,切换至 Convertor/src/IDE/intellij-plugin/build/distributions 文件夹获取.zip格式压缩包。

安装

启动IDEA或者Android Studio单击左上菜单栏,选择 File -> Settings -> Plugins -> Install Plugin from Disk

avatar

选中构建产生的ZIP压缩包。

提示:

您可以使用以下命令在沙箱中调试插件 :

$ ./gradlew -p IDE/intellij-plugin runIde

获取更详细的信息,可以点击使用说明

运行和调试

  1. 运行 git clone命令下载代码
git clone https://github.com/HMS-Core/hms-toolkit-convertor.git

2, 如果希望调用 IntelliJ,在菜单栏,前往 File>Open.. 并打开项目中的 src 文件夹 3. 打开文件 build.gradle 并找到属性 alternativeIdePath ,之后清空内部值,然后设置 intellij IDE 的安装路径。 intellij IDE 将会在 (in this case android studio)中打开。

 intellij {

        // [...] 
        
         /**
         * Uncomment this for Debugging the plugin on Android Studio directly from the IDE (launches in a separate window/instance)
         * From the menu bar: Run>Run (launches instances with plugin installed) or Run>Debug (debug mode)
         *
         * In this case, we are setting the android studio install path, another IDE/path can be used as well.
        .*/
        // alternativeIdePath '/C://Program Files/Android/Android Studio'
        
        
        // [...] 
 }

  1. 在 位于 gradle的 toolwindow,点击图标 "Reload all Gradle Projects"
  2. 现在您可以点击运行,方式为点击 Run>Run (在插件安装的条件下运行) 或者Run>Debug (安全模式)

代码贡献

要对Convertor项目贡献代码,请遵循以下步骤:

  1. 从GitHub上Fork本项目;
  2. Clone项目代码至你的机器;
  3. Commit你的个人分支上的变更;
  4. Push你的变更至你fork的远程代码仓;
  5. 提交一个Pull request确保我们可以审视你的变更;

注意:在发出拉取请求之前,一定要将“上游”的最新数据合并!

技术支持

如果您对HMS Core还处于评估阶段,可在Reddit社区获取关于HMS Core的最新讯息,并与其他开发者交流见解。

如果您对使用HMS示例代码有疑问,请尝试:

  • 开发过程遇到问题上Stack Overflow,在huawei-mobile-services标签下提问,有华为研发专家在线一对一解决您的问题。
  • 华为开发者论坛 HMS Core板块与其他开发者进行交流。

如果您在尝试示例代码中遇到问题,请向仓库提交issue,也欢迎您提交Pull Request

许可证

此示例代码已获得Apache License version 2.0