-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
167 lines (155 loc) · 4.81 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
import java.net.URI
plugins {
kotlin("jvm") version Versions.kotlin apply false
`maven-publish`
java
signing
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
publishing {
publications {
create<MavenPublication>("orml") {
from(components["java"])
groupId = "org.openrndr"
}
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.netflix.nebula:nebula-release-plugin:16.0.0")
}
}
val isReleaseVersion = !project.version.toString().endsWith("SNAPSHOT")
// we still have some modules that are built using Groovy script
extra["orxTensorflowBackend"] = "orx-tensorflow"
extra["openrndrOS"] = Configuration.openrndrOS
extra["openrndrVersion"] = System.getenv("OPENRNDR_VERSION")?.replaceFirst("v", "") ?: Versions.openrndr
extra["orxVersion"] = System.getenv("ORX_VERSION")?.replaceFirst("v", "") ?: Versions.orx
val publishableProjects = listOf(
"orml",
"orml-blazepose",
"orml-bodypix",
"orml-dbface",
"orml-facemesh",
"orml-image-classsifier",
"orml-ssd",
"orml-style-transfer",
"orml-super-resolution",
"orml-u2net",
"orml-utils"
)
allprojects {
apply {
plugin("java")
plugin("kotlin")
plugin("nebula.release")
plugin("maven-publish")
plugin("signing")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
extensions.configure<PublishingExtension>() {
this.publications {
create<MavenPublication>("maven") {
groupId = "org.openrndr.orml"
from(components["java"])
}
}
}
repositories {
mavenCentral()
if (Versions.openrndrUseSnapshot || Versions.orxUseSnapshot) {
mavenLocal()
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
}
publishing {
repositories {
maven {
credentials {
username = findProperty("ossrhUsername")?.toString() ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword")?.toString() ?: System.getenv("OSSRH_PASSWORD")
}
url = if (!isReleaseVersion) {
URI("https://s01.oss.sonatype.org/content/repositories/snapshots")
} else {
URI("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
}
}
}
}
allprojects.filter { it.name in publishableProjects }.forEach {
group = "org.openrndr.orml"
val fjdj = it.tasks.create("fakeJavaDocJar", Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
publications {
matching { it.name == "jvm" }.forEach { publication ->
publication as MavenPublication
publication.artifact(fjdj)
}
}
publications {
all {
this as MavenPublication
this.pom {
name.set("${project.name}")
url.set("https://orml.openrndr.org")
developers {
developer {
id.set("edwinjakobs")
name.set("Edwin Jakobs")
email.set("edwin@openrndr.org")
}
}
licenses {
license {
name.set("BSD-2-Clause")
url.set("https://github.com/openrndr/openrndr/blob/master/LICENSE")
distribution.set("repo")
}
}
}
}
}
}
}
signing {
this.setRequired({ isReleaseVersion && gradle.taskGraph.hasTask("publish") })
sign(publishing.publications)
}
nexusPublishing {
repositories {
sonatype {
username.set(findProperty("ossrhUsername")?.toString() ?: System.getenv("OSSRH_USERNAME"))
password.set(findProperty("ossrhPassword")?.toString() ?: System.getenv("OSSRH_PASSWORD"))
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots"))
}
}
}
val markdownToJekyll = tasks.register<MarkdownToJekyllTask>("markdownToJekyll") {
inputDir.set(file("$projectDir"))
outputDir.set(file("docs"))
ignore.set(
listOf(
"demo-data",
"orml-biggan",
"orml-psenet",
"orml-ssd",
"orml-utils",
"images",
"orml-mobile-stylegan"
)
)
titles.set(mapOf("orml" to "Introduction to ORML"))
}.get()