forked from Jire/Overwatcheat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
104 lines (83 loc) · 2.7 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
import java.nio.file.Files
/*
* Free, open-source undetected color cheat for Overwatch!
* Copyright (C) 2017 Thomas G. Nappo
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
group 'com.overwatcheat'
version '1.0.1'
buildscript {
ext.kotlin_version = '1.1.2-2'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: "com.github.johnrengelman.shadow"
mainClassName = 'com.overwatcheat.Overwatcheat'
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile group: 'org.bytedeco', name: 'javacv-platform', version: '1.3.2'
compile group: 'net.java.dev.jna', name: 'jna', version: '4.4.0'
compile group: 'net.java.dev.jna', name: 'jna-platform', version: '4.4.0'
}
jar {
manifest {
attributes 'Main-Class': mainClassName
}
}
shadowJar {
baseName = 'Overwatcheat'
classifier = null
}
task overwatcheat {
doLast {
def name = "Overwatcheat $version"
def dir = file("build/$name/")
if (dir.exists()) dir.deleteDir()
dir.mkdirs()
def jarName = "${name}.jar"
def jar = file(new File(dir, jarName))
def allJar = file("build/libs/Overwatcheat-${version}.jar")
Files.copy(allJar.toPath(), jar.toPath())
def bat = file(new File(dir, "Start ${name}.bat"))
Files.write(bat.toPath(), """@echo off
cd /d "%~dp0"
title $name
java -jar "$jarName"
pause""".getBytes())
Files.copy(file("overwatcheat.cfg").toPath(), file(new File(dir, "overwatcheat.cfg")).toPath())
Files.copy(file("LICENSE.txt").toPath(), file(new File(dir, "LICENSE.txt")).toPath())
Files.copy(file("README.md").toPath(), file(new File(dir, "README.md")).toPath())
}
}
overwatcheat.dependsOn shadowJar
overwatcheat.mustRunAfter shadowJar
sourceSets {
main.java.srcDirs += 'src/main/java'
main.java.srcDirs += 'src/main/kotlin'
}