GithubHelp home page GithubHelp logo

jmerle / gulp-java-merger Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 48 KB

A gulp plugin to make it easy to merge multiple .java files into one.

License: MIT License

JavaScript 88.95% Java 11.05%
gulp-plugins java-files

gulp-java-merger's Introduction

Gulp Java Merger

npm

A gulp plugin to make it easy to merge multiple .java files into one, aswell as automatically removing 'public' from class declarations (one .java file can't have multiple public classes/enumerations/interfaces) and making sure there are no duplicate imports.

Install

Install with npm.

npm install --save-dev gulp-java-merger

Example

var merge = require('gulp-java-merger');

gulp.task('default', function() {
    gulp.src('input/*.java')
        .pipe(merge('merged.java', {
            publicMain: true
        }))
        .pipe(gulp.dest('output/')); 
});

Usage

merge(fileName, options)

  • fileName: The name of the generated file.
  • options
    • publicMain (default: false): Make all classes containing a public static void main method public.
    • removePackage (default: false): Remove the package line on-top of the file.

A few things

  • Only works for a single package (i.e. you can't merge two packages into one bundled file).
  • Assumes all files have only one class/enum/interface in it (not counting inner classes).

Note that this is not meant for production code. It's originally made to merge Java bot code in CodinGame contests.

gulp-java-merger's People

Contributors

jmerle avatar

Watchers

 avatar  avatar

Forkers

likhith4444

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.