-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
107 lines (97 loc) · 2.94 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
/*
* Uncomment all lines regarding javafx for java 11 support!
*/
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'application'
id "org.openjfx.javafxplugin" version "0.0.10" apply false
id 'com.diffplug.spotless' version '6.1.0'
}
group 'GrizzlyTime'
version '2.4.0'
mainClassName = "Main"
def javaVer = getVersion()
if (javaVer >= 11) {
apply plugin: "org.openjfx.javafxplugin"
}
repositories {
mavenCentral()
}
dependencies {
//note that it seems the maven repository includes a version 11 of these plugins, should investigate if this is for jdk 11
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation group: 'com.google.oauth-client', name: 'google-oauth-client', version: '1.30.1'
implementation group: 'com.google.api-client', name: 'google-api-client', version: '1.30.2'
implementation group: 'com.google.oauth-client', name: 'google-oauth-client-java6', version: '1.30.1'
implementation group: 'com.google.oauth-client', name: 'google-oauth-client-jetty', version: '1.30.1'
implementation group: 'com.google.apis', name: 'google-api-services-sheets', version: 'v4-rev581-1.25.0'
implementation 'org.json:json:20180813'
if (javaVer == 11){
implementation "org.openjfx:javafx:11.0.1"
} else if (javaVer == 17) {
implementation "org.openjfx:javafx:18-ea+9"
}
}
if (javaVer >= 11) {
javafx {
modules = [
'javafx.controls',
'javafx.media',
'javafx.swing'
]
}
}
spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**'
}
toggleOffOn()
googleJavaFormat()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**', '**/build-*/**'
}
greclipse()
indentWithSpaces(4)
trimTrailingWhitespace()
endWithNewline()
}
format 'xml', {
target fileTree('.') {
include '**/*.xml'
exclude '**/build/**', '**/build-*/**'
}
eclipseWtp('xml')
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
format 'misc', {
target fileTree('.') {
include '**/*.md', '**/.gitignore'
exclude '**/build/**', '**/build-*/**'
}
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
}
/* https://stackoverflow.com/a/2591122/6755709 */
def getVersion() {
def version = System.getProperty("java.version");
if(version.startsWith("1.")) {
version = version.substring(2, 3);
} else {
def dot = version.indexOf(".");
if(dot != -1) { version = version.substring(0, dot); }
}
return Integer.parseInt(version)
}