All Projects → eriwen → Gradle Js Plugin

eriwen / Gradle Js Plugin

Licence: apache-2.0
Gradle plugin for working with JS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gradle Js Plugin

Gradle Nexus Plugin
Gradle plugin for configuring and uploading artifacts to Sonatype Nexus
Stars: ✭ 284 (-24.47%)
Mutual labels:  gradle-plugin
Gradle Android Junit Jacoco Plugin
Gradle plugin that generates JaCoCo reports from an Android Gradle Project
Stars: ✭ 315 (-16.22%)
Mutual labels:  gradle-plugin
Gradle Android Ribbonizer Plugin
Modifies launcher icons on debug build
Stars: ✭ 350 (-6.91%)
Mutual labels:  gradle-plugin
Androidlife
📔 CaMnter's android learning life and footprint.
Stars: ✭ 293 (-22.07%)
Mutual labels:  gradle-plugin
Unmock Plugin
Gradle plugin to be used in combination with the new unit testing feature of the Gradle Plugin / Android Studio to use real classes for e.g. SparseArray.
Stars: ✭ 304 (-19.15%)
Mutual labels:  gradle-plugin
Booster
🚀Optimizer for mobile applications
Stars: ✭ 3,741 (+894.95%)
Mutual labels:  gradle-plugin
Gradle Unused Resources Remover Plugin
Gradle Plugin that removes unused resources in Android projects.
Stars: ✭ 282 (-25%)
Mutual labels:  gradle-plugin
Calces Gradle Plugin
Android构建工具集:包含快速实现组件化构建脚本,快速实现屏幕最小宽度适配脚本
Stars: ✭ 366 (-2.66%)
Mutual labels:  gradle-plugin
Paranoid
String obfuscator for Android applications.
Stars: ✭ 314 (-16.49%)
Mutual labels:  gradle-plugin
Gradle Android Command Plugin
Handy commands for testing Android on CI
Stars: ✭ 349 (-7.18%)
Mutual labels:  gradle-plugin
Fat Aar Plugin
[DEPRECATED]A gradle plugin that helps to output fat aar from android library
Stars: ✭ 297 (-21.01%)
Mutual labels:  gradle-plugin
Gradle Apt Plugin
[OBSOLETE] Gradle plugin making it easier/safer to use Java annotation processors
Stars: ✭ 299 (-20.48%)
Mutual labels:  gradle-plugin
Swagger Gradle Codegen
💫 A Gradle Plugin to generate your networking code from Swagger
Stars: ✭ 330 (-12.23%)
Mutual labels:  gradle-plugin
Javapackager
📦 Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.
Stars: ✭ 285 (-24.2%)
Mutual labels:  gradle-plugin
Gradle Errorprone Plugin V0.0.x
Gradle plugin to use the error-prone compiler for Java
Stars: ✭ 351 (-6.65%)
Mutual labels:  gradle-plugin
Gradle Code Quality Tools Plugin
Gradle plugin that generates ErrorProne, Findbugs, Checkstyle, PMD, CPD, Lint, Detekt & Ktlint Tasks for every subproject.
Stars: ✭ 282 (-25%)
Mutual labels:  gradle-plugin
Android Gradle Aspectj
gradle plug-in adding supports of AspectJ into Android project
Stars: ✭ 323 (-14.1%)
Mutual labels:  gradle-plugin
Axion Release Plugin
Gradle release & version management plugin.
Stars: ✭ 372 (-1.06%)
Mutual labels:  gradle-plugin
Detekt
Static code analysis for Kotlin
Stars: ✭ 4,169 (+1008.78%)
Mutual labels:  gradle-plugin
Gradle Play Publisher
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
Stars: ✭ 3,690 (+881.38%)
Mutual labels:  gradle-plugin

Gradle Javascript Plugin! Build Status

Aiming to be the simplest way to manage your JavaScript in a build.

Quick Start

Wrangling your JS in a Gradle build is easy! Just add this to your build.gradle file:

Gradle 2.1+

plugins {
  id "com.eriwen.gradle.js" version "2.14.1"
}

Gradle 2.0-

buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath "com.eriwen:gradle-js-plugin:1.12.1"
  }
}

apply plugin: "com.eriwen.gradle.js"
// Declare your sources
javascript.source {
    dev {
        js {
            srcDir jsSrcDir
            include "*.js"
            exclude "*.min.js"
        }
    }
    prod {
        js {
            srcDir jsSrcDir
            include "*.min.js"
        }
    }
}

Combining Files (options)

// Configure the built-in task
combineJs {
    encoding = "UTF-8"
    source = javascript.source.dev.js.files
    dest = file("${buildDir}/all.js")
}

// Create new CombineJsTasks if you have multiple sets of JS files
task jsDev(type: com.eriwen.gradle.js.tasks.CombineJsTask) {
    source = ["${projectDir}/js/file1.js", "${projectDir}/js/file2.js"]
    dest = file("${buildDir}/all-debug.js")
}

