Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

fix(deps, android)!: switch to local maven repo for aar dependency #370

Merged
merged 4 commits into from
Sep 12, 2021

Conversation

mikehardy
Copy link
Collaborator

Fixes #151
Fixes notifee/documentation#8

BREAKING CHANGE: add

maven { 
  url "$rootDir/../node_modules/@notifee/react-native/android/libs" }
}

to the group of repositories inside allprojects in android/build.gradle

It will probably look like this after:

allprojects {
  task downloadDependencies() {
    description 'Download all dependencies to the Gradle cache'
  }

  repositories {
    google()
    mavenLocal()
    maven {
      // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
      url("$rootDir/../node_modules/react-native/android")
    }
    maven {
      // Android JSC is installed from npm
      url("$rootDir/../node_modules/jsc-android/dist")
    }
    maven {
      url "$rootDir/../node_modules/detox/Detox-android"
    }
    maven {                                                               // <--- THESE ARE THE NEW LINES
      url "$rootDir/../node_modules/@notifee/react-native/android/libs"   // <--- THESE ARE THE NEW LINES
    }                                                                     // <--- THESE ARE THE NEW LINES
    jcenter()
  }

}

@mikehardy
Copy link
Collaborator Author

I'm test integrating this into a work project to make sure it's good - first attempt to test it indicated it is not! :-)
I'll mark it for review when it's ready

@mikehardy mikehardy force-pushed the @mikehardy/rn-aar-in-local-repo branch 2 times, most recently from fe6c89b to 5f8a568 Compare August 27, 2021 03:04
@mikehardy
Copy link
Collaborator Author

Okay, this works for me in my project with this reference:

    "@notifee/react-native": "github:notifee/react-native-notifee#5f8a5688b4faf56648f60696243681e3837d7715",

...and this in postinstall so it works from source:

    "postinstall": "patch-package && cd node_modules/@notifee/react-native && yarn"

...given I have this in my android/build.gradle:

allprojects {
    repositories {
       // ...other repositories here...
        maven {
            url("$rootDir/../node_modules/@notifee/react-native/android/libs")
        }

I think it is good to go but it is a breaking change and we can't tell people in enough places about this little thing they need to add in android/build.gradle ☝️ - the changelog, the release notes, everywhere...

@mikehardy mikehardy marked this pull request as ready for review August 27, 2021 03:35
mikehardy added a commit to notifee/documentation that referenced this pull request Aug 27, 2021
@mikehardy mikehardy force-pushed the @mikehardy/rn-aar-in-local-repo branch from 5f8a568 to 9a07693 Compare August 27, 2021 19:18
Fixes #151
Fixes notifee/documentation#8

BREAKING CHANGE: add "maven { url "$rootDir/../node_modules/@notifee/react-native/android/libs" }" to "repositories" in "android/build.gradle"
@mikehardy mikehardy force-pushed the @mikehardy/rn-aar-in-local-repo branch from 9a07693 to f94edfa Compare August 27, 2021 19:20
@helenaford helenaford merged commit d0af097 into master Sep 12, 2021
helenaford added a commit to notifee/documentation that referenced this pull request Sep 12, 2021
…n android (#17)

also added release note block for future release

Related invertase/notifee#107 and invertase/react-native-notifee#370

Co-authored-by: Helena Ford <helenaellieford@gmail.com>
Salakar pushed a commit to invertase/notifee that referenced this pull request Sep 23, 2021
…n android (#17)

also added release note block for future release

Related #107 and invertase/react-native-notifee#370

Co-authored-by: Helena Ford <helenaellieford@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants