-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bbe5db
commit 3e11bbe
Showing
1 changed file
with
35 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -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 { | ||
|