-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifications related to version building.
- Loading branch information
1 parent
6218a45
commit 4bbe5db
Showing
3 changed files
with
27 additions
and
37 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,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 { | ||
|
@@ -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 = "" | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -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 { | ||
|
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
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