Skip to content

Commit e223379

Browse files
committed
fix: Fix maven not found. (#61) (#60)
1 parent efca2a0 commit e223379

File tree

1 file changed

+1
-77
lines changed

1 file changed

+1
-77
lines changed

android/build.gradle

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def safeExtGet(prop, fallback) {
2020
}
2121

2222
apply plugin: 'com.android.library'
23-
apply plugin: 'maven'
23+
apply plugin: 'maven-publish'
2424

2525
buildscript {
2626
// The Android Gradle plugin is only required when opening the android folder stand-alone.
@@ -38,9 +38,6 @@ buildscript {
3838
}
3939
}
4040

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

0 commit comments

Comments
 (0)