Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compatibility for build-tools-2.2.0-alpha6 #118

Merged
merged 1 commit into from Sep 19, 2016

Conversation

Naitbit
Copy link
Contributor

@Naitbit Naitbit commented Jul 20, 2016

-Bumps build tools version so it works with currently newest alpha of build tools (hopefully it will work with final 2.2.0)
-globalScope property for some reason returned TransformGlobalScope instead of GlobalScope. Calling getGlobalScope() seems to return value that we want.
-Please verify whether I've updated FullCompilationSpec correctly.

@AndrewReitz
Copy link
Collaborator

Thanks for the pull request. I don't want to merge this into the mainline since this would make the plugin depend on alpha software. It's good to know that it does currently work but will want to hold off for now.

If you could add a comment to the getGlobalScope as to why the get is being explicitly used that would be great, and the only thing missing from the FullCompilationSpec is the compatibility test for the library plugin.

@Naitbit
Copy link
Contributor Author

Naitbit commented Jul 21, 2016

Sure, I've expected that there will be no release with alpha dependency. I've just wanted to make sure that plugin will not stop working with final 2.2 build tools.
I've added comment and test as requested. I hope that it will be helpful to someone :)

@AndrewReitz
Copy link
Collaborator

Thanks! Yeah, as soon as the latest tools get pushed I'll merge this and drop the -apha or let you do the honors by updating this PR.

@uKL
Copy link

uKL commented Jul 21, 2016

Is there any temporary workaround until release?

@Naitbit
Copy link
Contributor Author

Naitbit commented Jul 22, 2016

@uKL You can:
-download my branch, build it and copy resulting .jar into you local maven repo and use 1.0.1-SNAPSHOT as classpath
-or downgrade build tools to 2.1.2

@uKL
Copy link

uKL commented Jul 22, 2016

I did the first one and added classpath dependency to a jar file, within the project. Thanks!

@AndrewReitz
Copy link
Collaborator

You should also be able to pull this branch and do ./gradlew publishMavenLocal then in your project add mavenLocal() as a repository. When you reference the snapshot you will actually be using the published branch. You may want to change the version number to something like 1.0.1-2.2.0-alpha just to ensure you are grabbing the correct jar file.

@uKL
Copy link

uKL commented Jul 22, 2016

It's easier to rely on a JAR dependency (I don't have to compile it each time on my CI). But thanks!

@ubuntudroid
Copy link

Is this to be merged and incorporated into a release anytime soon? Just stumbled over this issue while setting up spock for our Android project.

@Naitbit
Copy link
Contributor Author

Naitbit commented Sep 16, 2016

AFAIK it will be merged once build tools/AS 2.2 will be released. They are currently at RC so it will probably be soon.

@ubuntudroid
Copy link

Awesome, that's great to hear! :) Then we'll probably postpone our
experiments until then.

On Fri, 16 Sep 2016, 18:07 Sebastian Kacprzak, notifications@github.com
wrote:

AFAIK it will be merged once build tools/AS 2.2 will be released. They are
currently at RC so it will probably be soon.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#118 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAfuu8lNzBeQlbWXaJoLvZanPNBYzYCPks5qqr7AgaJpZM4JQsml
.

@@ -27,7 +27,7 @@ import static groovyx.internal.TestProperties.compileSdkVersion
* Complete test suite to ensure the plugin works with the different versions of android gradle plugin.
* This will only be run if the system property of 'allTests' is set to true
*/
@IgnoreIf({ !allTests })
@IgnoreIf({ false })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No good reason, it was accident. I'll revert that. I wanted to make sure that this tests run locally, but unfortunately I did up committing that.

@AndrewReitz
Copy link
Collaborator

Can you bump to 2.2.0-rc2 and rebase so I can put this into master. The people can try it out as a snapshot.

@Naitbit
Copy link
Contributor Author

Naitbit commented Sep 19, 2016

@pieces029 I did bump the build tools version, but now I have issue with
should compile android app with* tests failing when the gradle version is different than 2.14.1. Adding System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true' makes them pass but I'm not sure whether it is acceptable solution. Please take a look, you may find a better one.

@AndrewReitz
Copy link
Collaborator

Which test is failing? I've seen this before where the Android Team changes external dependencies so older tests need to be changed a little bit.

