forked from novoda/gradle-static-analysis-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request novoda#32 from novoda/plugin/dependencies
Introduce dependencies plugin
- Loading branch information
Showing
6 changed files
with
69 additions
and
12 deletions.
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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
apply plugin: DependenciesPlugin | ||
|
||
subprojects { | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.novoda:bintray-release:0.4.0' | ||
classpath 'com.novoda:gradle-build-properties-plugin:0.2' | ||
classpath 'org.ajoberstar:gradle-git:1.6.0' | ||
classpath gradlePlugins.bintrayRelease | ||
classpath gradlePlugins.buildProperties | ||
classpath gradlePlugins.gradleGit | ||
} | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
project.plugins.withType(JavaBasePlugin) { | ||
project.with { | ||
sourceCompatibility = JavaVersion.VERSION_1_7 | ||
targetCompatibility = JavaVersion.VERSION_1_7 | ||
} | ||
} | ||
} |
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,9 @@ | ||
repositories { | ||
jcenter() | ||
} | ||
|
||
apply plugin: 'groovy' | ||
|
||
dependencies { | ||
compile gradleApi() | ||
} |
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,11 @@ | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class DependenciesPlugin implements Plugin<Project> { | ||
|
||
@Override | ||
void apply(Project project) { | ||
project.extensions.create('gradlePlugins', GradlePlugins) | ||
project.extensions.create('libraries', Libraries, project) | ||
} | ||
} |
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,5 @@ | ||
class GradlePlugins { | ||
final bintrayRelease = 'com.novoda:bintray-release:0.4.0' | ||
final buildProperties = 'com.novoda:gradle-build-properties-plugin:0.2' | ||
final gradleGit = 'org.ajoberstar:gradle-git:1.6.0' | ||
} |
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,26 @@ | ||
import org.gradle.api.Project | ||
|
||
class Libraries { | ||
final junit = 'junit:junit:4.12' | ||
final truth = 'com.google.truth:truth:0.30' | ||
final guava = 'com.google.guava:guava:19.0' | ||
final findbugs = new Findbugs() | ||
|
||
private final Project project | ||
|
||
Libraries(Project project) { | ||
this.project = project | ||
} | ||
|
||
def getGradleApi() { | ||
project.dependencies.gradleApi() | ||
} | ||
|
||
def getGradleTestKit() { | ||
project.dependencies.gradleTestKit() | ||
} | ||
|
||
private static class Findbugs { | ||
final annotations = 'com.google.code.findbugs:jsr305:3.0.0' | ||
} | ||
} |
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