summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/proguard-jar.gradle
blob: 9bc066be01ea005da5b54285bf4d2386f567d637 (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
// **********************************************************************
//
// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath "net.sf.proguard:proguard-gradle:5.2.1"
    }
}

task proguardJar(type: proguard.gradle.ProGuardTask, dependsOn: jar) {
    injars configurations.compile.resolve(), filter: "!META-INF/**"
    injars "${projectDir}/build/libs/${tmpJarName}"
    outjars "${libDir}/${jarName}"
    libraryjars project.ext.libJars
    configuration 'icegridgui.pro'
}

task updateManifest(dependsOn: proguardJar) << {
    if (hasJavaFx) {
        ant.jar(update: true, destfile: "${libDir}/${jarName}") {
            delegate.manifest {
                attribute(name: 'Main-Class', value: 'com.zeroc.IceGridGUI.MainProxy')
                attribute(name: 'Built-By', value: 'Zeroc, Inc.')
            }
        }
    }
}
updateManifest.outputs.files("${DESTDIR}${jarDir}/${jarName}")

task copyJars(type: Copy, dependsOn: updateManifest) {
    from new File("${libDir}/${jarName}")
    into "${DESTDIR}${jarDir}"
}

task install(dependsOn: copyJars)