@Naitbit
Copy link
Contributor Author

Naitbit commented Sep 19, 2016

Failed tests

    FullCompilationSpec. should compile android app with java:1.6, android plugin:1.1.0, gradle version: 2.10
    FullCompilationSpec. should compile android app with java:1.6, android plugin:1.3.0, gradle version: 2.10
    FullCompilationSpec. should compile android app with java:1.6, android plugin:1.5.0, gradle version: 2.10
    FullCompilationSpec. should compile android app with java:1.7, android plugin:1.5.0, gradle version: 2.11
    FullCompilationSpec. should compile android app with java:1.7, android plugin:1.5.0, gradle version: 2.12
    FullCompilationSpec. should compile android app with java:1.7, android plugin:2.0.0, gradle version: 2.13
    FullCompilationSpec. should compile android app with java:1.7, android plugin:2.1.2, gradle version: 2.14
    FullCompilationSpec. should compile android library with java:1.6 and android plugin:1.1.0, gradle version:2.10
    FullCompilationSpec. should compile android library with java:1.6 and android plugin:1.3.0, gradle version:2.10
    FullCompilationSpec. should compile android library with java:1.6 and android plugin:1.5.0, gradle version:2.10
    FullCompilationSpec. should compile android library with java:1.7 and android plugin:1.5.0, gradle version:2.10
    FullCompilationSpec. should compile android library with java:1.7 and android plugin:1.5.0, gradle version:2.11
    FullCompilationSpec. should compile android library with java:1.7 and android plugin:1.5.0, gradle version:2.12
    FullCompilationSpec. should compile android library with java:1.7 and android plugin:2.0.0, gradle version:2.13
    FullCompilationSpec. should compile android library with java:1.7 and android plugin:2.1.2, gradle version:2.14

Reason:

Expected no exception to be thrown, but got 'org.gradle.testkit.runner.UnexpectedBuildFailure'
    at spock.lang.Specification.noExceptionThrown(Specification.java:118)
    at groovyx.functional.FullCompilationSpec.should compile android app with java:#javaVersion, android plugin:#androidPluginVersion, gradle version: #gradleVersion(FullCompilationSpec.groovy:225)
Caused by: org.gradle.testkit.runner.UnexpectedBuildFailure: Unexpected build execution failure in /tmp/junit1549353321413592455 with arguments [assemble, test]

Output:

FAILURE: Build failed with an exception.

* Where:
Build file '/tmp/junit1549353321413592455/build.gradle' line: 13

* What went wrong:
A problem occurred evaluating root project 'test-app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 2.14.1. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in /home/sebastian/projects/nait-clone/groovy-android-gradle-plugin/groovy-android-gradle-plugin/gradle/wrapper/gradle-wrapper.properties to gradle-2.14.1-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.669 secs

    at org.gradle.testkit.runner.internal.DefaultGradleRunner$1.execute(DefaultGradleRunner.java:222)
    at org.gradle.testkit.runner.internal.DefaultGradleRunner$1.execute(DefaultGradleRunner.java:219)
    at org.gradle.testkit.runner.internal.DefaultGradleRunner.run(DefaultGradleRunner.java:282)
    at org.gradle.testkit.runner.internal.DefaultGradleRunner.build(DefaultGradleRunner.java:219)
    at groovyx.functional.FunctionalSpec.runWithVersion(FunctionalSpec.groovy:45)
    at groovyx.functional.FullCompilationSpec.should compile android app with java:#javaVersion, android plugin:#androidPluginVersion, gradle version: #gradleVersion(FullCompilationSpec.groovy:222)

@AndrewReitz
Copy link
Collaborator

Whoa, so it looks like they all need 2.14.1?

@AndrewReitz
Copy link
Collaborator

Could you squash your commits and I'll get this merged in? I take a look at the weird gradle compatibility stuff later.

- This commit also updates wrapper to 2.14.1 which is required by newer build tools
- It possibly introduces compatiblity problems for older gradle wrapper versions
@Naitbit
Copy link
Contributor Author

Naitbit commented Sep 19, 2016

Sure, I've squashed the commits. Thanks for taking a look on a compatibility issue.

@AndrewReitz
Copy link
Collaborator

Cool, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants