This repository has been archived by the owner on Jun 3, 2019. It is now read-only.
forked from Mumfrey/LiteLoaderInstaller
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
95 lines (83 loc) · 2.83 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
buildscript {
repositories {
jcenter()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:2.4.3'
}
}
apply plugin: 'java'
apply plugin: 'edu.sc.seis.launch4j'
apply plugin: 'com.github.johnrengelman.shadow'
group = 'com.mumfrey'
ext.revision = project.revisionVersion == "0" ? "" : ".${project.revisionVersion}"
version = "${project.minecraftVersion}-${project.impactVersion}${ext.revisionVersion}"
ext.mcversion = "${project.minecraftVersion}"
ext.msversion = "${project.minecraftVersion}-${project.impactVersion}${ext.revisionVersion}"
archivesBaseName = 'liteloader-installer'
targetCompatibility = '1.8'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:21.0'
compile 'net.sourceforge.argo:argo:4.6'
}
// resolve problem with shadowJar
task wrapJar(type: Jar) {
baseName = 'artefacts-wrapped'
entryCompression ZipEntryCompression.STORED
from file(Eval.x(project, project.upstreamJar))
destinationDir = temporaryDir
}
jar {
destinationDir = temporaryDir
classifier = "core"
}
shadowJar {
from wrapJar
classifier = 'SNAPSHOT'
}
task prepareManifest(type: Copy) {
from 'createExe/liteloader_installer_manifest.xml'
into tasks.createExe.temporaryDir
expand(
artefact: project.sxsname,
msversion: project.msversion
)
}
createExe {
dependsOn 'prepareManifest'
copyConfigurable = project.tasks.shadowJar.outputs.files
jar = "lib/${project.tasks.shadowJar.archiveName}"
icon = "${projectDir}/createExe/liteloader_installer_icon.ico"
manifest = "${tasks.createExe.temporaryDir}/liteloader_installer_manifest.xml"
outfile = tasks.shadowJar.archiveName - ".jar" + ".exe"
version = project.msversion
internalName = project.sxsname
productName = "LiteLoader"
fileDescription = "LiteLoader Installer for Minecraft ${project.mcversion} revision ${project.revisionVersion}"
copyright = "Copyright (C) 2013-2018 Adam Mummery-Smith"
}
task gather(type: Copy) {
dependsOn 'createExe'
from "build/launch4j/${tasks.createExe.outfile}"
into 'build/libs/'
}
jar.manifest.mainAttributes (
"Main-Class": "com.mumfrey.liteloader.installer.Installer",
"Class-Path": ".",
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": name,
"Implementation-Version": version
)
artifacts {
archives jar
archives shadowJar
}