forked from soywiz-archive/vitaorganizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (86 loc) · 2.85 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
group 'com.soywiz'
version new File('resources/com/soywiz/vitaorganizer/currentVersion.txt').text
buildscript {
ext.version = new File('resources/com/soywiz/vitaorganizer/currentVersion.txt').text
ext.kotlin_version = '1.0.3'
ext.proguard_version = '5.2.1'
ext.launch4j_version = '1.6.2'
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "net.sf.proguard:proguard-gradle:$proguard_version"
classpath "gradle.plugin.edu.sc.seis.gradle:launch4j:$launch4j_version"
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'edu.sc.seis.launch4j'
mainClassName = 'com.soywiz.vitaorganizer.VitaOrganizer'
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
mavenLocal()
mavenCentral()
}
sourceSets {
main.kotlin.srcDirs = main.java.srcDirs = ['src', 'ftp4j/src']
main.resources.srcDirs = ['resources', 'assets']
test.java.srcDirs = ['test']
test.kotlin.srcDirs = ['test']
test.resources.srcDirs = ['testresources', 'testassets']
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains:annotations-java5:15.0"
//compile "commons-net:commons-net:3.5"
testCompile "junit:junit:4.11"
}
jar {
manifest {
attributes("Main-Class": "com.soywiz.vitaorganizer.VitaOrganizer")
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task minimizedJar(type: proguard.gradle.ProGuardTask) {
print "build/libs/vitaorganizer-${version}.jar"
injars "build/libs/vitaorganizer-${version}.jar"
outjars "build/libs/vitaorganizer-${version}.min.jar"
libraryjars System.properties.'java.home' + "/lib/rt.jar"
printmapping "build/libs/vitaorganizer-${version}.map"
ignorewarnings
//dontobfuscate
keep access: 'public',
name: 'com.soywiz.vitaorganizer.VitaOrganizer', {
method access: 'public static',
type: 'void',
name: 'main',
parameters: 'java.lang.String[]'
}
keep access: 'public',
name: 'kotlin.text.RegexOption', {
method access: 'public'
method access: 'private'
}
}
minimizedJar.dependsOn jar
copyL4jLib.dependsOn minimizedJar
launch4j {
print "version: $version"
outfile = "../../build/libs/vitaorganizer-${ext.version}.exe"
icon = "../../extra/icon.ico"
mainClassName = project.mainClassName
//copyConfigurable = project.tasks.fatJar.outputs.files
//jar = "lib/${project.tasks.fatJar.archiveName}"
maxHeapSize = 1024
jar = "../../build/libs/vitaorganizer-${ext.version}.min.jar"
}