summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/build.gradle
blob: 78b97ed7bb3238998c81c9a00b3e23c07820c56b (plain)
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
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

import org.gradle.util.GradleVersion
project.ext.displayName = "IceGridGUI"
project.ext.description = ""

if(GradleVersion.current() >= GradleVersion.version('4.1') && JavaVersion.current() > JavaVersion.VERSION_1_10) {
    ext.os = System.properties['os.name']
    if(os == "Mac OS X") {
        ext.platform = "mac"
        ext.hasJavaFx = true
    } else if(os.toLowerCase().contains("windows")) {
        ext.platform = "win"
        ext.hasJavaFx = true
    } else if(os.toLowerCase().contains("linux")) {
        ext.platform = "linux"
        ext.hasJavaFx = true
    } else {
        ext.hasJavaFx = false
    }
} else {
    ext.javafxJar = ['jfxrt.jar',
                     'lib/jfxrt.jar',
                     'lib/ext/jfxrt.jar',
                     'jre/lib/jfxrt.jar',
                     'jre/lib/ext/jfxrt.jar',
                     'lib/javafx-swt.jar'].find{ new File("${System.properties['java.home']}/${it}").exists() }

    ext.hasJavaFx = javafxJar != null
}

if(!hasJavaFx) {
    sourceSets {
        main {
            java {
                exclude '**/LiveDeployment/GraphView.java'
            }
        }
    }
}

// Don't generate javadoc
javadoc.enabled = false

// Disable deprecation warnings caused by JGoodies
tasks.withType(JavaCompile) {
    options.deprecation = false
}

dependencies {
      implementation project(':ice')
      implementation project(':icessl')
      implementation project(':icelocatordiscovery')
      implementation project(':icebox')
      implementation project(':icestorm')
      implementation project(':glacier2')
      implementation project(':icegrid')
      implementation "com.jgoodies:jgoodies-looks:${jgoodiesLooksVersion}"
      implementation "com.jgoodies:jgoodies-forms:${jgoodiesFormsVersion}"

      if(hasJavaFx && GradleVersion.current() >= GradleVersion.version('4.1') && JavaVersion.current() > JavaVersion.VERSION_1_10) {
           implementation "org.openjfx:javafx-base:${openjfxVersion}:${platform}"
           implementation "org.openjfx:javafx-swing:${openjfxVersion}:${platform}"
           implementation "org.openjfx:javafx-controls:${openjfxVersion}:${platform}"
           implementation "org.openjfx:javafx-graphics:${openjfxVersion}:${platform}"
      }
}

project.ext.tmpJarName = "IceGridGUITEMP.jar"
project.ext.jarName = "icegridgui.jar"

jar {
    archiveName = tmpJarName
    manifest {
        attributes("Main-Class": "com.zeroc.IceGridGUI.Main",
                   "Built-By": "ZeroC, Inc.")
    }
}

project.ext.libJars = []

// Proguard does not support Java >= 14
project.ext.jarBuilder = icegridguiProguard.toBoolean() &&
                         Double.parseDouble(System.getProperty("java.vm.specification.version")) < 14.0
                         ? "proguard-jar.gradle" : "plain-jar.gradle"

apply from: jarBuilder

clean {
    delete("${libDir}/${jarName}")
    delete("${libDir}/IceGrid GUI.app")
}