This repository has been archived by the owner on Dec 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
164 lines (138 loc) · 4.54 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
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
mavenCentral()
jcenter()
}
}
plugins {
id "org.jetbrains.kotlin.jvm" version "$kotlin_version" apply false
}
version '1.0.1'
allprojects {
group 'com.sultanofcardio'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: "org.jetbrains.kotlin.jvm"
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
doclava
}
dependencies {
doclava 'com.google.doclava:doclava:1.0.6'
doclava 'org.jetbrains:annotations:16.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'org.jetbrains:annotations:16.0.1'
api "org.jetbrains.kotlin:kotlin-reflect:1.3.72"
testImplementation 'junit:junit:4.12'
}
def artifactName = rootProject.name == project.name ? "${project.name}" : "${rootProject.name}-${project.name}"
jar {
baseName = "$artifactName"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
baseName = "${project.name}"
version = version
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
baseName = "${project.name}"
version = version
from sourceSets.main.allSource
}
assemble.dependsOn(sourcesJar, javadocJar)
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://repo.sultanofcardio.com/artifactory/sultanofcardio'
}
maven {url 'http://clojars.org/repo/'}
}
publishing {
repositories {
maven {
name "sultanofcardio"
credentials {
username "${sultanofcardioUser}"
password "${sultanofcardioPassword}"
}
url "${sultanofcardioUrl}"
}
maven {
name "kiosk-mixed"
credentials {
username "${kioskMixedUser}"
password "${kioskMixedPassword}"
}
url "${kioskMixedUrl}"
}
}
publications {
binary(MavenPublication) {
artifactId "$artifactName"
version project.version
from components.java
artifact javadocJar
if(rootProject.name != project.name) {
pom.withXml {
def props = asNode().getByName('dependencies').get(0).appendNode('dependency')
props.appendNode('groupId', group)
props.appendNode('artifactId', rootProject.name)
props.appendNode('version', rootProject.version)
props.appendNode('scope', 'compile')
}
}
}
snapshot(MavenPublication) {
artifactId "$artifactName"
version "${getVersion()}-SNAPSHOT"
from components.java
artifact javadocJar
if(rootProject.name != project.name) {
pom.withXml {
def props = asNode().getByName('dependencies').get(0).appendNode('dependency')
props.appendNode('groupId', group)
props.appendNode('artifactId', rootProject.name)
props.appendNode('version', "${rootProject.version}-SNAPSHOT")
props.appendNode('scope', 'compile')
}
}
}
}
}
task generateJavadoc(type: Javadoc, dependsOn: project.configurations.doclava) {
failOnError = true
title = null
source = sourceSets.main.java.srcDirs
options.overview = "src/overview.html"
options.doclet = "com.google.doclava.Doclava"
options.docletpath = configurations.doclava.files as List
classpath += sourceSets.main.runtimeClasspath
destinationDir = file("build/docs/javadoc/${version}")
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = ["-Xjvm-default=compatibility"]
}
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
subprojects {
dependencies {
compileOnly project(':')
testImplementation project(':')
}
}
dependencies {
testImplementation project(":vendors:h2")
}