Skip to content

Commit 70879b1

Browse files
committed
updated packages
1 parent ecada45 commit 70879b1

File tree

4 files changed

+39
-57
lines changed

4 files changed

+39
-57
lines changed

android/build.gradle

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,33 @@
11
// android/build.gradle
22

3-
// based on:
4-
//
5-
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
6-
// original location:
7-
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
8-
//
9-
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
10-
// original location:
11-
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
12-
13-
def DEFAULT_COMPILE_SDK_VERSION = 28
14-
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
15-
def DEFAULT_MIN_SDK_VERSION = 16
16-
def DEFAULT_TARGET_SDK_VERSION = 28
17-
183
def safeExtGet(prop, fallback) {
194
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
205
}
216

22-
apply plugin: 'com.android.library'
23-
apply plugin: 'maven'
24-
257
buildscript {
268
// The Android Gradle plugin is only required when opening the android folder stand-alone.
279
// This avoids unnecessary downloads and potential conflicts when the library is included as a
2810
// module dependency in an application project.
29-
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
3011
if (project == rootProject) {
3112
repositories {
3213
google()
3314
jcenter()
3415
}
3516
dependencies {
36-
classpath 'com.android.tools.build:gradle:3.4.1'
17+
classpath 'com.android.tools.build:gradle:4.1.1'
3718
}
3819
}
3920
}
4021

4122
apply plugin: 'com.android.library'
42-
apply plugin: 'maven'
23+
apply plugin: 'maven-publish'
24+
25+
// Matches values in recent template from React Native 0.70
26+
// https://github.com/facebook/react-native/blob/0.70-stable/template/android/build.gradle#L5-L9
27+
def DEFAULT_COMPILE_SDK_VERSION = 31
28+
def DEFAULT_BUILD_TOOLS_VERSION = "31.0.0"
29+
def DEFAULT_MIN_SDK_VERSION = 21
30+
def DEFAULT_TARGET_SDK_VERSION = 31
4331

4432
android {
4533
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -56,22 +44,28 @@ android {
5644
}
5745

5846
repositories {
59-
// ref: https://www.baeldung.com/maven-local-repository
60-
mavenLocal()
6147
maven {
6248
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63-
url "$rootDir/../node_modules/react-native/android"
49+
url("$rootDir/../node_modules/react-native/android")
6450
}
6551
maven {
6652
// Android JSC is installed from npm
67-
url "$rootDir/../node_modules/jsc-android/dist"
53+
url("$rootDir/../node_modules/jsc-android/dist")
54+
}
55+
mavenCentral {
56+
// We don't want to fetch react-native from Maven Central as there are
57+
// older versions over there.
58+
content {
59+
excludeGroup "com.facebook.react"
60+
}
6861
}
6962
google()
70-
jcenter()
63+
maven { url 'https://www.jitpack.io' }
7164
}
7265

7366
dependencies {
74-
compile fileTree(dir: "libs", include: ["*.jar"])
67+
// ref:
68+
// https://github.com/facebook/react-native/blob/0.61-stable/template/android/app/build.gradle#L192
7569
//noinspection GradleDynamicVersion
7670
implementation 'com.facebook.react:react-native:+' // From node_modules
7771
}
@@ -83,7 +77,7 @@ def configureReactNativePom(def pom) {
8377
name packageJson.title
8478
artifactId packageJson.name
8579
version = packageJson.version
86-
group = "com.reactlibrary"
80+
group = "com.ami3go.honeywellscannerinterface"
8781
description packageJson.description
8882
url packageJson.repository.baseUrl
8983

@@ -94,13 +88,6 @@ def configureReactNativePom(def pom) {
9488
distribution 'repo'
9589
}
9690
}
97-
98-
developers {
99-
developer {
100-
id packageJson.author
101-
name packageJson.author
102-
}
103-
}
10491
}
10592
}
10693

@@ -127,10 +114,8 @@ afterEvaluate { project ->
127114

128115
android.libraryVariants.all { variant ->
129116
def name = variant.name.capitalize()
130-
def javaCompileTask = variant.javaCompileProvider.get()
131-
132-
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
133-
from javaCompileTask.destinationDir
117+
task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
118+
from variant.javaCompile.destinationDir
134119
}
135120
}
136121

@@ -139,12 +124,11 @@ afterEvaluate { project ->
139124
archives androidJavadocJar
140125
}
141126

142-
task installArchives(type: Upload) {
143-
configuration = configurations.archives
144-
repositories.mavenDeployer {
145-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
146-
repository url: "file://${projectDir}/../android/maven"
147-
configureReactNativePom pom
127+
publishing {
128+
publications {
129+
maven(MavenPublication) {
130+
artifact androidSourcesJar
131+
}
148132
}
149133
}
150134
}

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#Wed Jan 15 14:51:07 MSK 2020
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
1+
#Mon Oct 03 15:48:11 BST 2022
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
33
distributionBase=GRADLE_USER_HOME
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-honeywell-scanner-v2",
33
"title": "React Native Honeywell Scanner-v2",
4-
"version": "1.0.2",
4+
"version": "1.1.0",
55
"description": "Bridge to use the Honeywell scanner",
66
"main": "dist/index.js",
77
"types": "dist/index.d.ts",
@@ -36,12 +36,12 @@
3636
"readmeFilename": "README.md",
3737
"peerDependencies":
3838
{
39-
"react": "16.*",
39+
"react": "18.*",
4040
"react-native": "0.*"
4141
},
4242
"devDependencies":
4343
{
44-
"react": "16.*",
44+
"react": "18.*",
4545
"react-native": "0.*"
4646
}
4747
}

yarn.lock

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,7 +3250,7 @@ prompts@^2.4.0:
32503250
kleur "^3.0.3"
32513251
sisteransi "^1.0.5"
32523252

3253-
prop-types@^15.6.2, prop-types@^15.7.2:
3253+
prop-types@^15.7.2:
32543254
version "15.7.2"
32553255
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
32563256
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -3341,14 +3341,12 @@ react-refresh@^0.4.0:
33413341
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53"
33423342
integrity sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA==
33433343

3344-
react@16.*:
3345-
version "16.14.0"
3346-
resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d"
3347-
integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==
3344+
react@18.*:
3345+
version "18.2.0"
3346+
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
3347+
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
33483348
dependencies:
33493349
loose-envify "^1.1.0"
3350-
object-assign "^4.1.1"
3351-
prop-types "^15.6.2"
33523350

33533351
readable-stream@~2.3.6:
33543352
version "2.3.7"

0 commit comments

Comments
 (0)