Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Gradle upgrade hint #116

Merged
merged 2 commits into from
May 2, 2017
Merged

Gradle upgrade hint #116

merged 2 commits into from
May 2, 2017

Conversation

passsy
Copy link
Contributor

@passsy passsy commented Apr 14, 2017

based on top of #115

Adds a warning when this plugin will be used with an unsupported Gradle version instead of a hard crash.

Example with Gradle 3.3:

Before

Pascals-MBP:android-base pascalwelsch$ ./gradlew clean bundleRelease bintrayUpload  -PbintrayUser=USER -PbintrayKey=PASSWORD -PdryRun=true
...
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':library'.
> Failed to notify project evaluation listener.
   > org/gradle/api/internal/component/UsageContext

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

BUILD FAILED

Now

./gradlew clean works without error but prints message

./gradlew clean bundleRelease bintrayUpload prints message but can't publish a release

Pascals-MBP:android-base pascalwelsch$ ./gradlew clean bundleRelease bintrayUpload  -PbintrayUser=USER -PbintrayKey=PASSWORD -PdryRun=true
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.

**************************************
WARNING: Gradle 3.3 not supported by bintray-release plugin. Update required!

The bintray-release plugin doesn't support version of Gradle below 3.4 for Android libraries. Please upgrade to Gradle 3.4 or later.
The last bintray-release plugin supporting Gradle 3.3 is 'com.novoda:bintray-release:4.0'

Upgrade Gradle:
./gradlew wrapper --gradle-version 3.5 --distribution-type all

The bintray-release plugin can't create a Publication for your Android Library with Gradle 3.3!
**************************************
                        
Publication release not found in project :library.
:library:clean
...
:library:bundleRelease
:library:bintrayUpload
:library:bintrayUpload: Could not find publication: release.

@stefanhoth
Copy link
Contributor

Can one of the admins review this PR?

// detected Gradle 3.3 or smaller
// show message for required gradle upgrade
// details: https://github.com/novoda/bintray-release/issues/112
System.err.println("""
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure but if we know that it will going ti fail anyways. Instead of printing, we can also do throw new GradleException with this message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with failing in configuration phase is that you can't even upgrade with ./gradlew wrapper --gradle-version 3.5 because it will fail, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upgrade not possible with GradleException

Pascals-MBP:android-base pascalwelsch$ ./gradlew wrapper --gradle-version 3.5 --distribution-type allThe JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':library'.
> 
  **************************************
  WARNING: Gradle 3.3 not supported by bintray-release plugin. Update required!
  
  The bintray-release plugin doesn't support version of Gradle below 3.4 for Android libraries. Please upgrade to Gradle 3.4 or later.
  The last bintray-release plugin supporting Gradle 3.3 is 'com.novoda:bintray-release:4.0'
  
  Upgrade Gradle:
  ./gradlew wrapper --gradle-version 3.5 --distribution-type all
  
  The bintray-release plugin can't create a Publication for your Android Library with Gradle 3.3!
  **************************************
                          

* 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: 0.655 secs

Copy link
Contributor

Choose a reason for hiding this comment

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

Haha 😂 never thought about that. Very true.

@ouchadam
Copy link
Contributor

@hal9002 ok to test

@StefMa
Copy link
Contributor

StefMa commented May 2, 2017

Anything left which prevent to merge it? 🤔
@tasomaniac

@tasomaniac
Copy link
Contributor

@StefMa I was waiting for another review maybe. But I think it is simple enough. Let's 🚢 it.

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

Successfully merging this pull request may close these issues.

5 participants