@@ -3,10 +3,11 @@ plugins {
3
3
id ' jacoco'
4
4
id ' java-library'
5
5
id ' maven-publish'
6
+ id ' signing'
6
7
}
7
8
8
9
group ' com.surrealdb'
9
- version ' 0.2-SNAPSHOT '
10
+ version ' 0.2.0 '
10
11
11
12
repositories {
12
13
mavenCentral()
@@ -30,7 +31,7 @@ configurations {
30
31
31
32
dependencies {
32
33
testImplementation ' org.junit.jupiter:junit-jupiter:5.10.2'
33
- integrationTestImplementation files(" build/libs/surrealdb-0.2-SNAPSHOT .jar" )
34
+ integrationTestImplementation files(" build/libs/surrealdb-0.2.0 .jar" )
34
35
}
35
36
36
37
jacoco {
@@ -64,6 +65,20 @@ javadoc {
64
65
destinationDir = file(" build/reports/javadoc" )
65
66
}
66
67
68
+ tasks. register(' javadocJar' , Jar ) {
69
+ archiveClassifier = ' javadoc'
70
+ from javadoc
71
+ }
72
+
73
+ tasks. register(' sourcesJar' , Jar ) {
74
+ archiveClassifier = ' sources'
75
+ from sourceSets. main. allSource
76
+ }
77
+
78
+ artifacts {
79
+ archives javadocJar, sourcesJar
80
+ }
81
+
67
82
tasks. register(' createCombinedReport' ) {
68
83
dependsOn jacocoTestReport
69
84
dependsOn javadoc
@@ -102,6 +117,16 @@ tasks.register('integrationTest', Test) {
102
117
}
103
118
}
104
119
120
+ project. afterEvaluate {
121
+ def key = System . getenv(' SIGNING_KEY' )
122
+ def _pass = System . getenv(' SIGNING_KEY_PASS' )
123
+
124
+ signing {
125
+ useInMemoryPgpKeys(key, _pass)
126
+ sign publishing. publications. mavenJava
127
+ }
128
+ }
129
+
105
130
publishing {
106
131
repositories {
107
132
maven {
@@ -112,14 +137,65 @@ publishing {
112
137
password = System . getenv(" GITHUB_TOKEN" )
113
138
}
114
139
}
140
+ // maven {
141
+ // name = "OSSRH"
142
+ // def releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
143
+ // def snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
144
+ // url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
145
+ // credentials {
146
+ // username = System.getenv("MAVEN_USERNAME")
147
+ // password = System.getenv("MAVEN_PASSWORD")
148
+ // }
149
+ // }
115
150
}
151
+
116
152
publications {
117
153
mavenJava(MavenPublication ) {
118
154
groupId = project. group
119
155
artifactId = project. rootProject. name
120
156
version = project. version
121
157
158
+ artifact(javadocJar)
159
+ artifact(sourcesJar)
122
160
artifact(" build/libs/${ project.rootProject.name} -${ project.version} .jar" )
161
+
162
+
163
+ pom {
164
+ name = ' SurrealDB Driver'
165
+ packaging = ' jar'
166
+ description = ' The driver for accessing a SurrealDB instance.'
167
+ url = ' https://surrealdb.com/docs/integration/libraries/java'
168
+
169
+ scm {
170
+ connection
= ' scm:git:[email protected] :surrealdb/surrealdb.java.git'
171
+ url = ' https://github.com/surrealdb/surrealdb.java'
172
+ }
173
+
174
+ licenses {
175
+ license {
176
+ name = ' The Apache License, Version 2.0'
177
+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
178
+ }
179
+ }
180
+
181
+ developers {
182
+ developer {
183
+ id = ' tobiemh'
184
+ name = ' Tobie Morgan Hitchcock'
185
+
186
+ }
187
+ developer {
188
+ id = ' phughk'
189
+ name = ' Hugh Kaznowski'
190
+
191
+ }
192
+ developer {
193
+ id = ' emmanuel-keller'
194
+ name = ' Emmanuel Keller'
195
+
196
+ }
197
+ }
198
+ }
123
199
}
124
200
}
125
201
}
0 commit comments