forked from HanSolo/numberpad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
188 lines (164 loc) · 5.68 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1'
classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.2'
classpath 'org.javamodularity:moduleplugin:1.6.0'
classpath 'org.beryx:badass-jlink-plugin:2.16.4'
}
}
plugins {
id 'idea'
id 'java-library'
id 'com.google.osdetector' version '1.6.2'
id 'org.javamodularity.moduleplugin' version '1.6.0'
id 'org.beryx.jlink' version '2.17.2'
id 'maven-publish'
id 'net.nemerosa.versioning' version '2.10.0'
id 'com.jfrog.bintray' version '1.8.5'
}
apply plugin: 'biz.aQute.bnd.builder'
sourceCompatibility = '11'
targetCompatibility = '11'
wrapper {
gradleVersion = '6.5'
}
description = 'A JavaFX numberpad'
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}
ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation "org.openjfx:javafx-base:11:$platform"
implementation "org.openjfx:javafx-graphics:11:$platform"
implementation "org.openjfx:javafx-controls:11:$platform"
}
mainClassName = "$moduleName/eu.hansolo.fx.numberpad.Demo"
// start the app from gradle
task Demo(type: JavaExec) {
main = "eu.hansolo.fx.numberpad.Launcher"
classpath = sourceSets.main.runtimeClasspath
}
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.fx.numberpad',
'Export-Package' : 'eu.hansolo.fx.numberpad'
)
}
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'eu.hansolo.fx.numberpad'
}
}
// create one jar for the javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
// create one jar for the source files
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
def pomConfig = {
name 'numberpad'
// 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
url 'https://github.com/HanSolo/numberpad/wiki'
inceptionYear '2020'
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/numberpad.git'
connection 'scm:[email protected]:HanSolo/numberpad.git'
developerConnection 'scm:[email protected]:HanSolo/numberpad.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 = ''
if (!project.hasProperty('sonatypeUsername')) ext.sonatypeUsername = ''
if (!project.hasProperty('sonatypePassword')) ext.sonatypePassword = ''
bintray {
user = project.bintrayUsername
key = project.bintrayApiKey
publications = ['mavenCustom']
pkg {
repo = 'numberpad'
userOrg = 'hansolo'
name = project.name
desc = description
licenses = ['Apache-2.0']
labels = ['java', 'javafx']
websiteUrl = 'https://github.com/HanSolo/numberpad/wiki'
issueTrackerUrl = 'https://github.com/HanSolo/numberpad/issues'
vcsUrl = '[email protected]:HanSolo/numberpad.git'
publicDownloadNumbers = true
version {
name = project.version
vcsTag = project.version
mavenCentralSync {
sync = true
user = project.sonatypeUsername
password = project.sonatypePassword
close = '1'
}
}
}
}