Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This lets us say goodbye to Maven Central. This will greatly simplify and speed up the release process as releasing Android artifacts to Maven Central adds a lot of [complexity](https://github.com/facebook/react-native/blob/master/Releases-publish.md) and delays the whole release by several hours when we have to wait for the artifacts to propagate. This diff assumes there's a local Maven repo at `node_modules/react-native/android`. The second part once this lands is to change our `release.sh` script to output the artifacts under `react-native/android` before publishing to npm. This adds 3.7MB to the size of `node_modules` of any app. However, we just download eagerly what we'd normally download later via Gradle. **Test plan** Released RN including a local Maven repo into Sinopia: $ cd react-native # Updated version in gradle.properties to 0.21.0 $ ./gradlew ReactAndroid:installArchives # Moved everything in .m2/repository/com/facebook/react to react-native/android $ ls react-native/android com/facebook/react/react-native/0.21.0/react-native-0.21.0.aar com/facebook/react/react-native/0.21.0/react-native-0.21.0.pom com/facebook/react/react-native/maven-metadata.xml ... # Set version in package.json to 0.21.0 $ npm set registry http://localhost:4873/ $ npm publish Created and ran an app: $ cd /tmp $ react-native init AndroidNpm $ cd AndroidNpm $ react-native run-android It worked. Checked that we're using the artifacts from node_modules/react-native/android: $ cd android $ ./gradlew app:dependencies compile - Classpath for compiling the main sources. +--- com.android.support:appcompat-v7:23.0.1 | \--- com.android.support:support-v4:23.0.1 | \--- com.android.support:support-annotations:23.0.1 \--- com.facebook.react:react-native:+ -> 0.21.0 +--- com.google.code.findbugs:jsr305:3.0.0 +--- com.facebook.stetho:stetho-okhttp:1.2.0 ... Checked that Android Studio can find the source jars (you can navigate to RN sources in Android Studio). Opened the new project as described in the [docs](https://facebook.github.io/react-native/docs/android-setup.html#editing-your-app-s-java-code-in-android-studio). public Reviewed By: bestander Differential Revision: D2912557 fb-gh-sync-id: 251c180518a3fb9bb8e80963b236e982d65533be shipit-source-id: 251c180518a3fb9bb8e80963b236e982d65533be
- Loading branch information
702f999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this allow you to make changes to react android code directly without having to follow the steps at https://facebook.github.io/react-native/docs/android-building-from-source.html#content ?
702f999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mangogogos no, this means the AAR is distributed with npm instead of maven.
702f999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
702f999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mangogogos This commit actually also removed the Android sources from the npm package. Didn't realize they were useful for that use case (I always modify files in the GitHub checkout). Adding them back in the next release: 403176a.
Sorry about removing them in the first place!
702f999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkonicek Won't having the sources in the npm package increase the size? people who want to compile can always clone/install from GitHub.
702f999
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkonicek Seems the
ReactAndroid
folder is4.8M
. IMHO we shouldn't have it in the NPM package.