Skip to content

Commit

Permalink
Update and fix Gradle setup (react-native-share#588)
Browse files Browse the repository at this point in the history
* Update .npmignore config

* Update and fix build.gradle setup
  • Loading branch information
friederbluemle authored and jgcmarins committed Nov 20, 2019
1 parent 25f5de6 commit c7287a3
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 39 deletions.
16 changes: 6 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ DerivedData
*.xcuserstate
project.xcworkspace

# Android/IJ
# Android/IntelliJ
#
*.iml
build/
.idea
.gradle
local.properties
*.iml
android/gradle/
android/gradlew
android/gradlew.bat

# Visual Studio
*.VC.db
Expand Down Expand Up @@ -57,11 +61,3 @@ coverage

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
build/
12 changes: 1 addition & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
.babelrc
.flowconfig
.eslintrc
.gitignore
.github/*
.circleci/*
jsconfig.json
commitlint.config.js
changelog.js
assets/*
example/*
example/
10 changes: 10 additions & 0 deletions android/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.iml
.DS_Store
.gradle/
.idea/
.npmignore
build/
gradle/
gradlew
gradlew.bat
local.properties
36 changes: 18 additions & 18 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ def safeExtGet(prop, fallback) {
}

buildscript {
repositories {
google()
maven {
url 'https://maven.google.com'
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
}
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}

Expand All @@ -21,13 +22,9 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 28)

versionCode 1
versionName "1.0.0"
}
lintOptions {
abortOnError false
Expand All @@ -36,17 +33,20 @@ android {
}

repositories {
google()
jcenter()
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"
}
google()
jcenter()
}

dependencies {
implementation "com.facebook.react:react-native:+"
//noinspection GradleCompatible
implementation "com.android.support:appcompat-v7:${safeExtGet('supportLibVersion', '28.0.0')}"
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
}
6 changes: 6 additions & 0 deletions ios/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*/project.xcworkspace/
*/xcuserdata/
.DS_Store
.npmignore
Pods/
build/
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
"type": "git",
"url": "git+https://github.com/react-native-community/react-native-share.git"
},
"main": "index.js",
"files": [
"android",
"components",
"ios",
"windows",
"RNShare.podspec"
],
"devDependencies": {
"@commitlint/cli": "8.1.0",
"@commitlint/config-conventional": "8.1.0",
Expand Down

0 comments on commit c7287a3

Please sign in to comment.