Skip to content

Commit 2803fa7

Browse files
authored
Merge pull request #114 from runningcode/no/buildscripts
Task avoidance and plugins block
2 parents 41eea09 + 9913989 commit 2803fa7

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

build.gradle

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
import groovy.json.JsonBuilder
22

3-
buildscript {
4-
repositories {
5-
maven {
6-
url = "https://plugins.gradle.org/m2/"
7-
}
8-
}
9-
dependencies {
10-
classpath "com.gradle.publish:plugin-publish-plugin:0.12.0"
11-
}
3+
plugins {
4+
id "com.gradle.plugin-publish" version "0.12.0"
5+
id 'groovy'
6+
id 'java-gradle-plugin'
7+
id 'codenarc'
128
}
139

14-
apply plugin: 'groovy'
15-
apply plugin: 'java-gradle-plugin'
16-
apply plugin: 'codenarc'
17-
18-
apply plugin: "com.gradle.plugin-publish"
19-
2010
group = "org.gradle.android"
2111
version = ["git", "describe", "--match", "[0-9]*", "--dirty"].execute().text.trim()
2212

@@ -31,26 +21,33 @@ def supportedVersions = [
3121

3222
repositories {
3323
google()
34-
jcenter()
24+
mavenCentral()
25+
jcenter() {
26+
content {
27+
// org.jetbrains.trove4j is only available in jcenter otherwise we don't want to rely on jcenter.
28+
includeGroup("org.jetbrains.trove4j")
29+
}
30+
}
3531
}
3632

3733
dependencies {
38-
compileOnly 'com.android.tools.build:gradle:3.5.4'
34+
def agpVersion = "3.5.4"
35+
compileOnly "com.android.tools.build:gradle:$agpVersion"
3936
implementation gradleApi()
40-
testImplementation 'com.android.tools.build:gradle:3.5.4'
37+
testImplementation "com.android.tools.build:gradle:$agpVersion"
4138
testImplementation gradleTestKit()
4239
testImplementation "junit:junit:4.12"
4340
testImplementation "org.spockframework:spock-core:1.1-groovy-2.4@jar"
4441
testRuntime 'cglib:cglib-nodep:3.2.12'
4542
testRuntime 'org.objenesis:objenesis:3.1'
4643
}
4744

48-
sourceCompatibility = "1.7"
49-
targetCompatibility = "1.7"
45+
sourceCompatibility = "1.8"
46+
targetCompatibility = "1.8"
5047

5148
def generatedResources = "$buildDir/generated-resources/main"
5249

53-
task generateVersions {
50+
tasks.register('generateVersions') {
5451
def outputFile = file("$generatedResources/versions.json")
5552
inputs.property "version", version
5653
inputs.property "supportedVersions", supportedVersions
@@ -91,7 +88,7 @@ artifacts {
9188
runtime jar
9289
}
9390

94-
task install(type: Upload) {
91+
tasks.register('install', Upload) {
9592
repositories {
9693
ivy {
9794
url = localRepo.toURI()
@@ -102,7 +99,7 @@ task install(type: Upload) {
10299
configuration = configurations.runtime
103100
}
104101

105-
test {
102+
tasks.withType(Test).configureEach {
106103
dependsOn install
107104
systemProperty "local.repo", localRepo.toURI()
108105
}

0 commit comments

Comments
 (0)