This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
forked from CorgiTaco-Archive/lazydfu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.gradle
66 lines (56 loc) · 1.9 KB
/
publish.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
/*
* GradleWorks for ForgeGradle 5
* Written by Jonathing
* Version 4.0.0-beta.3
*
* This gradle file contains additional instructions for publishing builds of this mod to maven repositories.
*/
// Hhoves all of the sources in a JAR file.
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
// Shoves all of the sources and deobfuscated compiled classes in a JAR file.
task deobfJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('deobf')
from sourceSets.main.java.sourceDirectories
from sourceSets.main.output
}
// Generates the javadocs and shoves them in a JAR file.
task javadocJar(type: Jar) {
archiveClassifier.set('javadoc')
from javadoc
}
// Ensures that the mod is built before it is published to the maven.
publish {
dependsOn 'build'
}
publishing {
publications {
// Get the main jar, sources jar, and javadoc jars for publishing.
mavenJava(MavenPublication) {
groupId = "${maven_group}".toString()
artifactId = "${maven_artifact_id}".toString()
version = "${mc_version}-${version}".toString()
artifact reobfFile // main jar
artifact sourcesJar // sources jar
artifact javadocJar // javadoc jar
}
}
repositories {
// Test Maven repository located in the "mcmodsrepo" folder.
maven {
name 'TestMaven'
url "file:///${project.projectDir}/mcmodsrepo".toString()
}
// My personal maven repo
maven {
name 'ModdingLegacyMaven'
url uri('https://maven.moddinglegacy.com/repository/jonathing/')
credentials {
username = project.findProperty('mlm.user') ?: System.getenv('ML_USERNAME')
password = project.findProperty('mlm.key') ?: System.getenv('ML_TOKEN')
}
}
}
}