-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
126 lines (109 loc) · 3.71 KB
/
build.gradle
File metadata and controls
126 lines (109 loc) · 3.71 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
plugins {
id 'java'
id 'application'
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
id 'maven-publish'
id 'signing'
}
group = 'io.ason'
version = '1.0.0'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
sourceCompatibility = JavaVersion.toVersion(21)
targetCompatibility = JavaVersion.toVersion(21)
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.junit.jupiter:junit-jupiter:5.12.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'com.google.code.gson:gson:2.12.1'
// Kotlin helpers are bundled in the main artifact for a simpler distribution model.
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ['--add-modules', 'jdk.incubator.vector']
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
jvmArgs += ['--add-modules', 'jdk.incubator.vector']
testLogging {
events 'PASSED', 'SKIPPED', 'FAILED'
showStandardStreams = true
exceptionFormat = 'full'
}
}
tasks.withType(JavaExec).configureEach {
jvmArgs += ['--add-modules', 'jdk.incubator.vector']
}
tasks.withType(Javadoc).configureEach {
options.addStringOption('-add-modules', 'jdk.incubator.vector')
options.addBooleanOption('Xdoclint:none', true)
}
application {
mainClass = 'io.ason.examples.BasicExample'
}
// Example tasks
['BasicExample', 'ComplexExample', 'BenchExample', 'CrossCompatExample'].each { name ->
tasks.register("run${name}", JavaExec) {
group = 'application'
description = "Run ${name}"
classpath = sourceSets.main.runtimeClasspath
mainClass = "io.ason.examples.${name}"
jvmArgs += ['--add-modules', 'jdk.incubator.vector']
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = 'ason-java'
pom {
name = 'ason-java'
description = 'High-performance ASON (Array-Schema Object Notation) encoder/decoder for Java and Kotlin.'
url = 'https://github.com/ason-lab/ason/tree/main/ason-java'
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'ason'
name = 'ason contributors'
}
}
scm {
connection = 'scm:git:https://github.com/ason-lab/ason.git'
developerConnection = 'scm:git:ssh://git@github.com/ason-lab/ason.git'
url = 'https://github.com/ason-lab/ason/tree/main/ason-java'
}
}
}
}
repositories {
maven {
name = 'sonatype'
url = uri('https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/')
credentials {
username = System.getenv('SONATYPE_USERNAME') ?: findProperty('sonatypeUsername')
password = System.getenv('SONATYPE_PASSWORD') ?: findProperty('sonatypePassword')
}
}
}
}
signing {
def signingKey = System.getenv('SIGNING_KEY') ?: findProperty('signingKey')
def signingPassword = System.getenv('SIGNING_PASSWORD') ?: findProperty('signingPassword')
if (signingKey) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
}