task jsProd(type: com.eriwen.gradle.js.tasks.CombineJsTask) {
    source = ["${projectDir}/js/file1.js", "${projectDir}/js/file2.js"]
    dest = file("${buildDir}/all.js")
}

Minifying files with options)

minifyJs {
    source = combineJs
    dest = file("${buildDir}/all-min.js")
    sourceMap = file("${buildDir}/all.sourcemap.json")
    closure {
        warningLevel = 'QUIET'
    }
}

GZip JS (options)

gzipJs {
    source = minifyjs
    dest = file("${buildDir}/all-min.js")
}

options)

jshint {
    source = javascript.source.dev.js.files
    dest = file("${buildDir}/jshint.out")
    reporter = 'checkstyle'
    jshint.options = [expr: "true", unused: "true"]
}

options)

jsdoc {
    source = ["${projectDir}/js/file1.js", "${projectDir}/js/file2.js"]
    destinationDir = file("${buildDir}/jsdoc")
}

options)

props2js {
    source = file("${projectDir}/src/test/resources/test.properties")
    dest = file("${buildDir}/props.jsonp")
    props {
        type = 'jsonp'
        functionName = 'fn'
    }
}

options)

requireJs {
    source = javascript.source.dev.js.files
    dest = file("${buildDir}/out.js")
    requirejs.buildprofile = new File("src/main/resources/requirejs-config.js")
}

Built-in Tasks and Options

combineJs

  • source = Collection of file paths of files to merge
  • dest = File for combined output

minifyJs (Uses the Google Closure Compiler)

  • source = File to minify
  • dest = File for minified output
  • (Optional) sourcemap = Source map file
  • (Optional) closure.compilationLevel = 'WHITESPACE_ONLY', 'SIMPLE_OPTIMIZATIONS' (default), or 'ADVANCED_OPTIMIZATIONS' (are you hardcore?)
  • (Optional) closure.warningLevel = 'QUIET', 'DEFAULT' (default), or 'VERBOSE'
  • (Optional) closure.compilerOptions = CompilerOptions object
  • (Optional) closure.externs = FileCollection object

gzipJs

  • source = File to compress
  • dest = File for compressed output

jshint

  • source = Files to assess with JSHint
  • dest = File for JSHint output
  • (Optional) reporter = Only 'checkstyle' supported right now. Defaults to plain JSHint output.
  • (Optional) ignoreExitCode = Fail build if false and jshint finds problems. Default is true.
  • (Optional) outputToStdOut = true will output to STDOUT instead of file. Default is false.
  • (Optional) jshint.options = Map of options (e.g. [expr: "true", unused: "true"])
  • (Optional) jshint.predef = Map of predefined globals so JSHint doesn't complain about them

jsdoc

  • source = Files to generate documentation for
  • destinationDir = Directory path to put JSDoc output
  • (Optional) options.options = []
JSDoc 3 options:
-t or --template <value> The name of the template to use. Default: the "default" template
-c or --configure <value> The path to the configuration file. Default: jsdoc __dirname + /conf.json
-e or --encoding <value> Assume this encoding when reading all source files. Default: utf-8
-T or --test Run all tests and quit.
-d or --destination <value> The path to the output folder. Use "console" to dump data to the console. Default: console
-p or --private Display symbols marked with the @private tag. Default: false.
-r or --recurse Recurse into subdirectories when scanning for source code files.
-h or --help Print this message and quit.
-X or --explain Dump all found doclet internals to console and quit.
-q or --query <value> Provide a querystring to define custom variable names/values to add to the options hash.
-u or --tutorials <value> Directory in which JSDoc should search for tutorials.

props2js

  • source = Properties file to process
  • dest = Destination file for output
  • props.type = One of: 'js', 'json', or 'jsonp'
  • (Optional) props.functionName = Function name to wrap JSONP

requireJs

  • source = Source JS files
  • dest = Output JS file
  • (Must declare this or requirejs.options) requirejs.buildprofile = File reference for config example
  • requirejs.options = Map of options require.js docs
  • (Optional) ignoreExitCode = Fail build if false and require.js did not run successfully. Default is false.
  • (Optional) requirejs.impl = r.js implementation file. Version 2.1.8 is provided within this plugin. Specifying this option allows users to specify a version of the require optimizer of their own choosing

What, you want more? Tell me!

Contributors

This project is made possible due to the efforts of these fine people:

  • Eric Wendelin - Original author and maintainer
  • Luke Daley - Advice and improved project structure and testing
  • Josh Newman - AMD and CommonJS work
  • Martin Ziel - Allowing minifyJs task to accept multiple files as input
  • Joe Fitzgerald - JSHint and RequireJS features
  • levsa - JSHint predef and checkstyle reporter
  • Martin Snyder - requireJs impl option
  • Aaron Arnett - Remove explicit MavenCentral dependency
  • sv99 - Improve Gradle version compatibility

See Also

The Gradle CSS Plugin!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].