-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
129 lines (118 loc) · 4.45 KB
/
Copy pathbuild.gradle
File metadata and controls
129 lines (118 loc) · 4.45 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
import java.text.SimpleDateFormat
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'me.champeau.jmh' version '0.7.3'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
compileJava.options.encoding('UTF-8')
withJavadocJar()
withSourcesJar()
}
group = 'com.github.romanqed'
archivesBaseName = 'jsm'
version = System.getenv('JSM_VERSION') ?: '1.0.0'
repositories {
mavenCentral()
}
dependencies {
// Tests
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.10.0'
// Benchmarks
jmhImplementation group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.37'
jmhImplementation group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.37'
// Dependencies
implementation group: 'org.ow2.asm', name: 'asm', version: '9.8'
implementation group: 'com.github.romanqed', name: 'asm-sorter', version: '1.0.0'
implementation group: 'com.github.romanqed', name: 'switchgen', version: '1.0.2'
api group: 'com.github.romanqed', name: 'jeflect-loader', version: '1.1.2'
}
test {
useJUnitPlatform()
}
jar {
manifest {
var date = new Date()
var javaVersion = System.getProperty("java.version")
var vmVendor = System.getProperty("java.vm.vendor")
var vmVersion = System.getProperty("java.vm.version")
attributes(
'Created-By': String.format("%s (%s %s)", javaVersion, vmVendor, vmVersion),
'Gradle-Version': "Gradle $gradle.gradleVersion",
'Build-Date': new SimpleDateFormat("yyyy-MM-dd").format(date),
'Build-Time': new SimpleDateFormat("HH:mm:ss.SSSZ").format(date),
'Built-By': 'Roman Bakaldin',
'Bundle-Name': 'Java State Machine',
'Bundle-Version': archiveVersion,
'Bundle-SymbolicName': archivesBaseName,
'Implementation-Title': archivesBaseName,
'Implementation-Vendor': 'github.com/romanqed',
'Implementation-Version': archiveVersion,
'Specification-Title': archivesBaseName,
'Specification-Vendor': 'github.com/romanqed',
'Specification-Version': archiveVersion
)
}
}
signing {
sign publishing.publications
}
publishing {
publications {
mavenJava(MavenPublication) {
// Specify artifacts
artifactId = archivesBaseName
groupId = group
version = version
from components.java
// Configure pom
pom {
name.set(archivesBaseName)
description.set('A lightweight library that allows you to create ' +
'fast finite state machine according to a given scheme.')
url.set('https://github.com/RomanQed/jsm')
organization {
name.set('com.github.romanqed')
url.set('https://github.com/RomanQed/')
}
issueManagement {
system.set('GitHub')
url.set('https://github.com/RomanQed/jsm/issues')
}
licenses {
license {
name.set('Apache License 2.0')
url.set('https://github.com/RomanQed/jsm/blob/main/LICENSE')
}
}
scm {
url.set('https://github.com/RomanQed/jsm')
connection.set('scm:https://github.com/RomanQed/jsm.git')
developerConnection.set('scm:https://github.com/RomanQed/jsm.git')
}
developers {
developer {
id.set('RomanQed')
name.set('Roman Bakaldin')
email.set('gbakaldin@gmail.com')
}
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = centralUsername
password = centralPassword
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}