Skip to content

Instantly share code, notes, and snippets.

@zyvpeople
Last active July 30, 2023 12:22
Show Gist options
  • Save zyvpeople/a0092e6dd88691843c9fe57ad38841a9 to your computer and use it in GitHub Desktop.
Save zyvpeople/a0092e6dd88691843c9fe57ad38841a9 to your computer and use it in GitHub Desktop.
react-native-secure-storage@0.1.2 patch for react-native 0.68
diff --git a/node_modules/react-native-secure-storage/android/build.gradle b/node_modules/react-native-secure-storage/android/build.gradle
index fe7d65a..385272e 100644
--- a/node_modules/react-native-secure-storage/android/build.gradle
+++ b/node_modules/react-native-secure-storage/android/build.gradle
@@ -2,17 +2,19 @@
buildscript {
repositories {
jcenter()
+ mavenCentral()
+ mavenLocal()
+ google()
}
dependencies {
// Matches the RN Hello World template
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L8
- classpath 'com.android.tools.build:gradle:2.3.3'
+ classpath 'com.android.tools.build:gradle:7.0.4'
}
}
apply plugin: 'com.android.library'
-apply plugin: 'maven'
android {
compileSdkVersion 26
@@ -36,81 +38,16 @@ repositories {
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21
url "$projectDir/../node_modules/react-native/android"
}
- mavenCentral()
-}
-
-dependencies {
- compile 'com.facebook.react:react-native:+'
- compile 'com.facebook.conceal:conceal:1.1.3@aar'
-}
-
-def configureReactNativePom(def pom) {
- def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
-
- pom.project {
- name packageJson.title
- artifactId packageJson.name
- version = packageJson.version
- group = "li.yunqi.rnsecurestorage"
- description packageJson.description
- url packageJson.repository.baseUrl
-
- licenses {
- license {
- name packageJson.license
- url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
- distribution 'repo'
- }
- }
-
- developers {
- developer {
- id packageJson.author.username
- name packageJson.author.name
- }
+ mavenCentral {
+ // We don't want to fetch react-native from Maven Central as there are
+ // older versions over there.
+ content {
+ excludeGroup "com.facebook.react"
}
}
}
-afterEvaluate { project ->
-
- task androidJavadoc(type: Javadoc) {
- source = android.sourceSets.main.java.srcDirs
- classpath += files(android.bootClasspath)
- classpath += files(project.getConfigurations().getByName('compile').asList())
- include '**/*.java'
- }
-
- task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
- classifier = 'javadoc'
- from androidJavadoc.destinationDir
- }
-
- task androidSourcesJar(type: Jar) {
- classifier = 'sources'
- from android.sourceSets.main.java.srcDirs
- include '**/*.java'
- }
-
- android.libraryVariants.all { variant ->
- def name = variant.name.capitalize()
- task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
- from variant.javaCompile.destinationDir
- }
- }
-
- artifacts {
- archives androidSourcesJar
- archives androidJavadocJar
- }
-
- task installArchives(type: Upload) {
- configuration = configurations.archives
- repositories.mavenDeployer {
- // Deploy to react-native-event-bridge/maven, ready to publish to npm
- repository url: "file://${projectDir}/../android/maven"
-
- configureReactNativePom pom
- }
- }
+dependencies {
+ implementation 'com.facebook.react:react-native:+'
+ implementation 'com.facebook.conceal:conceal:1.1.3@aar'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment