Skip to content

Commit 3bc1a1d

Browse files
committed
fix build.gradle
1 parent 9762ede commit 3bc1a1d

3 files changed

Lines changed: 10 additions & 80 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ local.properties
4343
buck-out/
4444
\.buckd/
4545
*.keystore
46-
46+
47+
example/

android/build.gradle

Lines changed: 7 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
def safeExtGet(prop, fallback) {
2-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3-
}
4-
51
buildscript {
62
repositories {
73
google()
84
jcenter()
95
}
6+
def buildGradleVersion = ext.has('buildGradlePluginVersion') ? ext.get('buildGradlePluginVersion') : '3.5.3'
107

118
dependencies {
12-
classpath("com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '3.5.3')}")
9+
classpath "com.android.tools.build:gradle:$buildGradleVersion"
1310
}
1411
}
1512

13+
def safeExtGet(prop, fallback) {
14+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
15+
}
16+
1617
apply plugin: 'com.android.library'
17-
apply plugin: 'maven'
1818

1919
android {
2020
compileSdkVersion safeExtGet('compileSdkVersion', 28)
@@ -38,76 +38,5 @@ repositories {
3838
}
3939

4040
dependencies {
41-
implementation "com.facebook.react:react-native:${safeExtGet('reactnativeVersion', '+')}"
42-
}
43-
44-
def configureReactNativePom(def pom) {
45-
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
46-
47-
pom.project {
48-
name packageJson.title
49-
artifactId packageJson.name
50-
version = packageJson.version
51-
group = "com.bebnev"
52-
description packageJson.description
53-
url packageJson.repository.baseUrl
54-
55-
licenses {
56-
license {
57-
name packageJson.license
58-
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
59-
distribution 'repo'
60-
}
61-
}
62-
63-
developers {
64-
developer {
65-
id packageJson.author
66-
name packageJson.author
67-
}
68-
}
69-
}
70-
}
71-
72-
afterEvaluate { project ->
73-
74-
task androidJavadoc(type: Javadoc) {
75-
source = android.sourceSets.main.java.srcDirs
76-
classpath += files(android.bootClasspath)
77-
classpath += files(project.getConfigurations().getByName('compile').asList())
78-
include '**/*.java'
79-
}
80-
81-
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
82-
classifier = 'javadoc'
83-
from androidJavadoc.destinationDir
84-
}
85-
86-
task androidSourcesJar(type: Jar) {
87-
classifier = 'sources'
88-
from android.sourceSets.main.java.srcDirs
89-
include '**/*.java'
90-
}
91-
92-
android.libraryVariants.all { variant ->
93-
def name = variant.name.capitalize()
94-
task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
95-
from variant.javaCompile.destinationDir
96-
}
97-
}
98-
99-
artifacts {
100-
archives androidSourcesJar
101-
archives androidJavadocJar
102-
}
103-
104-
task installArchives(type: Upload) {
105-
configuration = configurations.archives
106-
repositories.mavenDeployer {
107-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
108-
repository url: "file://${projectDir}/../android/maven"
109-
110-
configureReactNativePom pom
111-
}
112-
}
41+
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
11342
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-user-agent",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "Library that helps you to get mobile application user agent and web view user agent strings.",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)