-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.gradle
More file actions
130 lines (112 loc) · 4.05 KB
/
build.gradle
File metadata and controls
130 lines (112 loc) · 4.05 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
// Apply necessary plugins
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
// Define the version and group for the Maven package
version = "1.1.5"
group = "net.servicestack"
if (project.hasProperty('versionSuffix')) {
version = "${version}-${versionSuffix}"
}
// Specify dependencies
dependencies {
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'com.squareup.okhttp3:okhttp:3.14.9'
implementation fileTree(include: '*.jar', dir: 'libs')
androidTestImplementation 'junit:junit:4.13.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
}
// Android specific configurations
android {
namespace "net.servicestack.android"
compileSdk 34
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 15
targetSdkVersion 34
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
// Configure the publishing block for Maven Central deployment
publishing {
publications {
mavenJava(MavenPublication) {
artifact("$buildDir/outputs/aar/${project.name}-release.aar")
groupId = group
artifactId = 'android'
version = version
pom {
name = 'ServiceStack.Android'
description = 'A client library to call your ServiceStack webservices for Android clients.'
url = 'https://github.com/ServiceStack/ServiceStack.Java'
licenses {
license {
name = 'The BSD 3-Clause License'
url = 'https://servicestack.net/bsd-license.txt'
}
}
developers {
developer {
id = 'mythz'
name = 'Demis Bellot'
email = 'team@servicestack.net'
}
developer {
id = 'layoric'
name = 'Darren Reid'
email = 'team@servicestack.net'
}
}
scm {
connection = 'https://github.com/ServiceStack/ServiceStack.Java.git'
developerConnection = 'https://github.com/ServiceStack/ServiceStack.Java.git'
url = 'https://github.com/ServiceStack/ServiceStack.Java'
}
}
}
}
repositories {
maven {
name = 'OSSRH'
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = project.findProperty("ossrhPassword") ?: System.getenv("OSSRH_TOKEN")
}
}
maven {
name = 'GitHubPackages'
url = uri("https://maven.pkg.github.com/ServiceStack/ServiceStack.Java")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME_GITHUB")
password = project.findProperty("gpr.token") ?: System.getenv("TOKEN_GITHUB")
}
}
}
}
// Check if the environment variables are set
def signingKey = System.getenv('SIGNING_KEY')
def signingPassword = System.getenv('SIGNING_PASSWORD')
// Conditionally apply the signing plugin and configuration
if (signingKey && signingPassword) {
println "Signing enabled"
signing {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
} else {
println "Signing disabled"
}