Gradle 플러그 인 만 들 기
2156 단어 gradlegradle 플러그 인
apply plugin: ‘groovy’ // java , java
apply plugin: ‘maven’ // ; jar
version = 1.0
group = 'com.zjzhai'
archivesBaseName = 'jshint-gradle'
repositories.mavenCentral()
dependencies {
compile(
gradleApi()
)
}
class JshintPlugin implements Plugin<Project>{
void apply(Project project) {
// .....
// 。jshint
project.extensions.create("jshint", JshintConfig)
project.task('jshint') << {
// task
// println
if (hasError) {
// ,
throw new RuntimeException("Jshint Failure!")
}
}
}
}
`project.task('jshint')` `jshint` task 。
src/main/resources/META-INF/gradle-plugins/
에 properties 파일 을 추가 합 니 다.jshint-gradle.properties
파일.jshint-gradle
플러그 인 이름 입 니 다.이 플러그 인 을 사용 할 때apple plugin 'jshint-gradle'
입 니 다.파일 에서 입 구 를 정의 합 니 다:'implementation-class=com.zjzhai.gradle.jshint.JshintPlugin'
uploadArchives {
repositories.mavenDeployer {
repository(url: 'file:/Users/xxxx/.m2/repository')
}
}
url 지정 창고 주소 실행 명령 업로드:gradle uploadArchives
apply plugin: 'jshint-gradle'
jshint {
inputDirs = file('src/main/resources').path
includes = ["asset/*.js"]
excludes = ["**/compase/*.js"]
}
경 로 를 사용 하 는 것 은 ant path 문법 을 사용 하면 여기jshint
와project.extensions.create("jshint", JshintConfig)
의 대응 을 볼 수 있 습 니 다.JshintConfig 클래스 는 Bean: class JshintConfig {
def inputDirs
def includes
def excludes
}
사용 시 명령:gradle jshint
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Groupie의 ViewHolder를 사용해 보았습니다.Groupie는 Android의 recycler-view를 쉽게 사용할 수있는 라이브러리이지만 groupie-databinding은 deprecated되었습니다. 이번에는 권장되는 (Poi) groupie-viewb...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.