• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

craigburke/client-dependencies-gradle: Install client dependencies from NPM, Bow ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

craigburke/client-dependencies-gradle

开源软件地址(OpenSource Url):

https://github.com/craigburke/client-dependencies-gradle

开源编程语言(OpenSource Language):

Groovy 73.5%

开源软件介绍(OpenSource Introduction):

Client Dependencies Gradle Plugin

This Gradle plugin allows you to declare client side dependencies in build.gradle from bower, npm, yarn or git and with a much clearer dependencies resolution model. This plugin queries the registries directly so it doesn’t require or install node, npm or bower.

Getting Started

Gradle 2.0

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.craigburke.gradle:client-dependencies:1.4.1'
    }
}

apply plugin: 'com.craigburke.client-dependencies'

Gradle 2.1 and higher

plugins {
    id 'com.craigburke.client-dependencies' version '1.4.1'
}

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

clientReport

Prints a report of all dependencies and the resolved versions

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.

⚠️
The following example shows the use of several different types of registries, this works but it’s best to stick to a single registry (NPM is recommended).
clientDependencies {
    bower {
        'jquery'('2.0.0') // <1>
    }
    npm {
        'bootstrap'('3.3.6', exclude: 'jquery') // <2>
        'restangular'('1.5.1', transitive: false) // <3>
        'angular-animate'('1.5.0', into: 'angular/modules') // <4>
        'animate.css'('1.0.0', url:'daneden/animate.css') // <5>
        'angular-ui-bootstrap'('1.3.x', from:'dist') { // <6>
            include 'ui-bootstrap-tpls.js'
        }
    }
    yarn {
        'angular'('1.5.8') // <7>
    }
}
  1. Installs jquery from bower and into the location (src/assets/vendor/jquery) using the default copy settings

  2. Installs bootstrap from npm and excludes the dependency jquery

  3. Installs restangular from npm but doesn’t include any child dependencies

  4. Changing the destination path using the into property. This is relative to the install path meaning this would install to the location src/assets/vendor/angular/modules.

  5. Use the url property to use a github repo as a dependency source (expands to https://www.github.com/danedan/animate.css.git). A full URL reference any git repository will also work here.

  6. The from property allows you to copy code only from a certain subfolder

  7. Installs angular from Yarn’s registry


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
spotify/ruler: Gradle plugin which helps you analyze the size of your Android ap ...发布时间:2022-06-14
下一篇:
gradle/gradle-site-plugin发布时间:2022-06-14
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap