-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
134 lines (119 loc) · 4.6 KB
/
build.gradle
File metadata and controls
134 lines (119 loc) · 4.6 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
apply plugin: 'com.android.library'
apply plugin: "de.mannodermaus.android-junit5"
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'
System.setProperty("line.separator", "\n")
Properties versionProps = new Properties()
def versionPropsFile = file('../app/version.properties')
if (versionPropsFile.exists()) {
versionProps.load(new FileInputStream(versionPropsFile))
}
int vcode = Integer.parseInt((versionProps['VERSION_CODE'] == null || versionProps['VERSION_CODE'].startsWith('$')) ? String.valueOf((int) ((System.currentTimeMillis() / 1000 / 60) - 26_797_800)) : versionProps['VERSION_CODE'])
String vname = (versionProps['VERSION_NAME'] == null || versionProps['VERSION_NAME'].startsWith('$')) ? '3.0.0-dev' : versionProps['VERSION_NAME']
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.secretKeyRingFile"] = ''
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''
ext["signing.keyId"] = System.getenv('SIGNING_KEYID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_RINGFILE')
ext["ossUsername"] = System.getenv('OSS_USERNAME')
ext["ossPassword"] = System.getenv('OSS_PASSWORD')
jacoco {
toolVersion = "0.8.7"
}
android {
compileSdk 34
defaultConfig {
minSdkVersion 24
targetSdkVersion 35
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
buildConfigField 'int', 'VERSION_CODE', "${vcode}"
buildConfigField 'String', 'VERSION_NAME', "\"${vname}\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
testOptions {
unitTests.returnDefaultValues = true
}
namespace 'com.github.frimtec.android.securesmsproxyapi'
}
tasks.register('sourceJar', Jar) {
from android.sourceSets.main.java.srcDirs
}
publishing {
publications {
release(MavenPublication) {
groupId 'com.github.frimtec'
artifactId 'secure-sms-proxy-api'
version vname
artifact(sourceJar)
artifact("$buildDir/outputs/aar/securesmsproxyapi-release.aar")
pom {
name = 'Secure SMS Proxy API'
description = 'API to integrate S2MSP (Secure SMS Proxy) into an android application.'
url = 'https://github.com/frimtec/secure-sms-proxy'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'frimtec'
name = 'Markus Friedli'
email = 'frimtec@gmx.ch'
url = 'https://github.com/frimtec'
}
}
scm {
connection = 'scm:git:git@github.com:frimtec/secure-sms-proxy'
developerConnection = 'scm:git:git@github.com:frimtec/secure-sms-proxy'
url = 'https://github.com/frimtec/secure-sms-proxy'
}
issueManagement {
system = 'github'
url = 'https://github.com/frimtec/secure-sms-proxy/issues'
}
}
}
}
repositories {
maven {
name = "sonatype"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username ossUsername
password ossPassword
}
}
}
}
signing {
sign publishing.publications
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.vdurmont:semver4j:3.1.0'
testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.3"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.11.3"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.11.4"
testImplementation "org.assertj:assertj-core:3.26.3"
testImplementation 'org.json:json:20240303'
testImplementation "org.mockito:mockito-core:5.14.2"
androidTestImplementation 'androidx.test:runner:1.6.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}