forked from amazon-ion/ion-schema-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
151 lines (137 loc) · 4.03 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
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.0.0"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.32"
}
}
plugins {
id "org.jetbrains.kotlin.jvm" version "1.4.0"
id "org.jetbrains.dokka" version "1.4.32"
id "maven-publish"
id "signing"
id "org.jlleitschuh.gradle.ktlint" version "10.0.0"
}
group = "com.amazon.ion"
version = "1.2.2-SNAPSHOT"
ext.kotlin_version = "[1.3,1.6["
repositories {
mavenCentral()
jcenter()
}
dependencies {
api "com.amazon.ion:ion-java:[1.4,)"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// We're running tests with an old version of kotlin Stdlib to ensure the library is compatible for consumers still using Kotlin 1.3.
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
sourceSets {
main.kotlin.srcDirs = ["src"]
test.kotlin.srcDirs = ["test"]
}
processResources {
from('ion-schema-schemas/isl/') {
into 'ion-schema-schemas/isl/'
}
from('ion-schema-schemas/json/') {
into 'ion-schema-schemas/json/'
}
}
compileKotlin{
kotlinOptions.apiVersion = "1.3"
kotlinOptions.languageVersion = "1.4" // Can be read by 1.3 compiler, so consumers on kotlin 1.3 are still supported.
}
compileTestKotlin {
kotlinOptions.apiVersion = "1.3"
kotlinOptions.languageVersion = "1.4"
}
ktlint {
outputToConsole = true
}
dokkaJavadoc.configure {
dokkaSourceSets {
named("main") {
includes.from("src/com/amazon/ionschema/module.md")
sourceLink {
// URL showing where the source code can be accessed through the web browser
remoteUrl.set(java.net.URL("https://github.com/amzn/ion-schema-kotlin/blob/master/src"))
// Suffix which is used to append the line number to the URL. Use #L for GitHub
remoteLineSuffix.set("#L")
}
}
}
}
task sourcesJar(type: Jar) {
classifier 'sources'
from "src"
}
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier 'javadoc'
from dokkaJavadoc.outputDirectory
}
publishing {
publications {
maven(MavenPublication) {
artifactId = "ion-schema-kotlin"
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = "Ion Schema Kotlin"
packaging = "jar"
url = "https://github.com/amzn/ion-schema-kotlin"
description = "Reference implementation of the Amazon Ion Schema Specification."
scm {
connection = "scm:[email protected]:amzn/ion-schema-kotlin.git"
developerConnection = "scm:[email protected]:amzn/ion-schema-kotlin.git"
url = "[email protected]:amzn/ion-schema-kotlin.git"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
name = "Amazon Ion Team"
email = "[email protected]"
organization = "Amazon"
organizationUrl = "https://github.com/amzn"
}
}
}
}
}
repositories {
maven {
url "https://aws.oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}
signing {
sign publishing.publications.maven
}