-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
105 lines (94 loc) · 3.96 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
buildscript {
ext.mm_kotlinVersion = "1.7.20"
ext.mm_gradlePluginVersion = "7.2.2"
repositories {
google()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' } // for net.researchgate.release plugin
// huawei maven
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath "com.android.tools.build:gradle:$mm_gradlePluginVersion"
}
}
plugins {
id 'net.researchgate.release' version '2.8.1'
id 'maven-publish'
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id 'org.jetbrains.kotlin.android' version "$mm_kotlinVersion" apply false
id "org.sonarqube" version "4.4.1.3373"
id "jacoco"
id "java"
}
ext {
mm_minSdkVersion = 21
mm_compileSdkVersion = 33
mm_targetSdkVersion = 33
mm_buildToolsVersion = "33.0.0"
mm_androidSdkVersion = "13.2.3"
mm_constraintLayoutVersion = "2.1.4"
mm_appCompatVersion = "1.6.1"
mm_materialVersion = "1.9.0"
mm_coreKtxVersion = "1.9.0"
mm_desugarJdkVersion = "2.0.3"
}
//It's required to be applied here, to have `subprojects.publish` task available
subprojects {
apply plugin: "maven-publish"
}
task updateVersionInReadme {
doLast {
def readmeFile = new File('README.md')
def text = readmeFile.text
readmeFile.withWriter { w ->
w << text.replaceFirst('infobip-mobile-messaging-huawei-sdk:\\d+\\.\\d+\\.\\S+@aar', "infobip-mobile-messaging-huawei-sdk:$version@aar")
}
}
}
afterReleaseBuild.dependsOn updateVersionInReadme
// workaround for `net.researchgate.release` plugin issue:
// https://github.com/researchgate/gradle-release/issues/186
build.dependsOn tasks.getByPath('infobip-mobile-messaging-huawei-inbox-sdk:build')
build.dependsOn tasks.getByPath('infobip-mobile-messaging-huawei-chat-sdk:build')
build.dependsOn tasks.getByPath('infobip-mobile-messaging-huawei-cryptor-migration:build')
build.dependsOn tasks.getByPath(':infobip-mobile-messaging-huawei-sdk:build')
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
username = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : System.getenv('OSSRH_USERNAME')
password = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
stagingProfileId.set(project.hasProperty('sonatypeStagingProfileId') ? project.property('sonatypeStagingProfileId') : System.getenv('SONATYPE_STAGING_PROFILE_ID'))
}
}
connectTimeout = Duration.ofMinutes(3)
clientTimeout = Duration.ofMinutes(3)
}
closeAndReleaseSonatypeStagingRepository.mustRunAfter subprojects.publish
afterReleaseBuild.dependsOn subprojects.publish, closeAndReleaseSonatypeStagingRepository
release {
buildTasks = ['clean', 'build']
git {
requireBranch = ''
pushToRemote = 'origin'
}
}
sonar {
properties {
property "sonar.host.url", "https://sonar.ib-ci.com"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.branch.name", System.getenv('BRANCH_NAME_TO_BUILD')
property "sonar.projectVersion", project.version
property "sonar.projectName", "infobip-mobile-messaging-huawei"
property "sonar.projectKey" , "infobip-mobile-messaging-huawei"
property "sonar.exclusions", "" +
"infobip-mobile-messaging-huawei-demo/**/*, " +
"infobip-mobile-messaging-huawei-cryptor-migration/**/*, " +
"infobip-mobile-messaging-huawei-test/**/*, "
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "" +
"${project.projectDir}/infobip-mobile-messaging-huawei-inbox-sdk/build/reports/jacoco/debugCoverage/debugCoverage.xml, " +
"${project.projectDir}/infobip-mobile-messaging-huawei-sdk/build/reports/jacoco/debugCoverage/debugCoverage.xml, "
}
}