parent
efca2a08f8
commit
e2233796f6
@ -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.
|
||||
@ -38,9 +38,6 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven'
|
||||
|
||||
android {
|
||||
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
||||
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
||||
@ -78,76 +75,3 @@ dependencies {
|
||||
implementation 'com.alipay.sdk:alipaysdk-android:15.8.10@aar'
|
||||
implementation fileTree(dir: "libs", include: ["*.aar"])
|
||||
}
|
||||
|
||||
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.uiwjs.alipay"
|
||||
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()
|
||||
def javaCompileTask = variant.javaCompileProvider.get()
|
||||
|
||||
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
|
||||
from javaCompileTask.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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user