diff --git a/android/build.gradle b/android/build.gradle index b75e84a..638ddab 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,10 +10,11 @@ // original location: // - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle -def DEFAULT_COMPILE_SDK_VERSION = 31 -def DEFAULT_BUILD_TOOLS_VERSION = '31.0.0' +def DEFAULT_COMPILE_SDK_VERSION = 33 +def DEFAULT_BUILD_TOOLS_VERSION = '33.0.0' def DEFAULT_MIN_SDK_VERSION = 21 -def DEFAULT_TARGET_SDK_VERSION = 31 +def DEFAULT_TARGET_SDK_VERSION = 33 +def DEFAULT_NDK_VERSION = "23.1.7779620" def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback @@ -33,11 +34,21 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:7.2.1") + classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("de.undercouch:gradle-download-task:5.0.1") } } + subprojects { project -> + afterEvaluate { + if ((project.plugins.hasPlugin('android') || project.plugins.hasPlugin('android-library'))) { + android { + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + } + } + } + } } apply plugin: 'com.android.library' @@ -49,6 +60,7 @@ android { defaultConfig { minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) + ndkVersion = safeExtGet('ndkVersion', DEFAULT_NDK_VERSION) versionCode 1 versionName "1.0" } @@ -127,7 +139,7 @@ afterEvaluate { project -> // } task androidSourcesJar(type: Jar) { - classifier = 'sources' + archiveClassifier = 'sources' from android.sourceSets.main.java.srcDirs include '**/*.java' } diff --git a/example/.eslintrc.js b/example/.eslintrc.js index 40c6dcd..187894b 100644 --- a/example/.eslintrc.js +++ b/example/.eslintrc.js @@ -1,4 +1,4 @@ module.exports = { root: true, - extends: '@react-native-community', + extends: '@react-native', }; diff --git a/example/.gitignore b/example/.gitignore index ad572e6..513d77d 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -28,6 +28,10 @@ build/ .gradle local.properties *.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore # node.js # @@ -35,12 +39,6 @@ node_modules/ npm-debug.log yarn-error.log -# BUCK -buck-out/ -\.buckd/ -*.keystore -!debug.keystore - # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the @@ -48,12 +46,19 @@ buck-out/ # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/ -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output # Bundle artifact *.jsbundle -# CocoaPods +# Ruby / CocoaPods /ios/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* +# testing +/coverage diff --git a/example/.prettierrc.js b/example/.prettierrc.js index 71bad0e..0d0a89c 100644 --- a/example/.prettierrc.js +++ b/example/.prettierrc.js @@ -1,4 +1,6 @@ module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, printWidth: 99, tabWidth: 2, singleQuote: false, diff --git a/example/App.js b/example/App.tsx similarity index 86% rename from example/App.js rename to example/App.tsx index 8d09424..6835503 100644 --- a/example/App.js +++ b/example/App.tsx @@ -1,8 +1,8 @@ -import * as React from "react"; -import {StyleSheet, View, Button, Platform} from "react-native"; +import React from 'react'; +import { StyleSheet, View, Button, Platform } from "react-native"; import RNSystemSounds from "react-native-system-sounds"; -export default function App() { +export default function App(): JSX.Element { return (