diff --git a/android/build.gradle b/android/build.gradle index c1b99d6..bc8ce8a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,41 +1,51 @@ buildscript { - repositories { - jcenter() - google() - } + // 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 { + mavenCentral() + google() + } + def buildGradleVersion = ext.has('buildGradlePluginVersion') ? ext.get('buildGradlePluginVersion') : '4.2.2' - dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + dependencies { + classpath "com.android.tools.build:gradle:$buildGradleVersion" + } } } apply plugin: 'com.android.library' +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion safeExtGet('compileSdkVersion', 30) + buildToolsVersion safeExtGet('buildToolsVersion', '30.0.3') defaultConfig { - minSdkVersion 16 - targetSdkVersion 22 + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 30) versionCode 1 versionName "1.0" } lintOptions { abortOnError false } - sourceSets { - main { - aidl.srcDirs = ['src/main/java'] - } - } } repositories { mavenCentral() + google() + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$rootDir/../node_modules/react-native/android" + } } dependencies { implementation 'com.facebook.react:react-native:+' implementation "com.google.zxing:core:3.3.0" -} \ No newline at end of file +} diff --git a/ios/RNReactNativeLocalBarcodeRecognizer.podspec b/ios/RNReactNativeLocalBarcodeRecognizer.podspec index 9462787..aaf5845 100644 --- a/ios/RNReactNativeLocalBarcodeRecognizer.podspec +++ b/ios/RNReactNativeLocalBarcodeRecognizer.podspec @@ -6,13 +6,13 @@ Pod::Spec.new do |s| s.description = <<-DESC RNReactNativeLocalBarcodeRecognizer DESC - s.homepage = "" + s.homepage = "https://github.com/januslo/react-native-local-barcode-recognizer" s.license = "MIT" # s.license = { :type => "MIT", :file => "FILE_LICENSE" } s.author = { "author" => "author@domain.cn" } s.platform = :ios, "7.0" s.source = { :git => "https://github.com/author/RNReactNativeLocalBarcodeRecognizer.git", :tag => "master" } - s.source_files = "RNReactNativeLocalBarcodeRecognizer/**/*.{h,m}" + s.source_files = "**/*.{h,m}" s.requires_arc = true @@ -21,4 +21,3 @@ Pod::Spec.new do |s| end - \ No newline at end of file diff --git a/package.json b/package.json index dc14223..b53eaaa 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "contributors": [], "repository": { "type": "git", - "url": "https://github.com/januslo/react-native-local-barcode-recognizer" + "url": "https://github.com/KirillPopovsky/react-native-local-barcode-recognizer" }, "bugs": { - "url": "https://github.com/januslo/react-native-local-barcode-recognizer/issues" + "url": "https://github.com/KirillPopovsky/react-native-local-barcode-recognizer/issues" }, "main": "index.js", "scripts": {