Skip to content

Commit

Permalink
Update to latest plugins and add nebula
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoberstar committed Aug 6, 2017
1 parent ff975a2 commit 2e48407
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ repositories {
dependencies {
compile gradleApi()
compile localGroovy()
compile 'org.ajoberstar:grgit:2.0.0-rc.1'
compile 'org.ajoberstar.reckon:reckon-gradle:0.2.0-milestone.3'
compile 'org.ajoberstar:gradle-git-publish:0.3.0-rc.1'

// my plugins
compile 'org.ajoberstar:grgit:2.0.0'
compile 'org.ajoberstar.reckon:reckon-gradle:0.2.0'
compile 'org.ajoberstar:gradle-git-publish:0.3.0'
compile 'org.ajoberstar:gradle-stutter:0.1.1-rc.1'
compile 'org.ajoberstar:gradle-bintray:0.1.1-rc.1'

// 3rd party plugins
compile 'com.gradle.publish:plugin-publish-plugin:0.9.7'
compile 'com.diffplug.spotless:spotless-plugin-gradle:3.4.1'
compile 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5'
compile 'com.netflix.nebula:gradle-dependency-lock-plugin:4.9.4'
compile 'com.netflix.nebula:gradle-lint-plugin:7.9.5'
}

model {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class DefaultsPlugin implements Plugin<Project> {
addGroovyConfig(prj)
addPublishingConfig(prj)
addPluginConfig(prj)
addNebulaConfig(prj)
addOrderingRules(prj)
}
}


private void addGit(Project project) {
project.plugins.apply('org.ajoberstar.grgit')
project.plugins.apply('org.ajoberstar.git-publish')
Expand All @@ -60,9 +60,6 @@ class DefaultsPlugin implements Plugin<Project> {

project.gitPublish {
branch = 'gh-pages'
contents {
from 'src/gh-pages'
}
}
}

Expand All @@ -83,15 +80,8 @@ class DefaultsPlugin implements Plugin<Project> {
preRelease = stageFromProp('milestone', 'rc', 'final')
}

def tagTask = project.tasks.create('tagVersion') {
doLast {
def version = project.version.toString()
project.grgit.tag.add(name: version, message: "v${version}")
}
}

def releaseTask = project.tasks.create('release')
releaseTask.dependsOn tagTask
releaseTask.dependsOn 'reckonTagPush'
releaseTask.dependsOn 'gitPublishPush'
project.allprojects { prj ->
prj.plugins.withId('org.gradle.base') {
Expand Down Expand Up @@ -214,4 +204,11 @@ class DefaultsPlugin implements Plugin<Project> {
}
}
}

private void addNebulaConfig(Project project) {
project.plugins.apply('nebula.lint')
gradleLint.rules = ['archaic-wrapper', 'all-dependency', 'dependency-parentheses', 'dependency-tuple']

project.plugins.apply('nebula.dependency-lock')
}
}

0 comments on commit 2e48407

Please sign in to comment.