-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4d8197
commit 5f8b14a
Showing
2 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rootProject.name = 'npm-gradle' | ||
rootProject.name = 'client-dependencies' |