Skip to content

Commit

Permalink
Change project name. Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
craigburke committed Feb 5, 2016
1 parent b4d8197 commit 5f8b14a
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
:version: 0.1.0

= Client Dependencies Gradle Plugin

The Gradle plugin allows you to declare client side dependencies in *build.gradle* from bower, npm or git and
with a much clearer dependencies resolution model.

== Getting Started

[source,gradle,subs='attributes']
----
plugins {
id 'com.craigburke.client-dependencies' version '{version}'
}
----

== Tasks

The plugin adds the following tasks to your build:

|===

| *Task* | *Description*

| clientInstall | Installs all the client dependencies you have set in your build.gradle

| clientRefresh | Refreshes client dependencies (if you add or modify your configuration)

| clientClean | Removes client dependencies and clears the cache

|===

== Declaring dependencies

You can specify dependencies from different sources (npm, bower or git) and control which files are included in your project by using the DSL shown below.

[source,gradle,subs='attributes']
----
plugins {
id 'com.craigburke.client-dependnencies' version '{version}'
}
clientDependencies {
bower {
'jquery'('2.0.0') {
source 'jquery.js' // <1>
}
}
npm {
'angular'('1.5.0') {
source 'angular.js' // <2>
}
'angular-animate'('1.3.x') {
source 'angular-animate.js' >> '/angular/modules/' // <3>
}
'bootstrap'('3.3.x') {
source 'dist/css/*.min.css' >> 'styles/'
source 'dist/fonts/**' >> 'fonts/'
exclude 'jquery' // <4>
}
}
}
----
<1> Installs jquery from bower and copies jquery.js into the default location (`src/assets/vendor/jquery/jquery.js`)
<2> This copies the *angular.js* file from npm to the default location (`src/assets/vendor/angular/angular.js`)
<3> An absolute path is used here so `angular-animate.js` will be copied to `src/assets/vendor/angular/modules/angular-animate.js`
<4> Exclude the transitive dependency jquery
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'npm-gradle'
rootProject.name = 'client-dependencies'

0 comments on commit 5f8b14a

Please sign in to comment.