airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.38k stars 405 forks source link

AndroidX migration #223

Closed carvaq closed 6 years ago

carvaq commented 6 years ago

The processor generates support classes that are no longer compatible with projects running AndroidX. With theses changes the processor will look for and generate AndroidX classes.

Is related to issue #222

AndroidX Release notes

carvaq commented 6 years ago

Hi @felipecsl

I tried fixing the config, but I'm always getting an error about accepting the terms and conditions for the new build tools. On this StackOverflow post they suggest to add yes | sdkmanager --licenses to the travis config. I haven't had the chance to work with travis before, so I'm not entirely sure what the best approach would be.

rossbacher commented 6 years ago

@carvaq Can you try to add this to the travis yml file?

licenses:
    - 'android-sdk-preview-license-.+'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'
carvaq commented 6 years ago

@rossbacher Hi! I did the change and updated all the libs. It's crashing currently because of the processor tests. They don't seem to find some of the imports. I tried to look into it and find a solution, but I'm getting nowhere. I'm not able to find one of the dependencies in the google repo (com.google.android:android). Couldn't we move DeepLinkProcessorTest to a more suitable location?

rossbacher commented 6 years ago

@carvaq I created https://github.com/carvaq/DeepLinkDispatch/pull/1 against your fork. This fixes the problem with the dependency and after that the PR should pass and we will be able to merge it soon.

carvaq commented 6 years ago

Of course! I didn't realize that the android libs are aar. Thank you for fixing it!

rossbacher commented 6 years ago

Thank you @carvaq !

tallnato commented 6 years ago

When are you planning to do a release with this migration?

I was trying to use it through Jitpack, but it seams that the com.github.airbnb.DeepLinkDispatch:deeplinkdispatch:XXX is not being included in the jitpack release https://jitpack.io/com/github/airbnb/DeepLinkDispatch/master-v3.1.1-g0ae5613-9/build.log

semanticer commented 6 years ago

When can we expect this or how can we work around it right now? Thank you for any help @carvaq @rossbacher

rogerhu commented 6 years ago

It's been over a year since a build got pushed (https://oss.sonatype.org/content/repositories/snapshots/com/airbnb/deeplinkdispatch/3.2.0-SNAPSHOT/).

My workaround has been to use composite builds:

a. First, fork this repo.

b. Then update your settings.gradle to reference this project:

includeBuild('../DeepLinkDispatch') {
    dependencySubstitution {
        substitute module("com.airbnb:deeplinkdispatch-processor") with project(':deeplinkdispatch-processor')
        substitute module("com.airbnb:deeplinkdispatch") with project(':deeplinkdispatch')

    }
}

c. Update the dependencies.gradle in this project to match the Android gradle plugin version being used:

+++ b/dependencies.gradle
@@ -6,7 +6,7 @@ def versions = [

 ext.versions = versions
 ext.androidConfig = [
-    agpVersion       : '3.2.0-beta04',
+    agpVersion       : '3.2.0',
rogerhu commented 6 years ago

This PR https://github.com/airbnb/DeepLinkDispatch/pull/230 should also fix JitPack.Io snapshots:

I tested with these Gradle commands:

implementation "com.github.rogerhu.DeepLinkDispatch:deeplinkdispatch:maven-SNAPSHOT"
annotationProcessor "com.github.rogerhu.DeepLinkDispatch:deeplinkdispatch-processor:maven-SNAPSHOT"