1
1
import groovy.json.JsonBuilder
2
2
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'
12
8
}
13
9
14
- apply plugin : ' groovy'
15
- apply plugin : ' java-gradle-plugin'
16
- apply plugin : ' codenarc'
17
-
18
- apply plugin : " com.gradle.plugin-publish"
19
-
20
10
group = " org.gradle.android"
21
11
version = [" git" , " describe" , " --match" , " [0-9]*" , " --dirty" ]. execute(). text. trim()
22
12
@@ -31,26 +21,33 @@ def supportedVersions = [
31
21
32
22
repositories {
33
23
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
+ }
35
31
}
36
32
37
33
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 "
39
36
implementation gradleApi()
40
- testImplementation ' com.android.tools.build:gradle:3.5.4 '
37
+ testImplementation " com.android.tools.build:gradle:$a gpVersion "
41
38
testImplementation gradleTestKit()
42
39
testImplementation " junit:junit:4.12"
43
40
testImplementation " org.spockframework:spock-core:1.1-groovy-2.4@jar"
44
41
testRuntime ' cglib:cglib-nodep:3.2.12'
45
42
testRuntime ' org.objenesis:objenesis:3.1'
46
43
}
47
44
48
- sourceCompatibility = " 1.7 "
49
- targetCompatibility = " 1.7 "
45
+ sourceCompatibility = " 1.8 "
46
+ targetCompatibility = " 1.8 "
50
47
51
48
def generatedResources = " $buildDir /generated-resources/main"
52
49
53
- task generateVersions {
50
+ tasks . register( ' generateVersions' ) {
54
51
def outputFile = file(" $generatedResources /versions.json" )
55
52
inputs. property " version" , version
56
53
inputs. property " supportedVersions" , supportedVersions
@@ -91,7 +88,7 @@ artifacts {
91
88
runtime jar
92
89
}
93
90
94
- task install ( type : Upload ) {
91
+ tasks . register( ' install ' , Upload ) {
95
92
repositories {
96
93
ivy {
97
94
url = localRepo. toURI()
@@ -102,7 +99,7 @@ task install(type: Upload) {
102
99
configuration = configurations. runtime
103
100
}
104
101
105
- test {
102
+ tasks . withType( Test ) . configureEach {
106
103
dependsOn install
107
104
systemProperty " local.repo" , localRepo. toURI()
108
105
}
0 commit comments