diff --git a/build.gradle b/build.gradle index 3c9eec6cfe9dac4910c8cc1493852f0d0b2cf43d..f3d20ddb0671979e8c3074a4683c7845e60b60df 100644 --- a/build.gradle +++ b/build.gradle @@ -56,7 +56,3 @@ allprojects { kotlinOptions.allWarningsAsErrors = false } } - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/gradle-publish.gradle b/gradle-publish.gradle index beb70ffe15675a9a7efecd5cd29f3bc41a9c9956..760b9ce50af1ae91a32aff0d86c684fdf83ce987 100644 --- a/gradle-publish.gradle +++ b/gradle-publish.gradle @@ -1,40 +1,51 @@ +apply plugin: 'java' apply plugin: 'maven-publish' -def artifactId = "matrix-sdk-android" -def artifactFilePath = "$buildDir/outputs/aar/${artifactId}-release.aar" +def groupIdString = "org.matrix.android" +def artifactIdString = "matrix-sdk-android" +def versionName = "1.4.4" +def artifactPath = "matrix-sdk-android/build/outputs/aar/$artifactIdString-release.aar" def publicationName = "release" - +def projectId = "16" +def token = "e3yxa-_Duy7xLabSa7_z" publishing { publications { - "${publicationName}"(MavenPublication) { - groupId "org.matrix.android" - artifactId "${artifactId}" - version "1.4.4" - artifact "${artifactFilePath}" + "$publicationName"(MavenPublication) { + groupId groupIdString + artifactId artifactIdString + version versionName + artifact artifactPath // To include project dependencies pom.withXml { def dependencies = asNode().appendNode('dependencies') - configurations.getByName("${publicationName}CompileClasspath").getResolvedConfiguration().getFirstLevelModuleDependencies().each { - def dependency = dependencies.appendNode('dependency') - dependency.appendNode('groupId', it.moduleGroup) - dependency.appendNode('artifactId', it.moduleName) - dependency.appendNode('version', it.moduleVersion) + configurations.implementation.allDependencies.each { + if (it.group != null) { + def dependency = dependencies.appendNode('dependency') + dependency.appendNode('groupId', it.moduleGroup) + dependency.appendNode('artifactId', it.moduleName) + dependency.appendNode('version', it.moduleVersion) + } } } } } repositories { maven { - url "https://gitlab.com/api/v4/projects/16/packages/maven" + url "https://gitlab.futo.org/api/v4/projects/$projectId/packages/maven" + name "GitLab" credentials(HttpHeaderCredentials) { name = "Private-Token" - value = "e3yxa-_Duy7xLabSa7_z" + value = token } authentication { header(HttpHeaderAuthentication) } } } +} +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } \ No newline at end of file