|
1 | 1 | import me.champeau.jmh.JmhBytecodeGeneratorTask |
2 | 2 | import org.gradle.internal.os.OperatingSystem |
3 | 3 | import org.ajoberstar.grgit.Grgit |
| 4 | +import java.time.Duration |
4 | 5 |
|
5 | 6 | plugins { |
6 | 7 | id 'java' |
7 | 8 | id 'scala' |
8 | 9 | id 'me.champeau.jmh' version '0.7.1' |
9 | 10 | id 'org.ajoberstar.grgit' version '5.2.0' |
| 11 | + id 'pl.allegro.tech.build.axion-release' version '1.15.4' |
| 12 | + id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' |
| 13 | + id 'maven-publish' |
| 14 | + id 'signing' |
10 | 15 | } |
11 | 16 |
|
12 | 17 | group = 'org.simdjson' |
13 | | -version = '0.0.1-SNAPSHOT' |
| 18 | +version = scmVersion.version |
| 19 | + |
| 20 | +scmVersion { |
| 21 | + versionCreator('versionWithBranch') |
| 22 | +} |
14 | 23 |
|
15 | 24 | repositories { |
16 | 25 | mavenCentral() |
|
20 | 29 | toolchain { |
21 | 30 | languageVersion = JavaLanguageVersion.of(20) |
22 | 31 | } |
| 32 | + withJavadocJar() |
| 33 | + withSourcesJar() |
23 | 34 | } |
24 | 35 |
|
25 | 36 | ext { |
@@ -105,6 +116,65 @@ jmh { |
105 | 116 | } |
106 | 117 | } |
107 | 118 |
|
| 119 | +publishing { |
| 120 | + publications { |
| 121 | + mavenJava(MavenPublication) { |
| 122 | + pom { |
| 123 | + name = project.name |
| 124 | + description = 'A Java version of simdjson, a high-performance JSON parser utilizing SIMD instructions.' |
| 125 | + url = 'https://github.com/simdjson/simdjson-java' |
| 126 | + issueManagement { |
| 127 | + system = 'GitHub Issue Tracking' |
| 128 | + url = 'https://github.com/simdjson/simdjson-java/issues' |
| 129 | + } |
| 130 | + licenses { |
| 131 | + license { |
| 132 | + name = 'The Apache License, Version 2.0' |
| 133 | + url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' |
| 134 | + } |
| 135 | + } |
| 136 | + developers { |
| 137 | + developer { |
| 138 | + id = 'piotrrzysko' |
| 139 | + name = 'Piotr Rżysko' |
| 140 | + |
| 141 | + } |
| 142 | + } |
| 143 | + scm { |
| 144 | + url = 'https://github.com/simdjson/simdjson-java' |
| 145 | + connection = 'scm:[email protected]:simdjson/simdjson-java.git' |
| 146 | + developerConnection = 'scm:[email protected]:simdjson/simdjson-java.git' |
| 147 | + } |
| 148 | + } |
| 149 | + } |
| 150 | + } |
| 151 | +} |
| 152 | + |
| 153 | +if (System.getenv('GPG_KEY_ID')) { |
| 154 | + signing { |
| 155 | + useInMemoryPgpKeys( |
| 156 | + System.getenv('GPG_KEY_ID'), |
| 157 | + System.getenv('GPG_PRIVATE_KEY'), |
| 158 | + System.getenv('GPG_PRIVATE_KEY_PASSWORD') |
| 159 | + ) |
| 160 | + sign publishing.publications.mavenJava |
| 161 | + } |
| 162 | +} |
| 163 | + |
| 164 | +nexusPublishing { |
| 165 | + repositories { |
| 166 | + sonatype { |
| 167 | + nexusUrl = uri('https://s01.oss.sonatype.org/service/local/') |
| 168 | + snapshotRepositoryUrl = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/') |
| 169 | + stagingProfileId = '3c0bbfe420699e' |
| 170 | + username = System.getenv('SONATYPE_USERNAME') |
| 171 | + password = System.getenv('SONATYPE_PASSWORD') |
| 172 | + } |
| 173 | + } |
| 174 | + connectTimeout = Duration.ofMinutes(3) |
| 175 | + clientTimeout = Duration.ofMinutes(3) |
| 176 | +} |
| 177 | + |
108 | 178 | def getBooleanProperty(String name, boolean defaultValue) { |
109 | 179 | Boolean.valueOf((project.findProperty(name) ?: defaultValue) as String) |
110 | 180 | } |
|
0 commit comments