forked from TomasMikula/EasyBind
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
150 lines (134 loc) · 4.55 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'org.hibernate.build.maven-repo-auth' version '3.0.3'
id 'org.javamodularity.moduleplugin' version '1.8.15'
id 'io.codearte.nexus-staging' version '0.30.0'
}
repositories {
jcenter()
}
group = 'com.tobiasdiez'
version = '2.2.1-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
// Ensure Java 8 compatibility while providing proper module description
// See https://github.com/java9-modularity/gradle-modules-plugin#separate-compilation-of-module-infojava
//modularity.mixedJavaRelease 8
//modularity.standardJavaRelease 9
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.3'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.3'
}
java {
withJavadocJar()
withSourcesJar()
}
javafx {
version = "19"
modules = ['javafx.base']
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'easybind'
from components.java
pom {
name = 'EasyBind'
description = 'Factory methods for easy creation of JavaFX bindings using lambdas.'
url = 'https://github.com/tobiasdiez/EasyBind'
licenses {
license {
name = 'The BSD 2-Clause License'
url = 'http://opensource.org/licenses/BSD-2-Clause'
distribution = 'repo'
}
}
developers {
developer {
id = 'tobiasdiez'
name = 'Tobias Diez'
}
developer {
name = 'Tomas Mikula'
}
}
scm {
url = 'https://github.com/tobiasdiez/EasyBind'
connection = 'scm:git:git://github.com/tobiasdiez/EasyBind.git'
developerConnection = 'scm:git:[email protected]/tobiasdiez/EasyBind.git'
}
}
// Remove os-specific 'classifier' in pom for JavaFX dependency
// Taken from https://github.com/TestFX/Monocle/issues/64#issuecomment-489215444
pom.withXml {
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
it.groupId.text() == 'org.openjfx'
}.each {
it.remove(it.classifier)
}
}
}
}
repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
// This currently only works for released versions, as github has problems with overwriting snapshots
if (isReleaseVersion) {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/tobiasdiez/EasyBind"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}
signing {
required = isReleaseVersion
useInMemoryPgpKeys(System.getenv("SIGNING_KEY"), System.getenv("SIGNING_PASSWORD"))
sign publishing.publications.mavenJava
}
nexusStaging {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
// Don't publish snapshots to Maven Central
closeAndReleaseRepository.onlyIf { isReleaseVersion }
closeRepository.onlyIf { isReleaseVersion }
releaseRepository.onlyIf { isReleaseVersion }
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
showExceptions true
showCauses true
showStackTraces true
}
}
/* uncomment if you want to compile the test in eclipse
compileTestJava {
moduleOptions {
compileOnClasspath = true
}
}
*/
tasks.withType(Javadoc) {
// Ignore warnings because of missing elements
options.addStringOption('Xdoclint:all,-missing', '-quiet')
}