This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
128 lines (112 loc) · 3.43 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
buildscript {
ext.version = new File('resources/com/soywiz/vitaorganizer/currentVersion.txt').text
ext.kotlin_version = '1.1.4-2'
ext.proguard_version = '5.3.3'
ext.launch4j_version = '2.4.1'
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"
}
}
group 'com.soywiz'
version new File('resources/com/soywiz/vitaorganizer/currentVersion.txt').text
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'
allprojects {
apply plugin: 'java'
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
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
createExe.dependsOn jar
//copyL4jLib.dependsOn minimizedJar
// https://github.com/TheBoegl/gradle-launch4j
launch4j {
//opt = "-Dsun.java2d.d3d=false -Dsun.java2d.noddraw=true"
jvmOptions = ["-Dsun.java2d.d3d=false", "-Dsun.java2d.noddraw=true"]
outfile = "build/libs/vitaorganizer-${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-${version}.jar"
}
//task release(dependsOn: ['clean', 'minimizedJar', 'launch4j']) << {
// println 'release'
//}
task createApp(dependsOn: jar) {
doLast {
copy {
from('extra/app')
into "${project.buildDir}/libs/vitaorganizer-${version}.app"
}
copy {
from("${project.buildDir}/libs/${project.tasks['jar'].archiveName}")
into "${project.buildDir}/libs/vitaorganizer-${version}.app/Contents/Java"
}
}
}