forked from DimensionalDevelopment/Rift
-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.gradle
145 lines (124 loc) · 3.72 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
buildscript {
repositories {
jcenter()
maven { url 'https://www.dimdev.org/maven/' }
maven { url 'https://jitpack.io' }
maven { url = "https://files.minecraftforge.net/maven" }
maven { url 'http://repo.spongepowered.org/maven' }
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath "com.github.Chocohead:ForgeGradle:jitpack-SNAPSHOT"
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'gradle.plugin.com.github.breadmoirai:github-release:2.0.1'
}
}
apply plugin: 'net.minecraftforge.gradle.tweaker-client'
apply plugin: 'java'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'maven-publish'
apply plugin: 'com.github.breadmoirai.github-release'
def travisBuildNumber = System.getenv('TRAVIS_BUILD_NUMBER')
def versionSuffix = travisBuildNumber != null ? travisBuildNumber : 'SNAPSHOT'
group 'org.dimdev'
version '1.0.4-' + versionSuffix
archivesBaseName = 'Rift'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url 'https://libraries.minecraft.net/' }
maven { url = "https://files.minecraftforge.net/maven" }
maven { url 'https://www.dimdev.org/maven/' }
maven { url = 'https://repo.spongepowered.org/maven/' }
maven { url 'https://www.jitpack.io' }
}
dependencies {
implementation('org.dimdev:mixin:0.7.11-SNAPSHOT') { transitive = false }
implementation('net.minecraft:launchwrapper:1.12') { transitive = false }
implementation 'org.ow2.asm:asm:6.2'
implementation 'org.ow2.asm:asm-commons:6.2'
}
minecraft {
version = '1.13.2'
mappings = 'snapshot_20181106'
runDir = 'run'
tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
makeObfSourceJar = false
replace "@VERSION@", project.version
replaceIn "org/dimdev/riftloader/Main.java"
}
mixin {
defaultObfuscationEnv notch
add sourceSets.main, 'mixins.rift.refmap.json'
extraSrgFile notch, "$projectDir/optimap.srg"
token("OPTIFINE", 1)
}
sourceSets {
shim
main {
compileClasspath += shim.output
}
debug {
compileClasspath += main.compileClasspath
}
}
processResources {
filesMatching('profile.json') {
def process = 'git rev-parse --short HEAD'.execute()
process.waitFor()
def things = ['version': project.version, 'build': process.exitValue() ? 'jitpack-SNAPSHOT' : "${process.text.trim()}"]
expand things
}
// Re-run this task when these change
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
}
jar {
finalizedBy reobfJar
manifest.attributes(
'Main-Class': 'org.dimdev.riftloader.Main'
)
}
task devJar(type: Jar, dependsOn: classes) {
classifier 'dev'
from sourceSets.main.output
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives devJar
archives sourcesJar
}
publishing {
repositories {
maven { url "$buildDir/repo/" }
maven {
url 'sftp://www.dimdev.org:22/data/www/html/maven/'
credentials {
username 'www'
password System.getenv('dimdev_maven_password')
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'rift'
from components.java
artifact devJar
artifact sourcesJar
}
}
}
tasks.publish.dependsOn(tasks.githubRelease)
githubRelease {
token = System.getenv('dimdev_repo_token')
owner = 'DimensionalDevelopment'
repo = 'Rift'
targetCommitish = 'master'
prerelease = true
releaseAssets = jar.destinationDir.listFiles()
}