Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit eb9264b

Browse files
authored
Merge pull request #172 from AndrewReitz/update-version-number
Update to 2.0.1
2 parents 2308017 + 57f7486 commit eb9264b

File tree

13 files changed

+86
-49
lines changed

13 files changed

+86
-49
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Thumbs.db
3131
# Android Studio
3232
.idea
3333
*.iml
34+
*.ipr
35+
*.iws
3436
.gradle
3537
build/
3638

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.0.1
2+
-----
3+
* Fixed compilation issue where running with `--debug` would fail the build (#169)
4+
* Updated to use `getJavaCompileProvider` instead of deprecated `getJavaCompile` (#167)
5+
16
2.0.0
27
-----
38
* Support for Android Gradle Plugin 3.0.0+ only. For lower versions use 1.2.0

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:groovyVersion: 2.4.12
22
:pluginVersion: 2.0.0
3-
:pluginSnapshotVersion: 2.1.0
3+
:pluginSnapshotVersion: 2.0.1
44
:androidPluginVersion: 3.0.0
55

66
= Groovy language support for Android

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ apply plugin: 'com.gradle.build-scan'
3535
apply from: "$rootDir/gradle/idea/idea.gradle"
3636

3737
allprojects {
38-
version = '2.0.1'
38+
version = '2.0.1-SNAPSHOT'
3939
group = 'org.codehaus.groovy'
4040

4141
apply plugin: 'com.github.ben-manes.versions'

groovy-android-gradle-plugin/gradle-plugin.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ apply from: "$rootDir/gradle/publishPlugins.gradle"
2626

2727
description = 'Groovy support for Android with the Gradle build tool - http://www.groovy-lang.org'
2828

29-
sourceCompatibility = JavaVersion.VERSION_1_6
30-
targetCompatibility = JavaVersion.VERSION_1_6
29+
sourceCompatibility = JavaVersion.VERSION_1_8
30+
targetCompatibility = JavaVersion.VERSION_1_8
3131

3232
dependencies {
3333
implementation localGroovy()
@@ -64,6 +64,7 @@ tasks.withType(Test) {
6464
systemProperty 'buildToolsVersion', buildToolsVersion
6565
systemProperty 'compileSdkVersion', compileSdkVersion
6666
systemProperty 'kotlinVersion', kotlinVersion
67+
systemProperty 'groovyVersion', groovyVersion
6768

6869
environment "GRADLE_USER_HOME", gradle.gradleUserHomeDir
6970

groovy-android-gradle-plugin/src/test/groovy/groovyx/functional/FullCompilationSpec.groovy

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package groovyx.functional
1818

19+
import org.gradle.util.VersionNumber
1920
import groovyx.functional.internal.AndroidFunctionalSpec
2021
import groovyx.internal.AndroidFileHelper
2122
import spock.lang.IgnoreIf
@@ -33,7 +34,7 @@ import static groovyx.internal.TestProperties.allTests
3334
class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHelper {
3435

3536
@Unroll
36-
Should "compile android app with java:#javaVersion, android plugin:#androidPluginVersion, gradle version: #gradleVersion"() {
37+
Should "compile android app with java:#javaVersion, android plugin:#_androidPluginVersion, gradle version: #gradleVersion"() {
3738
given:
3839
file("settings.gradle") << "rootProject.name = 'test-app'"
3940

@@ -120,11 +121,11 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe
120121
then:
121122
noExceptionThrown()
122123
file('build/outputs/apk/debug/test-app-debug.apk').exists()
123-
file('build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/MainActivity.class').exists()
124-
file('build/intermediates/javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class').exists()
124+
file("build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/MainActivity.class").exists()
125+
file("build/intermediates//javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class").exists()
125126
if (args.contains('test')) {
126-
assert file('build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
127-
assert file('build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
127+
assert file("build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
128+
assert file("build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
128129
}
129130

130131
where:
@@ -134,14 +135,24 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe
134135
// > org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
135136
// Stack trace shows Caused by: java.io.NotSerializableException: org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
136137
javaVersion | _androidPluginVersion | gradleVersion | args
137-
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.1' | ['assemble']
138-
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.1' | ['assemble']
139-
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.1' | ['assemble', 'test']
138+
'JavaVersion.VERSION_1_7' | '3.0.1' | '4.10.3' | ['assemble']
139+
'JavaVersion.VERSION_1_7' | '3.1.4' | '4.10.3' | ['assemble']
140+
'JavaVersion.VERSION_1_7' | '3.2.1' | '4.10.3' | ['assemble']
141+
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.3' | ['assemble']
142+
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.3' | ['assemble']
143+
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.3' | ['assemble', 'test']
144+
'JavaVersion.VERSION_1_8' | '3.4.0-beta04' | '5.1.1' | ['assemble', 'test']
145+
'JavaVersion.VERSION_1_8' | '3.5.0-alpha04' | '5.1.1' | ['assemble', 'test']
146+
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.1.1' | ['assemble', 'test']
147+
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
148+
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
140149
}
141150

142151
@Unroll
143-
Should "compile android library with java:#javaVersion and android plugin:#androidPluginVersion, gradle version:#gradleVersion"() {
152+
Should "compile android library with java:#javaVersion and android plugin:#_androidPluginVersion, gradle version:#gradleVersion"() {
144153
given:
154+
def isGradle5 = VersionNumber.parse(gradleVersion).major == 5
155+
145156
file("settings.gradle") << "rootProject.name = 'test-lib'"
146157

147158
createBuildFileForLibrary()
@@ -221,14 +232,15 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe
221232

222233
then:
223234
noExceptionThrown()
224-
file('build/outputs/aar/test-lib-debug.aar').exists()
225-
file('build/outputs/aar/test-lib-release.aar').exists()
226-
file('build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/Test.class').exists()
227-
file('build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/groovyx/test/Test.class').exists()
228-
file('build/intermediates/javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class').exists()
235+
file("build/outputs/aar/test-lib${isGradle5 ? '' : '-debug'}.aar").exists()
236+
isGradle5 ? true : file('build/outputs/aar/test-lib-release.aar').exists()
237+
file('build/outputs/apk/androidTest/debug/test-lib-debug-androidTest.apk').exists()
238+
file("build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/Test.class").exists()
239+
file("build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/groovyx/test/Test.class").exists()
240+
file("build/intermediates/javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class").exists()
229241
if (args.contains('test')) {
230-
assert file('build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
231-
assert file('build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
242+
assert file("build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
243+
assert file("build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
232244
}
233245

234246
where:
@@ -238,9 +250,17 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe
238250
// > org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
239251
// Stack trace shows Caused by: java.io.NotSerializableException: org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
240252
javaVersion | _androidPluginVersion | gradleVersion | args
241-
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.1' | ['assemble']
242-
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.1' | ['assemble']
243-
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.1' | ['assemble', 'test']
253+
'JavaVersion.VERSION_1_7' | '3.0.1' | '4.10.3' | ['assemble']
254+
'JavaVersion.VERSION_1_7' | '3.1.4' | '4.10.3' | ['assemble']
255+
'JavaVersion.VERSION_1_7' | '3.2.1' | '4.10.3' | ['assemble']
256+
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.3' | ['assemble']
257+
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.3' | ['assemble']
258+
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.3' | ['assemble', 'test']
259+
'JavaVersion.VERSION_1_8' | '3.4.0-beta04' | '5.1.1' | ['assemble', 'test']
260+
'JavaVersion.VERSION_1_8' | '3.5.0-alpha04' | '5.1.1' | ['assemble', 'test']
261+
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.1.1' | ['assemble', 'test']
262+
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
263+
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
244264
}
245265

246266
Should "not resolve dependencies during configuration with --debug"() {

groovy-android-gradle-plugin/src/test/groovy/groovyx/functional/KotlinSupportSpec.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import static groovyx.internal.TestProperties.androidPluginVersion
2323
import static groovyx.internal.TestProperties.buildToolsVersion
2424
import static groovyx.internal.TestProperties.compileSdkVersion
2525
import static groovyx.internal.TestProperties.kotlinVersion
26+
import static groovyx.internal.TestProperties.groovyVersion
2627

2728
/**
2829
* Allows Kotlin and Groovy to play nicely with each other.
@@ -81,8 +82,8 @@ class KotlinSupportSpec extends AndroidFunctionalSpec {
8182
}
8283
8384
compileOptions {
84-
sourceCompatibility '1.7'
85-
targetCompatibility '1.7'
85+
sourceCompatibility '1.8'
86+
targetCompatibility '1.8'
8687
}
8788
8889
buildTypes {
@@ -99,11 +100,11 @@ class KotlinSupportSpec extends AndroidFunctionalSpec {
99100
}
100101
101102
dependencies {
102-
implementation 'org.codehaus.groovy:groovy:2.4.12:grooid'
103+
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
103104
implementation 'org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion'
104105
105-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
106-
androidTestImplementation 'com.android.support.test:rules:1.0.1'
106+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
107+
androidTestImplementation 'com.android.support.test:rules:1.0.2'
107108
108109
testImplementation 'junit:junit:4.12'
109110
}

groovy-android-gradle-plugin/src/test/groovy/groovyx/functional/RenderScriptCompilationSpec.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import static groovyx.internal.TestProperties.allTests
2828
import static groovyx.internal.TestProperties.androidPluginVersion
2929
import static groovyx.internal.TestProperties.buildToolsVersion
3030
import static groovyx.internal.TestProperties.compileSdkVersion
31+
import static groovyx.internal.TestProperties.groovyVersion
3132

3233
/**
3334
* Ensure that projects with renderscript compile properly.
@@ -83,8 +84,8 @@ class RenderScriptCompilationSpec extends AndroidFunctionalSpec {
8384
}
8485
8586
compileOptions {
86-
sourceCompatibility JavaVersion.VERSION_1_7
87-
targetCompatibility JavaVersion.VERSION_1_7
87+
sourceCompatibility JavaVersion.VERSION_1_8
88+
targetCompatibility JavaVersion.VERSION_1_8
8889
}
8990
9091
buildTypes {
@@ -101,7 +102,7 @@ class RenderScriptCompilationSpec extends AndroidFunctionalSpec {
101102
}
102103
103104
dependencies {
104-
implementation 'org.codehaus.groovy:groovy:2.4.12:grooid'
105+
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
105106
}
106107
"""
107108

groovy-android-gradle-plugin/src/test/groovy/groovyx/functional/SkipJavaCSpec.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import java.lang.Void as Should
2424
import static groovyx.internal.TestProperties.allTests
2525
import static groovyx.internal.TestProperties.androidPluginVersion
2626
import static groovyx.internal.TestProperties.compileSdkVersion
27+
import static groovyx.internal.TestProperties.groovyVersion
2728

2829
@IgnoreIf({ !allTests })
2930
class SkipJavaCSpec extends AndroidFunctionalSpec {
@@ -74,8 +75,8 @@ class SkipJavaCSpec extends AndroidFunctionalSpec {
7475
}
7576
7677
compileOptions {
77-
sourceCompatibility '1.7'
78-
targetCompatibility '1.7'
78+
sourceCompatibility '1.8'
79+
targetCompatibility '1.8'
7980
}
8081
8182
buildTypes {
@@ -96,7 +97,7 @@ class SkipJavaCSpec extends AndroidFunctionalSpec {
9697
}
9798
9899
dependencies {
99-
implementation 'org.codehaus.groovy:groovy:2.4.16:grooid'
100+
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
100101
}
101102
"""
102103

groovy-android-gradle-plugin/src/test/groovy/groovyx/functional/SourceSetSpec.groovy

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import java.lang.Void as Should
2424
import static groovyx.internal.TestProperties.allTests
2525
import static groovyx.internal.TestProperties.androidPluginVersion
2626
import static groovyx.internal.TestProperties.compileSdkVersion
27+
import static groovyx.internal.TestProperties.groovyVersion
2728

2829
@IgnoreIf({ !allTests })
2930
class SourceSetSpec extends AndroidFunctionalSpec {
@@ -74,8 +75,8 @@ class SourceSetSpec extends AndroidFunctionalSpec {
7475
}
7576
7677
compileOptions {
77-
sourceCompatibility '1.7'
78-
targetCompatibility '1.7'
78+
sourceCompatibility '1.8'
79+
targetCompatibility '1.8'
7980
}
8081
8182
buildTypes {
@@ -100,7 +101,7 @@ class SourceSetSpec extends AndroidFunctionalSpec {
100101
}
101102
102103
dependencies {
103-
implementation 'org.codehaus.groovy:groovy:2.4.16:grooid'
104+
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
104105
}
105106
"""
106107

@@ -230,8 +231,8 @@ class SourceSetSpec extends AndroidFunctionalSpec {
230231
}
231232
232233
compileOptions {
233-
sourceCompatibility '1.7'
234-
targetCompatibility '1.7'
234+
sourceCompatibility '1.8'
235+
targetCompatibility '1.8'
235236
}
236237
237238
buildTypes {
@@ -256,7 +257,7 @@ class SourceSetSpec extends AndroidFunctionalSpec {
256257
}
257258
258259
dependencies {
259-
implementation 'org.codehaus.groovy:groovy:2.4.16:grooid'
260+
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
260261
}
261262
"""
262263

0 commit comments

Comments
 (0)