-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
117 lines (105 loc) · 2.9 KB
/
build.gradle
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
def getAppVersion = { ->
try (final var gitTagOut = new ByteArrayOutputStream()) {
exec {
commandLine 'git', 'tag', '--points-at', 'HEAD'
standardOutput = gitTagOut
}
final var tagName = gitTagOut.toString().strip()
if (tagName.isBlank()) {
try (final var gitHashOut = new ByteArrayOutputStream()) {
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = gitHashOut
}
return 'git-' + gitHashOut.toString().strip()
}
} else {
return tagName
}
}
} as Object
ext {
VERSION = getAppVersion()
ORG = 'sava-software'
REPO = 'solana-programs'
VCS_URL = 'https://github.com/sava-software/solana-programs'
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'
project.group = 'software.sava'
project.version = "$VERSION"
final JLV = JavaLanguageVersion.of(project.findProperty('jv') as Integer ?: 23)
plugins.withType(JavaPlugin).configureEach {
java {
modularity.inferModulePath = true
toolchain {
languageVersion = JLV
}
}
}
repositories {
maven {
url = "https://maven.pkg.github.com/comodal/json-iterator"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
}
}
maven {
url = "https://maven.pkg.github.com/sava-software/sava"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
}
}
mavenCentral()
}
dependencies {
implementation libs.bouncycastle
implementation libs.json.iterator
implementation libs.sava.core
implementation libs.sava.rpc
testImplementation libs.junit.jupiter
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
showStandardStreams true
}
}
tasks.register('sourcesJar', Jar) {
from sourceSets.main.allJava
archiveClassifier.set('sources')
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
groupId project.group
artifactId project.name
version = project.version
pom {
name = project.name
url = "$VCS_URL"
scm {
connection = 'scm:git:[email protected]:sava-software/solana-programs.git'
url = "$VCS_URL"
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/sava-software/solana-programs"
credentials {
username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("gpr.user.write")
password = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.token.write")
}
}
}
}