• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

jruyi/thrift-gradle-plugin: A gradle plugin for compiling Thrift IDL files using ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

jruyi/thrift-gradle-plugin

开源软件地址(OpenSource Url):

https://github.com/jruyi/thrift-gradle-plugin

开源编程语言(OpenSource Language):

Groovy 90.4%

开源软件介绍(OpenSource Introduction):

Gradle Thrift Plugin

Gradle Thrift Plugin uses thrift compiler to compile Thrift IDL files.

Usage

To use this plugin, add the following to your build script.

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.2"
    }
}

apply plugin: "org.jruyi.thrift"

Or for Gradle 2.1+:

plugins {
    id "org.jruyi.thrift" version "0.4.2"
}

Example

See the examples/test2 directory for a very simple example.

Implicitly Applied Plugins

None.

Tasks

The Thrift plugin adds compileThrift task which compiles Thrift IDL files using thrift compiler.

Table-1 Task Properties of compileThrift
Task Property Type Default Value
thriftExecutable String thrift
sourceDir File projectDir/src/main/thrift
sourceItems Object... projectDir/src/main/thrift
outputDir File buildDir/generated-sources/thrift
includeDirs Set []
generators Map<String, String> ['java':''] if JavaPlugin is applied, otherwise []
nowarn boolean false
strict boolean false
verbose boolean false
recurse boolean false
debug boolean false
allowNegKeys boolean false
allow64bitsConsts boolean false
createGenFolder boolean true

If createGenFolder is set to false, no gen-* folder will be created.

sourceDir is only used for backward compatibility

sourceItems are a set of sources, which will be used for generating java files from thrift. A source can either be a path specified as a string or a file. In case a source is a relative path the source will be relative to srcDir. In case a source is a directory, the directory will be scanned recursively for *.thrift files and used.

Example
compileThrift {
    recurse true

    generator 'html'
    generator 'java', 'private-members'
}

Default Behaviors

When JavaPlugin is applied, generator 'java' will be created and the generated java code will be added to Java source automatically.

Using Thrift on Travis

Ubuntu 14.04 (Trusty) provides Thrift 0.9.0. If this version fits your requirements, you can use the following .travis.yml configuration file:

language: java
dist: trusty
sudo: required
before_install:
  - sudo apt-get install thrift-compiler
script:
  - ./gradlew check
  - ./gradlew assemble

License

Gradle Thrift Plugin is licensed under the Apache License, Version 2.0.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap