This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
147 lines (129 loc) · 4.52 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
146
147
import java.time.Instant
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoUnit
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'signing'
}
version = '0.2.4'
group = 'org.teacon'
archivesBaseName = 'RemoteSync-FML'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net/"
}
}
dependencies {
shadow group: 'org.bouncycastle', name: 'bcpg-jdk15on', version: '1.70'
implementation group: 'net.minecraftforge', name: 'forgespi', version: '4.0.15'
implementation group: 'cpw.mods', name: 'modlauncher', version: '9.1.3'
implementation group: 'net.minecraftforge', name: 'fmlloader', version: '1.18.2-40.1.86'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'
testImplementation group: 'org.bouncycastle', name: 'bcpg-jdk15on', version: '1.70'
}
shadowJar {
// Only packages dependencies under `shadow` configuration
configurations = [ project.configurations.shadow ]
// No extra MANIFEST.MF
exclude 'META-INF/MANIFEST.MF'
// Relocate to avoid package conflict
relocate 'org.bouncycastle', 'org.teacon.sync.shadow.org.bouncycastle'
// Also relocate the package name inside all services files.
// See: https://github.com/johnrengelman/shadow/issues/291
mergeServiceFiles()
}
jar {
manifest {
attributes([
"Specification-Title": "RemoteSync",
"Specification-Vendor": "3TUSK",
"Specification-Version": "1.0",
"Implementation-Title": "RemoteSync",
"Implementation-Version": archiveVersion.get(),
"Implementation-Vendor": "3TUSK",
"Implementation-Timestamp": DateTimeFormatter.ISO_INSTANT.format(Instant.now().truncatedTo(ChronoUnit.SECONDS))
], 'org.teacon.sync')
}
}
publishing {
publications {
create("release", MavenPublication) {
groupId = "org.teacon"
artifactId = "RemoteSync-FML"
artifact jar
artifact shadowJar
pom {
name = 'RemoteSync for FML'
description = 'Forbidden magic that automatically keeps your mods updated'
url = 'https://github.com/teaconmc/RemoteSync'
licenses {
license {
name = 'LGPL-2.1-or-later'
url = 'https://github.com/teaconmc/RemoteSync/tree/bleeding/COPYING.LGPL'
}
}
developers {
developer {
id = '3TUSK'
name = '3TUSK'
}
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/teaconmc/RemoteSync/issues'
}
scm {
url = 'https://github.com/teaconmc/RemoteSync'
connection = 'scm:git:git://github.com/teaconmc/RemoteSync.git'
developerConnection = 'scm:git:git@github.com:teaconmc/RemoteSync.git'
}
}
}
}
repositories {
maven {
name = "teacon"
url = "s3://maven/"
credentials(AwsCredentials) {
accessKey = System.env.ARCHIVE_ACCESS_KEY
secretKey = System.env.ARCHIVE_SECRET_KEY
}
}
}
}
// https://docs.gradle.org/current/userguide/signing_plugin.html
// https://gist.github.com/phit/bd3c6d156a2fa5f3b1bc15fa94b3256c
//signing {
// // TODO Sign release
// if (System.env.GITHUB_ACTIONS) {
// useGpgCmd()
// }
// sign publishing.publications.release
//}
tasks.withType(PublishToMavenRepository).configureEach {
if (repository && repository.name == 'teacon') {
onlyIf {
System.env.ARCHIVE_ACCESS_KEY && System.env.ARCHIVE_SECRET_KEY
}
}
}
/**
* A simple task to pass down the artifact name and path to other GitHub actions.
*/
tasks.register('githubActionOutput') {
onlyIf {
System.env.GITHUB_ACTIONS
}
doLast {
println "::set-output name=artifact_path::${shadowJar.archiveFile.get().asFile.absolutePath}"
println "::set-output name=artifact_name::${shadowJar.archiveFileName.get()}"
}
}