Code Monkey home page Code Monkey logo

jsweet-gradle-plugin's Introduction

JSweet Gradle plugin

Brings the power of JSweet to Gradle

Usage

Add the JSweet's repositories and the Gradle plugin dependency to your project's build.gradle, in the buildScript section:

buildscript {
	repositories {
		mavenCentral()
		maven { url "http://repository.jsweet.org/artifactory/libs-release-local" }
		maven { url "http://repository.jsweet.org/artifactory/libs-snapshot-local" }
		maven { url "http://repository.jsweet.org/artifactory/plugins-release-local" }
		maven { url "http://repository.jsweet.org/artifactory/plugins-snapshot-local" }
		maven { url "http://google-diff-match-patch.googlecode.com/svn/trunk/maven" }
	}
	dependencies {
		classpath('org.jsweet:jsweet-gradle-plugin:2.3.0-SNAPSHOT') { //
			transitive = true }
	}
}

Then apply the JSweet Gradle plugin, as usual:

apply plugin: 'org.jsweet.jsweet-gradle-plugin'

and optionally disable java compilation (JSweet sources may not be considered as standard java sources):

compileJava {
	enabled = false
}

Add your JSweet dependencies (candies):

dependencies {
	compile group: 'org.jsweet', name: 'jsweet-transpiler', version: "2.3.0-SNAPSHOT"
	compile group: 'org.jsweet', name: 'jsweet-core', version: "6"
	compile group: 'org.jsweet.candies', name: 'angular', version: "1.4.0-20170726"
	compile group: 'org.jsweet.candies', name: 'angular-route', version: "1.2.0-20170726"
}

Configure the JSweet plugin:

jsweet {
	verbose = true
	encoding = 'UTF-8'
	sourceMap = true
	outDir = new File('target/javascript')
	candiesJsOut = new File('target/candies')
	targetVersion = 'ES6'
	includes = ['**/fr/test/my/**/*.java']
	
	// extraSystemPath = '/my/path/to/npm'
}

The configuration options are based on the JSweet maven plugin options, please refer to its README for a comprehensive documentation: https://github.com/lgrignon/jsweet-maven-plugin#basic-configuration

Then, just invoke one of the JSweet gradle task:

$ gradle jsweet
$ gradle jsweetClean

Development / Contribution

Install with:

gradlew clean publishToMavenLocal

Deploy the plugin (needs credentials)

# on JSweet's repository
gradlew publish

# on central Gradle plugins repository
gradlew publishPlugins

jsweet-gradle-plugin's People

Contributors

janvorwerk avatar lgrignon avatar nedtwigg avatar zebalu avatar

Watchers

 avatar

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.