Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingpqi123 committed Sep 19, 2024
1 parent 4bbe5db commit 3e11bbe
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions android/libpag/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,6 @@ publishing {
developerConnection = 'scm:git:ssh://[email protected]/Tencent/libpag.git'
}
}
//withXml 将依赖项添加至pom,否则会找不到依赖的第三方库
pom.withXml {
// for dependencies and exclusions
def dependenciesNode = asNode().appendNode('dependencies')
configurations.api.allDependencies.withType(ModuleDependency) { ModuleDependency dp ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dp.group)
dependencyNode.appendNode('artifactId', dp.name)
dependencyNode.appendNode('version', dp.version)

// for exclusions
if (dp.excludeRules.size() > 0) {
def exclusions = dependencyNode.appendNode('exclusions')
dp.excludeRules.each { ExcludeRule ex ->
def exclusion = exclusions.appendNode('exclusion')
exclusion.appendNode('groupId', ex.group)
exclusion.appendNode('artifactId', ex.module)
}
}
}
}
}
}
repositories {
Expand Down Expand Up @@ -191,6 +170,41 @@ project.afterEvaluate {
include '*.so'
}
}
publishing {
repositories {
}
publications {
aar(MavenPublication) {
groupId project.group
artifactId project.artifactId
version project.version

artifact bundleReleaseAar

//The publication doesn't know about our dependencies, so we have to manually add them to the pom
pom.withXml {
// for dependencies and exclusions
def dependenciesNode = asNode().appendNode('dependencies')
configurations.api.allDependencies.withType(ModuleDependency) { ModuleDependency dp ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dp.group)
dependencyNode.appendNode('artifactId', dp.name)
dependencyNode.appendNode('version', dp.version)

// for exclusions
if (dp.excludeRules.size() > 0) {
def exclusions = dependencyNode.appendNode('exclusions')
dp.excludeRules.each { ExcludeRule ex ->
def exclusion = exclusions.appendNode('exclusion')
exclusion.appendNode('groupId', ex.group)
exclusion.appendNode('artifactId', ex.module)
}
}
}
}
}
}
}
}

buildscript {
Expand Down

0 comments on commit 3e11bbe

Please sign in to comment.