-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
138 lines (117 loc) · 4.15 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
// Copyright (c) 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.18.0"
}
}
}
apply plugin: 'groovy'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
}
dependencies {
implementation gradleApi()
implementation localGroovy()
if(!localOnly.toBoolean()) {
testImplementation 'junit:junit:4.12'
testImplementation 'com.github.stefanbirkner:system-rules:1.19.0'
}
}
test {
testLogging {
events = ["failed", "skipped"]
exceptionFormat = "full"
showStandardStreams = false
}
onlyIf { !localOnly.toBoolean() }
}
version = "1.5.0"
group = "com.zeroc.gradle.ice-builder"
if(!localOnly.toBoolean()) {
apply plugin: "com.gradle.plugin-publish"
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'
}
}
}
} 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") ?
project.extlicenseURL :
"https://github.com/zeroc-ice/ice-builder-gradle/blob/main/LICENSE"
apply plugin: 'maven-publish'
tasks.withType(GenerateMavenPom.class) {
destination = file(pomName)
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = 'slice'
version = project.version
from components.java
pom {
name = 'Ice Builder for Gradle'
description = 'Plugin to automate the compilation of Slice files to Java'
url = 'https://zeroc.com'
licenses {
license {
name = 'The BSD 3-Clause License'
url = pomLicense
}
}
developers {
developer {
name = 'ZeroC Developers'
email = '[email protected]'
organization = 'ZeroC, Inc.'
organizationUrl = 'https://zeroc.com'
}
}
scm {
connection = 'scm:git:[email protected]/zeroc-ice/ice-builder-gradle.git'
url = 'git://github.com/zeroc-ice/ice-builder-gradle.git'
}
}
}
}
}
assemble.dependsOn(generatePomFileForMavenPublication)
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) {
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}"
}
}