From 4ab96d67cebfada001cb23c53e9ff16c747a1014 Mon Sep 17 00:00:00 2001 From: Alec Colville Date: Tue, 26 Jul 2022 11:53:36 +1200 Subject: [PATCH] fix build gradle in prep for rn upgrade --- android/build.gradle | 143 ++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 73 insertions(+), 72 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index dc7927b..0c35876 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -20,7 +20,7 @@ buildscript { } apply plugin: 'com.android.library' -apply plugin: 'maven' +//apply plugin: 'maven' // Matches values in recent template from React Native 0.59 / 0.60 // https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9 @@ -70,73 +70,74 @@ dependencies { implementation 'com.matheranalytics:listener-tracker:1.0.12' // mather analytics } -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.matejdr.matheranalytics" - 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 - task androidJavadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += files(android.bootClasspath) - classpath += files(project.getConfigurations().getByName('compile').asList()) - include '**/*.java' - } - - task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' - from androidJavadoc.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs - include '**/*.java' - } - - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { - from variant.javaCompile.destinationDir - } - } - - 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/maven" - configureReactNativePom pom - } - } -} +// 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.matejdr.matheranalytics" +// 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 +// task androidJavadoc(type: Javadoc) { +// source = android.sourceSets.main.java.srcDirs +// classpath += files(android.bootClasspath) +// classpath += files(project.getConfigurations().getByName('compile').asList()) +// include '**/*.java' +// } + +// task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { +// classifier = 'javadoc' +// from androidJavadoc.destinationDir +// } + +// task androidSourcesJar(type: Jar) { +// classifier = 'sources' +// from android.sourceSets.main.java.srcDirs +// include '**/*.java' +// } + +// android.libraryVariants.all { variant -> +// def name = variant.name.capitalize() +// task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { +// from variant.javaCompile.destinationDir +// } +// } + +// 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/maven" +// configureReactNativePom pom +// } +// } +// } diff --git a/package.json b/package.json index eca3c53..03a9769 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-mather-analytics", "title": "React Native Mather Analytics", - "version": "1.1.3", + "version": "1.1.4", "description": "NZME React Native implementation for mather analytics tracking", "types": "./types/index.d.ts", "main": "./lib/index.js",