wangyuheng / Arc

GraphQL and Dgraph for DDD
MIT License
34 stars 12 forks source link

Arc Maven Plugin #52

Closed wangyuheng closed 3 years ago

wangyuheng commented 3 years ago

close #51

Maven 插件, 方便使用Arc. 目前支持的功能

使用

添加maven插件

<build>
    <plugins>
        <plugin>
            <groupId>com.github.yituhealthcare</groupId>
            <artifactId>arc-maven-plugin</artifactId>
            <version>1.4.0-SNAPSHOT</version>
        </plugin>
    </plugins>
</build>

Generator

生成java code + dgraph

mvn arc:generate

或者

mvn arc:generate -Dtarget=all

只生成java code

mvn arc:generate -Dtarget=java

只生成dgraph schema

mvn arc:generate -Dtarget=dgraph

Generator配置文件

默认路径 classpath: arc-generator.json 可以在 maven plugin 中指定

<plugin>
    <groupId>com.github.yituhealthcare</groupId>
    <artifactId>arc-maven-plugin</artifactId>
    <version>1.4.0-SNAPSHOT</version>
    <configuration>
        <configJson>${basedir}/src/main/resources/arc-generator.json</configJson>
    </configuration>
</plugin>

参考配置

{
  "basePackage": "com.github.yituhealthcare.arcgeneratorsample",
  "dropAll": false,
  "genStrategies": [
    {
      "codeGenOperation": "OVERRIDE",
      "codeGenType": "TYPE"
    },
    {
      "codeGenOperation": "OVERRIDE",
      "codeGenType": "API"
    }
  ],
  "ignoreJavaFileNames": [
    "User"
  ],
  "dgraphPath": "dgraph/schema.dgraph"
}
codecov[bot] commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (release/1.4.0@6d0e00e). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##             release/1.4.0      #52   +/-   ##
================================================
  Coverage                 ?   63.18%           
  Complexity               ?       49           
================================================
  Files                    ?      112           
  Lines                    ?     2241           
  Branches                 ?      160           
================================================
  Hits                     ?     1416           
  Misses                   ?      746           
  Partials                 ?       79           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6d0e00e...676838e. Read the comment docs.