Skip to content

Commit

Permalink
Merge pull request #172 from AndrewReitz/update-version-number
Browse files Browse the repository at this point in the history
Update to 2.0.1
  • Loading branch information
AndrewReitz authored Feb 16, 2019
2 parents 2308017 + 57f7486 commit eb9264b
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Thumbs.db
# Android Studio
.idea
*.iml
*.ipr
*.iws
.gradle
build/

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.0.1
-----
* Fixed compilation issue where running with `--debug` would fail the build (#169)
* Updated to use `getJavaCompileProvider` instead of deprecated `getJavaCompile` (#167)

2.0.0
-----
* Support for Android Gradle Plugin 3.0.0+ only. For lower versions use 1.2.0
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:groovyVersion: 2.4.12
:pluginVersion: 2.0.0
:pluginSnapshotVersion: 2.1.0
:pluginSnapshotVersion: 2.0.1
:androidPluginVersion: 3.0.0

= Groovy language support for Android
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ apply plugin: 'com.gradle.build-scan'
apply from: "$rootDir/gradle/idea/idea.gradle"

allprojects {
version = '2.0.1'
version = '2.0.1-SNAPSHOT'
group = 'org.codehaus.groovy'

apply plugin: 'com.github.ben-manes.versions'
Expand Down
5 changes: 3 additions & 2 deletions groovy-android-gradle-plugin/gradle-plugin.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ apply from: "$rootDir/gradle/publishPlugins.gradle"

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

sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
implementation localGroovy()
Expand Down Expand Up @@ -64,6 +64,7 @@ tasks.withType(Test) {
systemProperty 'buildToolsVersion', buildToolsVersion
systemProperty 'compileSdkVersion', compileSdkVersion
systemProperty 'kotlinVersion', kotlinVersion
systemProperty 'groovyVersion', groovyVersion

environment "GRADLE_USER_HOME", gradle.gradleUserHomeDir

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package groovyx.functional

import org.gradle.util.VersionNumber
import groovyx.functional.internal.AndroidFunctionalSpec
import groovyx.internal.AndroidFileHelper
import spock.lang.IgnoreIf
Expand All @@ -33,7 +34,7 @@ import static groovyx.internal.TestProperties.allTests
class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHelper {

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

Expand Down Expand Up @@ -120,11 +121,11 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe
then:
noExceptionThrown()
file('build/outputs/apk/debug/test-app-debug.apk').exists()
file('build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/MainActivity.class').exists()
file('build/intermediates/javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class').exists()
file("build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/MainActivity.class").exists()
file("build/intermediates//javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class").exists()
if (args.contains('test')) {
assert file('build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
assert file('build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
assert file("build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
assert file("build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
}

where:
Expand All @@ -134,14 +135,24 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe
// > org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
// Stack trace shows Caused by: java.io.NotSerializableException: org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
javaVersion | _androidPluginVersion | gradleVersion | args
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.1' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.1' | ['assemble']
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_7' | '3.0.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.1.4' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.2.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.3' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.4.0-beta04' | '5.1.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.5.0-alpha04' | '5.1.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.1.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
}

@Unroll
Should "compile android library with java:#javaVersion and android plugin:#androidPluginVersion, gradle version:#gradleVersion"() {
Should "compile android library with java:#javaVersion and android plugin:#_androidPluginVersion, gradle version:#gradleVersion"() {
given:
def isGradle5 = VersionNumber.parse(gradleVersion).major == 5

file("settings.gradle") << "rootProject.name = 'test-lib'"

createBuildFileForLibrary()
Expand Down Expand Up @@ -221,14 +232,15 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe

then:
noExceptionThrown()
file('build/outputs/aar/test-lib-debug.aar').exists()
file('build/outputs/aar/test-lib-release.aar').exists()
file('build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/Test.class').exists()
file('build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/groovyx/test/Test.class').exists()
file('build/intermediates/javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class').exists()
file("build/outputs/aar/test-lib${isGradle5 ? '' : '-debug'}.aar").exists()
isGradle5 ? true : file('build/outputs/aar/test-lib-release.aar').exists()
file('build/outputs/apk/androidTest/debug/test-lib-debug-androidTest.apk').exists()
file("build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/groovyx/test/Test.class").exists()
file("build/intermediates/javac/release/compileReleaseJavaWithJavac/classes/groovyx/test/Test.class").exists()
file("build/intermediates/javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/groovyx/test/AndroidTest.class").exists()
if (args.contains('test')) {
assert file('build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
assert file('build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class').exists()
assert file("build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
assert file("build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes/groovyx/test/JvmTest.class").exists()
}

where:
Expand All @@ -238,9 +250,17 @@ class FullCompilationSpec extends AndroidFunctionalSpec implements AndroidFileHe
// > org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
// Stack trace shows Caused by: java.io.NotSerializableException: org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection
javaVersion | _androidPluginVersion | gradleVersion | args
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.1' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.1' | ['assemble']
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_7' | '3.0.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.1.4' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.2.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_6' | '3.3.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_7' | '3.3.1' | '4.10.3' | ['assemble']
'JavaVersion.VERSION_1_8' | '3.3.1' | '4.10.3' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.4.0-beta04' | '5.1.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.5.0-alpha04' | '5.1.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.1.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
'JavaVersion.VERSION_1_8' | '3.3.1' | '5.2.1' | ['assemble', 'test']
}

Should "not resolve dependencies during configuration with --debug"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import static groovyx.internal.TestProperties.androidPluginVersion
import static groovyx.internal.TestProperties.buildToolsVersion
import static groovyx.internal.TestProperties.compileSdkVersion
import static groovyx.internal.TestProperties.kotlinVersion
import static groovyx.internal.TestProperties.groovyVersion

/**
* Allows Kotlin and Groovy to play nicely with each other.
Expand Down Expand Up @@ -81,8 +82,8 @@ class KotlinSupportSpec extends AndroidFunctionalSpec {
}
compileOptions {
sourceCompatibility '1.7'
targetCompatibility '1.7'
sourceCompatibility '1.8'
targetCompatibility '1.8'
}
buildTypes {
Expand All @@ -99,11 +100,11 @@ class KotlinSupportSpec extends AndroidFunctionalSpec {
}
dependencies {
implementation 'org.codehaus.groovy:groovy:2.4.12:grooid'
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
testImplementation 'junit:junit:4.12'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import static groovyx.internal.TestProperties.allTests
import static groovyx.internal.TestProperties.androidPluginVersion
import static groovyx.internal.TestProperties.buildToolsVersion
import static groovyx.internal.TestProperties.compileSdkVersion
import static groovyx.internal.TestProperties.groovyVersion

/**
* Ensure that projects with renderscript compile properly.
Expand Down Expand Up @@ -83,8 +84,8 @@ class RenderScriptCompilationSpec extends AndroidFunctionalSpec {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
Expand All @@ -101,7 +102,7 @@ class RenderScriptCompilationSpec extends AndroidFunctionalSpec {
}
dependencies {
implementation 'org.codehaus.groovy:groovy:2.4.12:grooid'
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
}
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import java.lang.Void as Should
import static groovyx.internal.TestProperties.allTests
import static groovyx.internal.TestProperties.androidPluginVersion
import static groovyx.internal.TestProperties.compileSdkVersion
import static groovyx.internal.TestProperties.groovyVersion

@IgnoreIf({ !allTests })
class SkipJavaCSpec extends AndroidFunctionalSpec {
Expand Down Expand Up @@ -74,8 +75,8 @@ class SkipJavaCSpec extends AndroidFunctionalSpec {
}
compileOptions {
sourceCompatibility '1.7'
targetCompatibility '1.7'
sourceCompatibility '1.8'
targetCompatibility '1.8'
}
buildTypes {
Expand All @@ -96,7 +97,7 @@ class SkipJavaCSpec extends AndroidFunctionalSpec {
}
dependencies {
implementation 'org.codehaus.groovy:groovy:2.4.16:grooid'
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
}
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import java.lang.Void as Should
import static groovyx.internal.TestProperties.allTests
import static groovyx.internal.TestProperties.androidPluginVersion
import static groovyx.internal.TestProperties.compileSdkVersion
import static groovyx.internal.TestProperties.groovyVersion

@IgnoreIf({ !allTests })
class SourceSetSpec extends AndroidFunctionalSpec {
Expand Down Expand Up @@ -74,8 +75,8 @@ class SourceSetSpec extends AndroidFunctionalSpec {
}
compileOptions {
sourceCompatibility '1.7'
targetCompatibility '1.7'
sourceCompatibility '1.8'
targetCompatibility '1.8'
}
buildTypes {
Expand All @@ -100,7 +101,7 @@ class SourceSetSpec extends AndroidFunctionalSpec {
}
dependencies {
implementation 'org.codehaus.groovy:groovy:2.4.16:grooid'
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
}
"""

Expand Down Expand Up @@ -230,8 +231,8 @@ class SourceSetSpec extends AndroidFunctionalSpec {
}
compileOptions {
sourceCompatibility '1.7'
targetCompatibility '1.7'
sourceCompatibility '1.8'
targetCompatibility '1.8'
}
buildTypes {
Expand All @@ -256,7 +257,7 @@ class SourceSetSpec extends AndroidFunctionalSpec {
}
dependencies {
implementation 'org.codehaus.groovy:groovy:2.4.16:grooid'
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
}
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package groovyx.functional.internal
import groovyx.internal.TestProperties

import static groovyx.internal.TestProperties.compileSdkVersion
import static groovyx.internal.TestProperties.groovyVersion

abstract class AndroidFunctionalSpec extends FunctionalSpec {

Expand Down Expand Up @@ -84,10 +85,10 @@ abstract class AndroidFunctionalSpec extends FunctionalSpec {
}
dependencies {
implementation 'org.codehaus.groovy:groovy:2.4.16:grooid'
implementation 'org.codehaus.groovy:groovy:$groovyVersion:grooid'
annotationProcessor 'com.google.auto.value:auto-value:1.5.2'
compileOnly 'com.jakewharton.auto.value:auto-value-annotations:1.5'
annotationProcessor 'com.google.auto.value:auto-value:1.6.3'
compileOnly 'com.google.auto.value:auto-value-annotations:1.6.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@ abstract class TestProperties {
}

static String getAndroidPluginVersion() {
return System.getProperty('androidPluginVersion')?:'3.0.0'
return System.getProperty('androidPluginVersion')?:'3.3.1'
}

static String getBuildToolsVersion() {
return System.getProperty('buildToolsVersion')?:'26.0.2'
return System.getProperty('buildToolsVersion')?:'28.0.3'
}

static int getCompileSdkVersion() {
String prop = System.getProperty('compileSdkVersion')
return Integer.parseInt(prop?:'26')
return Integer.parseInt(prop?:'28')
}

static String getKotlinVersion() {
return System.getProperty('kotlinVersion')?:'1.1.51'
return System.getProperty('kotlinVersion')?:'1.3.21'
}

static String getGroovyVersion() {
return System.getProperty('groovyVersion')?:'2.4.16'
}
}
4 changes: 2 additions & 2 deletions groovy-android-sample-app/sample-app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
Expand Down

0 comments on commit eb9264b

Please sign in to comment.