File: build.gradle

package info (click to toggle)
ice-builder-gradle 1.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 236 kB
  • sloc: makefile: 32
file content (159 lines) | stat: -rw-r--r-- 4,684 bytes parent folder | download
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// **********************************************************************
//
// Copyright (c) 2014-2017 ZeroC, Inc. All rights reserved.
//
// **********************************************************************

buildscript {
    if(!localOnly.toBoolean()) {
        repositories {
            maven {
                url "https://plugins.gradle.org/m2/"
            }
        }
        dependencies {
            classpath "com.gradle.publish:plugin-publish-plugin:0.9.9"
        }
    }
}

if(!localOnly.toBoolean()) {
    apply plugin: "com.gradle.plugin-publish"
}

apply plugin: 'groovy'
apply plugin: 'maven'

sourceCompatibility = 1.7
targetCompatibility = 1.7

if(!localOnly.toBoolean()) {
    repositories {
        mavenCentral()
    }
}

dependencies {
    compile gradleApi()
    compile localGroovy()

    if(!localOnly.toBoolean()) {
        testCompile 'junit:junit:4.12'
        testCompile 'com.github.stefanbirkner:system-rules:1.16.0'
    }
}

test {
    testLogging {
        events = ["failed", "skipped"]
        exceptionFormat = "full"
        showStandardStreams = false
    }
    onlyIf { ! localOnly.toBoolean() }
}

sourceSets {
    main {
        groovy {
            srcDir "src/main/groovy"
        }
        resources {
            srcDir "src/main/resources"
        }
    }
}

version  = "1.4.5"
group = "com.zeroc.gradle.ice-builder"

if(!localOnly.toBoolean()) {
    pluginBundle {
        website = 'https://github.com/zeroc-ice/ice-builder-gradle'
        vcsUrl = 'https://github.com/zeroc-ice/ice-builder-gradle.git'
        description = 'Plugin to automate the compilation of Slice files to Java'
        tags = ['zeroc', 'ice', 'slice']

        plugins {
            slicePlugin {
                id = 'com.zeroc.gradle.ice-builder.slice'
                displayName = 'Ice Builder for Gradle'
            }
        }
    }

    //
    // Used to build the gradle wrapper to automatically download and install
    // the version of gradle needed to build plugin.
    //
    task wrapper(type: Wrapper) {
        gradleVersion = "4.4"
    }
} else {
    prefix = prefix ? prefix : (System.properties['os.name'].toLowerCase().contains('windows') ?
        "C:\\ice-builder-gradle-${project.version}" : "/opt/ice-builder-gradle-${project.version}")

    def jarDir = (prefix == "/usr" || prefix == "/usr/local") ? "${prefix}/share/java" : "${prefix}/lib"

    def pomName = "$buildDir/libs/${project.name}-${project.version}.pom"
    def pomLicense = project.hasProperty("licenseURL") ? licenseURL : "https://github.com/zeroc-ice/ice-builder-gradle/blob/master/LICENSE"

    task writeNewPom << {

        pom {
            project {
                name 'Ice Builder for Gradle'
                description 'Plugin to automate the compilation of Slice files to Java'
                url 'https://zeroc.com'
                scm {
                    connection 'scm:git:git@github.com/zeroc-ice/ice-builder-gradle.git'
                    developerConnection 'scm:git:git@github.com/zeroc-ice/ice-builder-gradle.git'
                    url 'git://github.com/zeroc-ice/ice-builder-gradle.git'
                }
                licenses {
                    license {
                        name 'The BSD 3-Clause License'
                        url pomLicense
                        distribution 'repo'
                    }
                }
                organization {
                    name 'ZeroC, Inc.'
                    url 'https://zeroc.com'
                }
                developers {
                    developer {
                        name = 'ZeroC Developers'
                        email = 'info@zeroc.com'
                        organization = 'ZeroC, Inc.'
                        organizationUrl = 'https://zeroc.com'
                    }
                }
            }
        }.writeTo(pomName)
    }

    jar.dependsOn(writeNewPom)

    task groovydocJar(type: Jar, dependsOn: groovydoc) {
        classifier = 'groovydoc'
        from groovydoc
        destinationDir = new File("$buildDir/libs")
    }

    assemble.dependsOn(groovydocJar)

    task sourcesJar(type: Jar, dependsOn: jar) {
        classifier = 'sources'
        from sourceSets.main.allSource
        destinationDir = new File("$buildDir/libs")
    }
    assemble.dependsOn(sourcesJar)

    task install(type: Copy, dependsOn: assemble, overwrite: true) {
        from "${pomName}"
        from "$buildDir/libs/${jar.archiveName}"
        from "$buildDir/libs/${project.name}-${project.version}-sources.jar"
        from "$buildDir/libs/${project.name}-${project.version}-groovydoc.jar"
        into "${DESTDIR}${jarDir}"
    }
}