-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
125 lines (111 loc) · 3.76 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
plugins {
id 'java'
id 'idea'
id 'java-gradle-plugin'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'com.diffplug.spotless' version '6.13.0'
}
apply plugin: 'maven-publish'
group = 'com.hypherionmc.modutils'
version = "${version_major}.${version_minor}.${version_patch}"
description = "Gradle Utilities for First Dark Development"
archivesBaseName = "Orion"
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
if (System.getenv('BUILD_NUMBER') != null) {
var build = (System.getenv('BUILD_NUMBER').toInteger() - 1)
version = "${version_major}.${version_minor}.${build}"
}
configurations {
shadeMe
compileOnly.extendsFrom shadeMe
}
repositories {
mavenCentral()
maven {
url "https://maven.firstdark.dev/releases"
}
maven {
url "https://mcentral.firstdark.dev/releases"
}
maven {
url "https://maven.covers1624.net"
}
}
dependencies {
implementation gradleApi()
shadeMe "com.squareup.okhttp3:okhttp:${okhttp}"
shadeMe "com.google.code.gson:gson:${gson}"
shadeMe "codechicken:DiffPatch:${diffpatch}:all"
shadeMe 'org.apache.commons:commons-compress:1.26.2'
shadeMe "org.eclipse.jgit:org.eclipse.jgit:${jgit}"
shadeMe "commons-io:commons-io:${commons_io}"
// Lombok
compileOnly "org.projectlombok:lombok:${lombok}"
annotationProcessor "org.projectlombok:lombok:${lombok}"
testCompileOnly "org.projectlombok:lombok:${lombok}"
testAnnotationProcessor "org.projectlombok:lombok:${lombok}"
}
shadowJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = [project.configurations.getByName("shadeMe")]
archiveClassifier.set(null)
}
gradlePlugin {
plugins {
orionPlugin {
id = 'com.hypherionmc.modutils.orion'
description = project.description
displayName = 'Orion'
version = project.version
implementationClass = "com.hypherionmc.orion.plugin.OrionPlugin"
tags.set(['gradle', 'utils', 'fdd'])
}
orionPortingPlugin {
id = 'com.hypherionmc.modutils.orion.porting'
description = project.description
displayName = 'OrionPorting'
version = project.version
implementationClass = "com.hypherionmc.orion.plugin.porting.OrionPortingPlugin"
tags.set(['gradle', 'utils', 'fdd'])
}
origamiPlugin {
id = 'com.hypherionmc.modutils.orion.origami'
description = project.description
displayName = 'OrionOrigami'
version = project.version
implementationClass = "com.hypherionmc.orion.plugin.paper.OrigamiPlugin"
tags.set(['gradle', 'utils', 'fdd'])
}
}
}
jar {
manifest {
attributes([
'Timestamp' : System.currentTimeMillis(),
'Specification-Title' : project.archivesBaseName,
'Specification-Version' : project.version,
'Implementation-Title' : project.archivesBaseName,
'Implementation-Version' : project.version,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})"
])
}
}
spotless {
java {
targetExclude("src/test/**")
licenseHeaderFile(rootProject.file("HEADER")).yearSeparator("-")
}
}
publishing {
repositories {
maven {
url System.getenv('MAVEN_URL')
credentials {
username System.getenv('MAVEN_USER')
password System.getenv('MAVEN_PASS')
}
}
}
}