Skip to content

Commit

Permalink
Merge pull request #55 from Widdershin/fix-native-crash-reporting
Browse files Browse the repository at this point in the history
Support [email protected] on Android
  • Loading branch information
Callum-McKay authored Feb 28, 2022
2 parents 040e141 + 2aab8f2 commit 6f376a7
Showing 1 changed file with 41 additions and 39 deletions.
80 changes: 41 additions & 39 deletions sdk/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def safeExtGet(prop, fallback) {
}

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'maven-publish'

buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
Expand All @@ -39,7 +39,7 @@ buildscript {
}

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'maven-publish'

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
Expand Down Expand Up @@ -81,34 +81,6 @@ dependencies {
implementation 'com.jakewharton.timber:timber:4.7.1'
}

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 = "com.raygun.react"
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
}
}
}
}

afterEvaluate { project ->
// some Gradle build hooks ref:
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
Expand All @@ -120,12 +92,12 @@ afterEvaluate { project ->
}

task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from androidJavadoc.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs
include '**/*.java'
}
Expand All @@ -141,15 +113,45 @@ afterEvaluate { project ->

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/lib"
configureReactNativePom pom
publishing {
publications {
maven(MavenPublication) {
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)

artifact androidSourcesJar
artifactId packageJson.name
version packageJson.version

pom {
name = packageJson.title
group = "com.raygun.react"
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
}
}
}
}
}

repositories {
maven {
url "file://${projectDir}/../android/libs"
}
}
}
}

0 comments on commit 6f376a7

Please sign in to comment.