-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
131 lines (110 loc) · 3.42 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
buildscript {
repositories {
mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
}
configurations.all {
resolutionStrategy {
force 'commons-io:commons-io:2.4'
}
}
dependencies {
classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.27.1'
}
}
plugins {
id 'org.cadixdev.licenser' version '0.6.1' apply false
id "org.ajoberstar.grgit" version "4.1.1"
}
println """
*******************************************
You are building JingleNote!
If you encounter trouble:
1) Read COMPILING.md if you haven't yet
2) Try running 'build' in a separate Gradle run
3) Use gradlew and not gradle
4) If you still need help, ask on Discord! https://discord.gg/enginehub
Output files will be in [subproject]/build/libs
*******************************************
"""
allprojects {
group 'org.enginehub.jinglenote'
version '1.0.0-SNAPSHOT'
}
if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = "http://localhost"
if (!project.hasProperty("artifactory_user")) ext.artifactory_user = "guest"
if (!project.hasProperty("artifactory_password")) ext.artifactory_password = ""
if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) {
try {
def repo = grgit.open()
ext.gitCommitHash = repo.head().abbreviatedId
} catch (Exception e) {
println "Error getting commit hash: " + e.getMessage()
}
}
if (!project.hasProperty("gitCommitHash")) {
ext.gitCommitHash = "no_git_id"
}
apply plugin: 'com.jfrog.artifactory'
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
ivy = false
}
}
}
artifactoryPublish.skip = true
subprojects {
repositories {
mavenCentral()
maven { url "https://maven.enginehub.org/repo/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 5, 'minutes'
}
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'org.cadixdev.licenser'
ext.internalVersion = version + ";" + gitCommitHash
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
if (JavaVersion.current().isJava8Compatible()) {
// Java 8 turns on doclint which we fail
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
build.dependsOn(javadocJar)
build.dependsOn(sourcesJar)
artifactoryPublish {
publishConfigs('archives')
}
license {
header = rootProject.file("HEADER.txt")
include '**/*.java'
}
}