-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathbuild.gradle.kts
187 lines (171 loc) · 6.04 KB
/
build.gradle.kts
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
import org.javamodularity.moduleplugin.extensions.TestModuleOptions
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
/**
* Gradle version 6.6.1
*/
plugins {
kotlin("jvm") version "1.3.61"
`java-library`
id("org.openjfx.javafxplugin") version "0.0.9"
`maven-publish`
id("org.jetbrains.dokka") version "1.4.20"
signing
}
//see gradle.properties
val tornado_version: String by project
val kotlin_version: String by project
val json_version: String by project
val dokka_version: String by project
val httpclient_version: String by project
val felix_framework_version: String by project
val junit4_version: String by project
val junit5_version: String by project
val testfx_version: String by project
val hamcrest_version: String by project
val fontawesomefx_version: String by project
group = "no.tornado"
version = "2.0.0-SNAPSHOT"
description = "JavaFX Framework for Kotlin"
extra["isReleaseVersion"] = !version.toString().endsWith("SNAPSHOT")
repositories {
jcenter()
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}")
api("org.glassfish:javax.json:${json_version}")
api("org.apache.httpcomponents:httpclient:${httpclient_version}")
api("de.jensd:fontawesomefx-fontawesome:${fontawesomefx_version}")
implementation("org.apache.felix:org.apache.felix.framework:${felix_framework_version}")
}
javafx {
version = "15.0.1"
modules = listOf("javafx.controls", "javafx.fxml", "javafx.swing", "javafx.web", "javafx.media")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
tasks.withType<JavaCompile> {
options.release.set(11)
}
java.withSourcesJar()
tasks.jar {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
}
/**
* Testing
*/
sourceSets {
getByName("test").java.srcDirs("src/test/kotlin")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
//no modules yet
extensions.configure(TestModuleOptions::class) {
runOnClasspath = true
}
}
dependencies {
//common
testImplementation("org.hamcrest:hamcrest:${hamcrest_version}")
testImplementation("org.hamcrest:hamcrest-library:${hamcrest_version}")
testImplementation("org.testfx:testfx-junit5:${testfx_version}")
//Junit 5
testImplementation(platform("org.junit:junit-bom:${junit5_version}"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5:${kotlin_version}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
//Junit 4
testCompileOnly("junit:junit:${junit4_version}")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
//headless
testRuntimeOnly("org.testfx:openjfx-monocle:jdk-12.0.1+2") // jdk-9+181 for Java 9, jdk-11+26 for Java 11
}
/**
* Publishing
*/
publishing {
repositories {
maven {
name = "release"
description = "Release repository"
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
url = if(version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
// credentials {
// username = scdUserName
// password = scdPassword
// }
}
}
publications {
create<MavenPublication>("tornadofx") {
from(components["java"])
pom {
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
name.set("Edvin Syse")
email.set("[email protected]")
organization.set("SYSE AS")
organizationUrl.set("https://www.syse.no")
}
developer {
name.set("Thomas Nield")
email.set("[email protected]")
organization.set("Southwest Airlines")
organizationUrl.set("https://www.southwest.com/")
}
developer {
name.set("Matthew Turnblom")
email.set("[email protected]")
organization.set("Xactware")
organizationUrl.set("https://www.xactware.com/")
}
developer {
name.set("Craig Tadlock")
email.set("[email protected]")
organization.set("GoToTags")
organizationUrl.set("https://gototags.com/")
}
}
scm {
connection.set("scm:git:[email protected]:edvin/tornadofx2.git")
developerConnection.set("scm:git:[email protected]:edvin/tornadofx2.git")
url.set("[email protected]:edvin/tornadofx2.git")
}
}
}
}
}
signing {
setRequired({
(project.extra["isReleaseVersion"] as Boolean) && gradle.taskGraph.hasTask("publish")
})
val signingKey: String? by project // ORG_GRADLE_PROJECT_signingKey
val signingPassword: String? by project // ORG_GRADLE_PROJECT_signingPassword
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["tornadofx"])
}
}