diff --git a/android/build.gradle b/android/build.gradle index 13c7e43..0447a23 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,33 +1,19 @@ +import groovy.json.JsonSlurper - -// android/build.gradle - -// based on: -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle -// original location: -// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle -// -// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle -// 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 = 29 -def DEFAULT_BUILD_TOOLS_VERSION = '29.0.3' +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 = 29 +def DEFAULT_TARGET_SDK_VERSION = 33 def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } apply plugin: 'com.android.library' +// Remove the line below entirely +// apply plugin: 'maven' buildscript { - // 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. - // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies if (project == rootProject) { repositories { google() @@ -39,8 +25,6 @@ buildscript { } } -apply plugin: 'com.android.library' - android { compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) @@ -56,14 +40,11 @@ android { } repositories { - // ref: https://www.baeldung.com/maven-local-repository 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() @@ -71,6 +52,26 @@ repositories { } dependencies { - //noinspection GradleDynamicVersion - implementation 'com.facebook.react:react-native:+' // From node_modules + implementation 'com.facebook.react:react-native:+' +} + +def configureReactNativePom(def pom) { + def packageJson = new JsonSlurper().parseText(file('../package.json').text) + + pom.project { + name packageJson.title + artifactId packageJson.name + version = packageJson.version + group = "com.reactlibrary" + description packageJson.description + url packageJson.repository.baseUrl + + licenses { + license { + name packageJson.license + url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename + distribution 'repo' + } + } + } }