-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
145 lines (124 loc) · 4.35 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
plugins {
id "java"
id "io.freefair.lombok" version "8.3"
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}
def rootGroup = "com.theagilemonkeys.ellmental"
def rootVersion = properties['version']
def rootSourceCompatibility = JavaVersion.VERSION_17
def publishablePackages = [
"core": "Core library for eLLMental",
"embeddingsgeneration": "Embeddings generation module for eLLMental",
"embeddingsstore": "Embeddings store module for eLLMental",
"embeddingsspace": "Embeddings space module for eLLMental",
"textgeneration": "Text generation module for eLLMental",
]
allprojects {
repositories {
mavenCentral()
}
tasks.withType(JavaCompile) {
sourceCompatibility = rootSourceCompatibility
targetCompatibility = rootSourceCompatibility
}
}
java {
sourceCompatibility = rootSourceCompatibility
targetCompatibility = rootSourceCompatibility
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
subprojects { subproject ->
group = rootGroup
version = rootVersion
description = publishablePackages[subproject.name]
apply plugin: 'java'
apply plugin: 'io.freefair.lombok'
apply plugin: 'maven-publish'
apply plugin: 'signing'
sourceCompatibility = rootSourceCompatibility
java {
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
}
test {
useJUnitPlatform()
}
if (publishablePackages.containsKey(subproject.name)) {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = subproject.group
artifactId = subproject.name
version = subproject.version
// Additional Pom information
pom {
name = subproject.name
description = subproject.description
url = 'https://github.com/theam/ellmental'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'theam'
name = 'The Agile Monkeys'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/theam/ellmental.git'
developerConnection = 'scm:git:ssh://github.com:theam/ellmental.git'
url = 'https://github.com/theam/ellmental'
}
}
}
}
repositories {
maven {
name = 'OSSRH'
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
def privateKey = System.getenv('MAVEN_BASE64_PRIVATE_KEY')
def passphrase = System.getenv('MAVEN_KEY_PASSPHRASE')
if (privateKey && passphrase) {
useInMemoryPgpKeys(privateKey, passphrase)
sign publishing.publications
} else {
println "Private key or passphrase for signing not found. Skipping signing..."
}
}
}
}
tasks.test {
useJUnitPlatform()
}
nexusPublishing {
packageGroup = rootGroup
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}