-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
86 lines (76 loc) · 2.48 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
buildscript {
repositories {
maven { url = 'https://plugins.gradle.org/m2/' }
}
}
apply plugin: 'java'
apply plugin: 'maven-publish'
group project.group
def snapshotVersion = System.getenv("GITHUB_RUN_NUMBER")
version = project.version
archivesBaseName = project.archivesBaseName
repositories {
mavenCentral()
maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
maven {
url "https://maven.cloudsmith.io/geckolib3/geckolib/"
}
}
dependencies {
implementation 'com.eliotlash.mclib:mclib:20'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'it.unimi.dsi:fastutil:8.4.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
}
jar {
from sourceSets.main.allSource
manifest {
attributes([
"FMLModType" : "LIBRARY",
"Specification-Title" : "geckolib",
"Specification-Vendor" : "geckolib",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "geckolib",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifactId = project.archivesBaseName
}
}
}
publishing {
repositories {
maven {
name = "cloudsmith"
url = "https://maven.cloudsmith.io/geckolib3/geckolib/"
def releasesRepoUrl = "https://maven.cloudsmith.io/geckolib3/geckolib/"
def snapshotsRepoUrl = "https://maven.cloudsmith.io/geckolib3/geckolib/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
def envUsername = System.getenv("cloudUsername")
def envPassword = System.getenv("cloudPassword")
username = envUsername == null ? findProperty("cloudUsername") : envUsername
password = envPassword == null ? findProperty("cloudPassword") : envPassword
}
}
}
}