forked from HellFirePvP/AstralSorcery
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpublishing.gradle
77 lines (72 loc) · 2.94 KB
/
publishing.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
// Master Switches
boolean debug_publishing = false // If true, the tasks will run without the files being actually published
boolean maven_publishing = false // If true, configure the publishing in the publishing { } block
boolean curseforge_publishing = false // If true, configure the publishing in the curseforge { } block
boolean modrinth_publishing = false // If true, configure the publishing in the modrinth { } block
String release_type = 'release' // Can be "alpha", "beta" or "release"
String maven_repository_url = '' // URL pointing to your maven repository
if (maven_publishing) {
assertProperty 'maven_repository_url'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java // Publish with standard artifacts
groupId project.root_package // Publish with root package as maven group
artifactId project.mod_id // Publish artifacts with mod id as the artifact id
// Custom artifact:
// If you want to publish a different artifact to the one outputted when building normally
// Create a different gradle task (Jar task), in extra.gradle
// Remove the 'from components.java' line above
// Add this line (change the task name):
// artifacts task_name
}
}
repositories {
maven {
url maven_repository_url
credentials PasswordCredentials
}
}
}
}
// Documentation here: https://github.com/matthewprenger/CurseGradle/wiki/
if (curseforge_publishing) {
apply plugin: 'com.matthewprenger.cursegradle'
assertEnvironmentVariable 'CURSEFORGE_KEY'
curseforge {
apiKey System.getenv('CURSEFORGE_KEY')
project {
id 'project-id' // Change to project id (can't be slug)
addGameVersion 'Java 8'
addGameVersion 'Forge'
addGameVersion '1.12.2'
setReleaseType release_type
mainArtifact tasks.reobfJar, {
displayName "${project.property('mod_name')} ${project.property('mod_version')}"
relations {
if (project.use_mixins) {
requiredDependency 'mixin-booter'
}
}
}
options {
debug debug_publishing
}
}
}
}
// Documentation here: https://github.com/modrinth/minotaur
if (modrinth_publishing) {
apply plugin: 'com.modrinth.minotaur'
assertEnvironmentVariable 'MODRINTH_KEY'
modrinth {
token = System.getenv('MODRINTH_KEY')
projectId = "project-slug" // This can be the project id or the slug.
versionNumber = project.property('mod_version')
versionType = release_type
uploadFile = tasks.reobfJar
gameVersions ['1.12.2']
loaders ['forge']
debugMode = debug_publishing
}
}