-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
80 lines (68 loc) · 2.87 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
plugins {
id "base"
id "idea"
id "com.gorylenko.gradle-git-properties"
id "com.github.ben-manes.versions" version "0.51.0"
}
description = "The flexible configurable ticket management"
assert System.properties["java.specification.version"] == "21" || "22" || "23"
allprojects {
group = 'io.flowinquiry'
version = project.findProperty('version')
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
subprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin('java') || project.plugins.hasPlugin('java-library')) {
project.apply(plugin: 'flowinquiry.code-conventions')
project.java {
sourceCompatibility = 21
targetCompatibility = 21
}
}
if (project.plugins.hasPlugin('java-library')) {
project.apply(plugin: 'maven-publish')
// Check if sourcesJar task already exists before creating it
if (!project.tasks.names.contains('sourcesJar')) {
project.tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources') // Classify the JAR as 'sources'
from project.sourceSets.main.allSource // Include all source files
}
}
project.afterEvaluate {
publishing {
publications {
if (!project.publishing.publications.names.contains("${project.name}MavenJava")) {
create("${project.name}MavenJava", MavenPublication) {
from project.components.java
// Reference the sourcesJar task
artifact(tasks.named('sourcesJar'))
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/flowinquiry/flowinquiry-server")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
mavenLocal()
}
}
}
}
}
}
gitProperties {
failOnNoGitDirectory = false
keys = ["git.branch", "git.commit.id.abbrev", "git.commit.id.describe"]
}
tasks.withType(com.gorylenko.GenerateGitPropertiesTask).configureEach {
outputs.doNotCacheIf("Task is always executed") { true }
}
}