-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
98 lines (84 loc) · 2.91 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
buildscript {
repositories {
jcenter()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.0'
classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:1.6.1'
}
}
apply plugin: 'java'
apply plugin: 'edu.sc.seis.launch4j'
apply plugin: 'com.github.johnrengelman.shadow'
// launch4j dependsOn doesn't work
defaultTasks 'prepareManifest', 'build', 'launch4j', 'gather'
group = 'com.mumfrey'
ext.revision = project.verRevision == "0" ? "" : ".${project.verRevision}"
version = "${project.verMajor}.${project.verMinor}${project.revision}${project.verRelease}"
ext.mcversion = "${project.verMajor}.${project.verMinor}${project.revision}"
ext.msversion = "${project.verMajor}.${project.verMinor}.${project.verRevision}.${project.verBuild}"
archivesBaseName = 'liteloader-installer'
targetCompatibility = '1.6'
sourceCompatibility = '1.6'
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:17.0'
compile 'net.sourceforge.argo:argo:3.7'
}
// 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 'launch4j/liteloader_installer_manifest.xml'
into tasks.launch4j.temporaryDir
expand(
artefact: project.sxsname,
msversion: project.msversion
)
}
launch4j {
copyConfigurable = project.tasks.shadowJar.outputs.files
jar = 'lib/' + project.tasks.shadowJar.archiveName
icon = "${projectDir}/launch4j/liteloader_installer_icon.ico"
manifest = "${tasks.launch4j.temporaryDir}/liteloader_installer_manifest.xml"
outfile = tasks.shadowJar.archiveName - ".jar" + ".exe"
version = project.msversion
internalName = project.sxsname
productName = "LiteLoader"
description = "LiteLoader Installer for Minecraft ${project.mcversion} release {project.verRelease}"
copyright = "Copyright (C) 2013-15 Adam Mummery-Smith"
}
task gather(type: Copy) {
dependsOn 'launch4j'
from 'build/launch4j/' + launch4j.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
}