Skip to content
Snippets Groups Projects
Commit e4e57260 authored by Taras's avatar Taras
Browse files

Add dependencies scope

parent cf0ac39d
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ apply plugin: 'maven-publish' ...@@ -3,7 +3,7 @@ apply plugin: 'maven-publish'
def groupIdString = "org.matrix.android" def groupIdString = "org.matrix.android"
def artifactIdString = "matrix-sdk-android" def artifactIdString = "matrix-sdk-android"
def versionName = "1.4.27" def versionName = "1.4.34"
def artifactPath = "$buildDir/outputs/aar/$artifactIdString-release.aar" def artifactPath = "$buildDir/outputs/aar/$artifactIdString-release.aar"
def publicationName = "release" def publicationName = "release"
def projectId = "16" def projectId = "16"
...@@ -23,15 +23,19 @@ publishing { ...@@ -23,15 +23,19 @@ publishing {
artifact artifactPath artifact artifactPath
artifact sourceJar artifact sourceJar
// To include project dependencies
pom.withXml { pom.withXml {
def dependencies = asNode().appendNode('dependencies') def dependenciesNode = asNode().appendNode('dependencies')
configurations.getByName("${publicationName}CompileClasspath").getResolvedConfiguration().getFirstLevelModuleDependencies().each { ext.addDependency = { Dependency dep, String scope ->
def dependency = dependencies.appendNode('dependency') if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified")
dependency.appendNode('groupId', it.moduleGroup) return
dependency.appendNode('artifactId', it.moduleName) final dependencyNode = dependenciesNode.appendNode('dependency')
dependency.appendNode('version', it.moduleVersion) dependencyNode.appendNode('groupId', dep.group)
dependencyNode.appendNode('artifactId', dep.name)
dependencyNode.appendNode('version', dep.version)
dependencyNode.appendNode('scope', scope)
} }
configurations.api.getDependencies().each { dep -> addDependency(dep, "compile") }
configurations.implementation.getDependencies().each { dep -> addDependency(dep, "runtime") }
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment