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

Upgrade to gradle 5 #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nganhkhoa
Copy link

Upgrade to work with latest Android Studio and Gradle 5 above. Although there are still many deprecation but this small fix works.

Eta Android 2048 using Gradle 5

The followings is crucial to update next because it will get removed by the end of 2019.

API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
API 'variant.getPreBuild()' is obsolete and has been replaced with 'variant.getPreBuildProvider()'.

The other 40 deprecation and uncheck warnings:
deprecation.log

This OverridingProperty class, OverridingProperty.java, has a lot of new methods but I didn't know how fix other than overriding them with dummy. Some methods don't exist in lower Gradle API.

This PR resolves: #38, #43, #45, #46 (I think they all point to the same problem of higher Android Gradle and Gradle version).

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2019

CLA assistant check
All committers have signed the CLA.

@jneira
Copy link
Contributor

jneira commented Nov 15, 2019

@nganhkhoa many thanks for take care of this long awaited issue of upgrading the plugin to a newer gradle version
At a first glance looks good but this will need to be reviewed and merged by @rahulmutt and/or @carymrobbins
I'll try to test it locally asap

@jneira
Copy link
Contributor

jneira commented Nov 15, 2019

I've build and install the plugin locally with 5.4 (the chosen wrapper) but i've got a compilation error with the lastest gradle 5 (5.6.4). It would be fine for me but there is a resaon to not choose the lastest one?

@nganhkhoa
Copy link
Author

I choose 5.3 to test but didn't think that 5.6 breaks stuff also. I will test on latest Gradle and update.

@jneira
Copy link
Contributor

jneira commented Nov 15, 2019

thanks! also i think the version of the plugins should be changed at least to 0.8.2

@jneira
Copy link
Contributor

jneira commented Nov 15, 2019

The eta android project is a really good example to test the plugin but i wonder if you had the opportunity of test the simple projects under the example folder, they should be updated to use the last plugin version (including the last supported gradlew)

@nganhkhoa
Copy link
Author

nganhkhoa commented Nov 15, 2019

The 5.6.4 errors belongs to OverridingProperty not implement orElse and disallowChanges of Property.

I check the docs and these 2 methods were added on 5.6, so we could have a version 0.8.2 dedicated to 5.5 and below, and 0.8.3 for 5.6.

The 6.0 errors leads to deprecation.log I attached which before were warnings.

If you want to support Gradle 6, I will take another week to produce, though it just came out days ago. But we focus on Gradle 5 first.

@jneira
Copy link
Contributor

jneira commented Nov 15, 2019

I check the docs and these 2 methods were added on 5.6, so we could have a version 0.8.2 dedicated to 5.5 and below, and 0.8.3 for 5.6

That would be great

But we focus on Gradle 5 first.

Agree, this pr could be focused on that.

@jneira
Copy link
Contributor

jneira commented Nov 25, 2019

Hi @nganhkhoa, i've tried to build you android example (in https://github.com/nganhkhoa/gradle-eta/tree/android-example). Add that example is a good idea imo.

I have to make some changes:

  • My build.gradle looks:
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
        classpath 'com.typelead:gradle-eta:latest.release'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        
    }
}

apply plugin: 'com.typelead.eta.android'

eta {
    version = '0.8.6b5'
    etlasVersion = '1.5.0.0'
}
  • Note i've change the way to apply the eta plugin, using the full name of the android plugin instead the base one.
  • I've changed the wrapper of the example to use gradle-5.4.1-bin cause in my tests of this pr i used it for the rest of examples
  • But unfortunaletely i have not an android dev kit installed so i cant finish the building
    • So maybe i will hit the same issue you described in gitter

Could you check if thos changes works for you and include the log of the error if you continue having it

@nganhkhoa
Copy link
Author

Unfortunately that didn't work either. The output of the java compiler arguments -classpath doesn't have the jar of eta. Maybe we miss something in the plugin or it was my commits that breaks this. I will try to find the problem, but if you know where it might be please let me know, I'm still trying to familiar myself with Gradle Plugin development.

java_compiler_args.txt

@nganhkhoa
Copy link
Author

It's been a while, is Eta stable enough to get started working on Android app? I want to continue with this PR.

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.

No value specified for provider
3 participants