-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathbuild.gradle
135 lines (121 loc) · 4.87 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
plugins {
id "java"
id "org.jetbrains.kotlin.jvm" version "1.6.0"
id "org.jetbrains.dokka" version "1.4.30"
}
allprojects {
group = "net.cloudopt.next"
version = property("project_version")
sourceCompatibility = property("java_version")
repositories {
mavenCentral()
}
}
subprojects {
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${property('kotlin_version')}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${property('kotlin_version')}"
classpath "org.jetbrains.kotlin:kotlin-noarg:${property('kotlin_version')}"
}
}
test {
useJUnitPlatform()
}
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "org.jetbrains.dokka"
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:${property('kotlin_version')}"
implementation "org.jetbrains.kotlin:kotlin-reflect:${property('kotlin_version')}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${property('kotlinx_version')}"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:${property('kotlinx_version')}"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:${property('dokka_version')}"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.0"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.6.0"
}
compileJava {
sourceCompatibility = rootProject.property("java_version")
targetCompatibility = rootProject.property("java_version")
[compileJava]*.options*.encoding = "UTF-8"
}
compileTestJava {
sourceCompatibility = rootProject.property("java_version")
targetCompatibility = rootProject.property("java_version")
[compileTestJava]*.options*.encoding = "UTF-8"
}
compileKotlin {
kotlinOptions.jvmTarget = rootProject.property("java_version")
}
compileTestKotlin {
kotlinOptions.jvmTarget = rootProject.property("java_version")
}
dokkaJavadoc {
outputDirectory.set(new File(buildDir, "javadoc"))
}
java {
withJavadocJar()
withSourcesJar()
}
if (
project.name != "plugins"
) {
plugins.withId("maven-publish") {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = project.group + ":" + project.name
url = "https://github.com/cloudoptlab/cloudopt-next"
afterEvaluate {
// description is not available until evaluated.
description = project.description
}
scm {
connection = "scm:git:https://github.com/cloudoptlab/cloudopt-next.git"
developerConnection = "scm:git:[email protected]:cloudoptlab/cloudopt-next.git"
url = "https://github.com/cloudoptlab/cloudopt-next"
}
licenses {
license {
name = "Apache 2.0"
url = "https://opensource.org/licenses/Apache-2.0"
}
}
developers {
developer {
id = "cloudopt.net"
name = "Cloudopt"
email = "[email protected]"
url = "https://www.cloudopt.net/"
organization = "Cloudopt"
organizationUrl = "https://www.cloudopt.net/"
}
}
}
}
}
repositories {
maven {
def releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl
credentials {
username findProperty("sonatypeUsername") as String
password findProperty("sonatypePassword") as String
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
}