forked from HanSolo/medusa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (126 loc) · 4.24 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
139
140
141
142
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:3.0.0'
}
}
// Medusa main build file
plugins {
id 'com.gradle.build-scan' version '1.11'
id 'idea'
id 'eclipse'
id 'java'
id 'maven-publish'
id 'net.nemerosa.versioning' version '2.6.1'
id 'com.jfrog.bintray' version '1.8.0'
}
apply plugin: 'biz.aQute.bnd.builder'
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}
description = 'Medusa is a JavaFX 8 library containing gauges and clocks'
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}
jar {
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Build-Revision': versioning.info.commit,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Bundle-Name': project.name,
'Bundle-License': 'https://www.apache.org/licenses/LICENSE-2.0;description=Apache License Version 2.0;link=https://www.eclipse.org/legal/eplfaq.php',
'Bundle-Description': description,
'Bundle-SymbolicName': 'eu.hansolo.medusa',
'Export-Package': 'eu.hansolo.medusa,eu.hansolo.medusa.tools,eu.hansolo.medusa.skins,eu.hansolo.medusa.events'
)
}
}
repositories {
jcenter()
}
// create one jar for the javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// create one jar for the source files
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
def pomConfig = {
name 'Medusa'
// Description won't be used when creating the pom file automatically.
// So I've added it manually in the pom.withXml{} section in the publishing task
//description 'Medusa is a JavaFX 8 library containing gauges and clocks'
url 'https://github.com/HanSolo/Medusa/wiki'
inceptionYear '2016'
licenses {
license([:]) {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url 'scm:[email protected]:HanSolo/Medusa.git'
connection 'scm:[email protected]:HanSolo/Medusa.git'
developerConnection 'scm:[email protected]:HanSolo/Medusa.git'
}
developers {
developer {
id 'HanSolo'
name 'Gerrit Grunwald'
}
}
}
publishing {
publications {
mavenCustom(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
asNode().children().last() + pomConfig
asNode().appendNode('description', description)
}
}
}
}
if (!project.hasProperty('bintrayUsername')) ext.bintrayUsername = ''
if (!project.hasProperty('bintrayApiKey')) ext.bintrayApiKey = ''
bintray {
user = project.bintrayUsername
key = project.bintrayApiKey
publications = ['mavenCustom']
pkg {
repo = 'Medusa'
userOrg = 'hansolo'
name = project.name
desc = description
licenses = ['Apache-2.0']
labels = ['javafx']
websiteUrl = 'https://github.com/HanSolo/Medusa/wiki'
issueTrackerUrl = 'https://github.com/HanSolo/Medusa/issues'
vcsUrl = '[email protected]:HanSolo/Medusa.git'
publicDownloadNumbers = true
}
}