Skip to content

Commit

Permalink
Modifications related to version building.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingpqi123 committed Sep 19, 2024
1 parent 6218a45 commit 4bbe5db
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 37 deletions.
60 changes: 25 additions & 35 deletions android/libpag/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,27 @@ 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 All @@ -116,6 +137,10 @@ publishing {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = ""
password = ""
}
}
}
}
Expand Down Expand Up @@ -166,41 +191,6 @@ 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
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "libpag",
"name": "@tencent/libpag",
"version": "4.0.0",
"description": "Portable Animated Graphics",
"main": "lib/libpag.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion web/wechat/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "libpag-miniprogram",
"name": "@tencent/libpag-miniprogram",
"version": "4.0.0",
"description": "Portable Animated Graphics",
"main": "lib/libpag.js",
Expand Down

0 comments on commit 4bbe5db

Please sign in to comment.