mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
fix: correctly flag API dependency on AppCompat for Maven (#1505)
* Correctly flag API dependency on AppCompat for Maven Currently when cordova-android is published to Maven, it lists no dependencies. However, `CordovaActivity` extends `AppCompatActivity` which requires that the AndroidX AppCompat library be available. Marking this as an API dependency (rather than an implementation/compile dependency) should cause the AndroidX AppCompat library to be installed when the cordova-android framework is added to the build.gradle of an existing Android application. * Publish to Maven with proper metadata This allows the Maven publish to pick up information from the android library component and include things like dependencies in the pom.xml file.
This commit is contained in:
parent
954d3e0e75
commit
80f232aa79
@ -75,10 +75,16 @@ android {
|
|||||||
exclude 'META-INF/DEPENDENCIES'
|
exclude 'META-INF/DEPENDENCIES'
|
||||||
exclude 'META-INF/NOTICE'
|
exclude 'META-INF/NOTICE'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
singleVariant('release') {
|
||||||
|
withSourcesJar()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "androidx.appcompat:appcompat:${cordovaConfig.ANDROIDX_APP_COMPAT_VERSION}"
|
api "androidx.appcompat:appcompat:${cordovaConfig.ANDROIDX_APP_COMPAT_VERSION}"
|
||||||
implementation "androidx.webkit:webkit:${cordovaConfig.ANDROIDX_WEBKIT_VERSION}"
|
implementation "androidx.webkit:webkit:${cordovaConfig.ANDROIDX_WEBKIT_VERSION}"
|
||||||
implementation "androidx.core:core-splashscreen:${cordovaConfig.ANDROIDX_CORE_SPLASHSCREEN_VERSION}"
|
implementation "androidx.core:core-splashscreen:${cordovaConfig.ANDROIDX_CORE_SPLASHSCREEN_VERSION}"
|
||||||
}
|
}
|
||||||
|
@ -46,11 +46,7 @@ if (project.hasProperty('signEnabled')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
afterEvaluate {
|
||||||
from android.sourceSets.main.java.srcDirs
|
|
||||||
classifier = 'sources'
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
@ -58,8 +54,7 @@ publishing {
|
|||||||
artifactId = 'framework'
|
artifactId = 'framework'
|
||||||
version = getCordovaAndroidVersion()
|
version = getCordovaAndroidVersion()
|
||||||
|
|
||||||
artifact(sourcesJar)
|
from components.release
|
||||||
artifact("$buildDir/outputs/aar/framework-release.aar")
|
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
name = 'Cordova'
|
name = 'Cordova'
|
||||||
@ -116,6 +111,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.whenTaskAdded {task ->
|
tasks.whenTaskAdded {task ->
|
||||||
if(task.name.contains('sign')) {
|
if(task.name.contains('sign')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user