Skip to content

Commit ad8ae19

Browse files
committed
update android config + npm dependencies
1 parent 779196a commit ad8ae19

File tree

6 files changed

+2764
-2606
lines changed

6 files changed

+2764
-2606
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ yarn-error.log
1010

1111
# Xcode
1212
#
13+
Pods/
1314
build/
1415
*.pbxuser
1516
!default.pbxuser

RNFileLogger.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Pod::Spec.new do |s|
66
s.name = "RNFileLogger"
77
s.version = package["version"]
88
s.summary = package["description"]
9-
s.homepage = "https://github.com/simontreny/react-native-file-logger"
9+
s.homepage = "https://github.com/BeTomorrow/react-native-file-logger"
1010
s.license = "MIT"
1111
s.authors = { "BeTomorrow" => "streny@betomorrow.com" }
1212
s.platforms = { :ios => "9.0" }
13-
s.source = { :git => "https://github.com/simontreny/react-native-file-logger.git", :tag => "#{s.version}" }
13+
s.source = { :git => "https://github.com/BeTomorrow/react-native-file-logger.git", :tag => "#{s.version}" }
1414

1515
s.source_files = "ios/**/*.{h,c,m,swift}"
1616
s.requires_arc = true

android/build.gradle

Lines changed: 13 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,27 @@
1-
// android/build.gradle
2-
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'
1+
def DEFAULT_COMPILE_SDK_VERSION = 30
2+
def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2'
153
def DEFAULT_MIN_SDK_VERSION = 16
16-
def DEFAULT_TARGET_SDK_VERSION = 28
17-
18-
def safeExtGet(prop, fallback) {
19-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
20-
}
21-
22-
apply plugin: 'com.android.library'
23-
apply plugin: 'maven'
4+
def DEFAULT_TARGET_SDK_VERSION = 30
245

256
buildscript {
26-
// The Android Gradle plugin is only required when opening the android folder stand-alone.
27-
// This avoids unnecessary downloads and potential conflicts when the library is included as a
28-
// module dependency in an application project.
29-
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
307
if (project == rootProject) {
318
repositories {
329
google()
10+
mavenCentral()
3311
jcenter()
3412
}
13+
3514
dependencies {
36-
classpath 'com.android.tools.build:gradle:3.4.1'
15+
classpath 'com.android.tools.build:gradle:3.5.3'
3716
}
3817
}
3918
}
4019

4120
apply plugin: 'com.android.library'
42-
apply plugin: 'maven'
21+
22+
def safeExtGet(prop, fallback) {
23+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
24+
}
4325

4426
android {
4527
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -56,96 +38,20 @@ android {
5638
}
5739

5840
repositories {
59-
// ref: https://www.baeldung.com/maven-local-repository
6041
mavenLocal()
6142
maven {
6243
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63-
url "$rootDir/../node_modules/react-native/android"
64-
}
65-
maven {
66-
// Android JSC is installed from npm
67-
url "$rootDir/../node_modules/jsc-android/dist"
44+
url("$rootDir/../node_modules/react-native/android")
6845
}
6946
google()
47+
mavenCentral()
7048
jcenter()
7149
}
7250

7351
dependencies {
7452
//noinspection GradleDynamicVersion
7553
implementation 'com.facebook.react:react-native:+' // From node_modules
76-
implementation 'org.slf4j:slf4j-api:1.7.25'
54+
implementation 'org.slf4j:slf4j-api:1.7.33'
7755
implementation 'com.github.tony19:logback-android:2.0.0'
7856
}
7957

80-
def configureReactNativePom(def pom) {
81-
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
82-
83-
pom.project {
84-
name packageJson.title
85-
artifactId packageJson.name
86-
version = packageJson.version
87-
group = "com.betomorrow.rnfilelogger"
88-
description packageJson.description
89-
url packageJson.repository.baseUrl
90-
91-
licenses {
92-
license {
93-
name packageJson.license
94-
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
95-
distribution 'repo'
96-
}
97-
}
98-
99-
developers {
100-
developer {
101-
id packageJson.author.username
102-
name packageJson.author.name
103-
}
104-
}
105-
}
106-
}
107-
108-
afterEvaluate { project ->
109-
// some Gradle build hooks ref:
110-
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
111-
task androidJavadoc(type: Javadoc) {
112-
source = android.sourceSets.main.java.srcDirs
113-
classpath += files(android.bootClasspath)
114-
classpath += files(project.getConfigurations().getByName('compile').asList())
115-
include '**/*.java'
116-
}
117-
118-
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
119-
classifier = 'javadoc'
120-
from androidJavadoc.destinationDir
121-
}
122-
123-
task androidSourcesJar(type: Jar) {
124-
classifier = 'sources'
125-
from android.sourceSets.main.java.srcDirs
126-
include '**/*.java'
127-
}
128-
129-
android.libraryVariants.all { variant ->
130-
def name = variant.name.capitalize()
131-
def javaCompileTask = variant.javaCompileProvider.get()
132-
133-
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
134-
from javaCompileTask.destinationDir
135-
}
136-
}
137-
138-
artifacts {
139-
archives androidSourcesJar
140-
archives androidJavadocJar
141-
}
142-
143-
task installArchives(type: Upload) {
144-
configuration = configurations.archives
145-
repositories.mavenDeployer {
146-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
147-
repository url: "file://${projectDir}/../android/maven"
148-
configureReactNativePom pom
149-
}
150-
}
151-
}

0 commit comments

Comments
 (0)