Code Monkey home page Code Monkey logo

gradle-thrift-plugin's Introduction

gradle-thrift-plugin

Put your thrift files in src/main/thrift.

Configuration example:

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'thrift'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'co.tomlee.gradle.plugins:gradle-thrift-plugin:0.0.6'
    }
}

repositories {
    mavenCentral()
}

dependencies {
    //
    // adjust for your Thrift version ...
    //
    compile 'org.apache.thrift:libthrift:0.9.1'
}

generateThriftSource {
    //
    // The output directory (optional)
    //
    out file('build/generated-src/thrift/main')

    //
    // -verbose / -debug / -strict (all optional)
    //
    verbose false
    debug false
    strict false

    //
    // Modify the include path (optional)
    //
    path file('vendor/thrift')

    //
    // Set the thrift executable (optional)
    //
    executable '/usr/bin/thrift'

    generators {
        //
        // --gen java:hashcode,beans
        //
        java {
            //
            // Options passed to the `java` generator
            //
            option 'hashcode'
            option 'beans'
        }

        //
        // --gen go
        //
        go {
            //
            // Output directory can be set on a per-generator basis too
            //
            out file('build/generated-src/thrift/go-main')
        }

        //
        // --gen js
        //
        js {
            out file('build/generated-src/thrift/js')
        }

        //
        // --gen js:node
        //
        'js:node' {
            out file('build/generated-src/thrift/node')
        }
    }
}

//
// optional: add generated sources as a source directory in IDEA
//
idea.module.excludeDirs = []
idea.module.sourceDirs += file('build/generated-src/thrift/main')
idea.module.jdkName = '1.8'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.