-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
145 lines (123 loc) · 4.33 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
buildscript {
ext.kotlin_version = "1.5.10"
ext.tornadofx_version = "1.7.20"
ext.junit_version = "5.1.0"
ext.hoplite_version = "1.4.1"
ext.fuel_version = "2.3.1"
ext.khex_version = '1.1.2'
ext.khash_version = '1.1.1'
}
plugins {
id 'application'
id 'org.jetbrains.kotlin.jvm' version "$kotlin_version"
id 'org.openjfx.javafxplugin' version '0.0.10'
id "com.mxstrive.gradle.mklink-plugin" version "1.0.4"
}
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
application {
mainClassName = "app.MyAppKt"
}
javafx {
version = "15.0.1"
modules = ['javafx.controls', 'javafx.graphics', 'javafx.fxml']
}
dependencies {
implementation "no.tornado:tornadofx:$tornadofx_version"
implementation "com.sksamuel.hoplite:hoplite-core:$hoplite_version"
implementation "com.sksamuel.hoplite:hoplite-yaml:$hoplite_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "com.github.kittinunf.fuel:fuel:$fuel_version"
implementation("com.github.kittinunf.fuel:fuel-json:$fuel_version") {
exclude group: 'org.json', module: 'json'
}
implementation 'org.json:json:20190722'
implementation "bouncycastle:bcprov-jdk16:136"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit"
}
compileKotlin {
kotlinOptions.jvmTarget = "15"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "15"
}
applicationDefaultJvmArgs += "--add-opens=javafx.controls/javafx.scene.control=ALL-UNNAMED"
applicationDefaultJvmArgs += "--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED"
task install {
dependsOn(tasks.build)
String homePath = System.getProperty("user.home")
String configPath = homePath + "/.keywarden"
String buildPath = "./build/distributions"
String prefix = "::::::: "
doLast {
String rootPassword = ""
def console = System.in.newReader()
if (console) {
println(prefix + "Enter your user password to make softlink of executable in /usr/local/bin or press enter to skip that step: ")
rootPassword = console.readLine()
} else {
println(prefix + "Java can't find your console so make soft link of ~/.keywarden/bin/keywarden to /usr/local/bin")
}
mkdir configPath
copy {
from "./extra/config.yml"
into configPath
}
println(prefix + "Your config in $configPath\n${prefix}Thanks for installing keywarden!")
copy {
from zipTree(file("$buildPath/keywarden.zip"))
into buildPath
}
copy {
from "$buildPath/keywarden"
into configPath
}
if (rootPassword.length() > 0) {
exec {
commandLine "./install_manager.sh", "link", rootPassword
}
}
}
}
task uninstall {
dependsOn(tasks.clean)
String homePath = System.getProperty("user.home")
String configPath = homePath + "/.keywarden"
String prefix = "::::::: "
doLast {
String rootPassword = ""
def console = System.in.newReader()
if (console) {
println(prefix + "Enter your user password to delete softlink of executable in /usr/local/bin or press enter to skip that step: ")
rootPassword = console.readLine()
} else {
println(prefix + "Java can't find your console so make soft link of ~/.keywarden/bin/keywarden to /usr/local/bin")
}
delete {
delete configPath
}
if (rootPassword.length() > 0) {
exec {
commandLine "./install_manager.sh", "unlink", rootPassword
}
}
}
}
run {
applicationDefaultJvmArgs.addAll([
/*'--add-exports=javafx.graphics/com.sun.javafx.iio=ALL-UNNAMED',
'--add-exports=javafx.graphics/com.sun.javafx.iio.common=ALL-UNNAMED',
'--add-exports=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED',*/
'--add-exports=javafx.graphics/com.sun.glass.ui=ALL-UNNAMED',
'--add-opens=javafx.controls/javafx.scene.control=ALL-UNNAMED',
'--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED',
])
jvmArgs.addAll([
'--add-exports=javafx.graphics/com.sun.glass.ui=ALL-UNNAMED',
])
}