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

Add sources jar

parent 2df0327e
No related branches found
No related tags found
No related merge requests found
apply plugin: 'java' apply plugin: 'com.android.library'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
def groupIdString = "org.matrix.android" def groupIdString = "org.matrix.android"
...@@ -9,6 +9,11 @@ def publicationName = "release" ...@@ -9,6 +9,11 @@ def publicationName = "release"
def projectId = "16" def projectId = "16"
def token = "e3yxa-_Duy7xLabSa7_z" def token = "e3yxa-_Duy7xLabSa7_z"
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = "sources"
}
publishing { publishing {
publications { publications {
"$publicationName"(MavenPublication) { "$publicationName"(MavenPublication) {
...@@ -16,17 +21,16 @@ publishing { ...@@ -16,17 +21,16 @@ publishing {
artifactId artifactIdString artifactId artifactIdString
version versionName version versionName
artifact artifactPath artifact artifactPath
artifact sourceJar
// To include project dependencies // To include project dependencies
pom.withXml { pom.withXml {
def dependencies = asNode().appendNode('dependencies') def dependencies = asNode().appendNode('dependencies')
configurations.implementation.allDependencies.each { configurations.getByName("${publicationName}CompileClasspath").getResolvedConfiguration().getFirstLevelModuleDependencies().each {
if (it.group != null) { def dependency = dependencies.appendNode('dependency')
def dependency = dependencies.appendNode('dependency') dependency.appendNode('groupId', it.moduleGroup)
dependency.appendNode('groupId', it.moduleGroup) dependency.appendNode('artifactId', it.moduleName)
dependency.appendNode('artifactId', it.moduleName) dependency.appendNode('version', it.moduleVersion)
dependency.appendNode('version', it.moduleVersion)
}
} }
} }
} }
...@@ -44,8 +48,4 @@ publishing { ...@@ -44,8 +48,4 @@ publishing {
} }
} }
} }
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
} }
\ No newline at end of file
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