-
Notifications
You must be signed in to change notification settings - Fork 64
/
build.gradle
147 lines (123 loc) · 4.77 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
buildscript {
repositories {
jcenter()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.github.node-gradle:gradle-node-plugin:$gradle_node_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$kotlin_native_gradle_plugin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+"
classpath 'com.adarshr:gradle-test-logger-plugin:1.6.0'
}
}
ext {
libs = [
// Compile
kotlin_stdlib_common : "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version",
kotlin_stdlib_jvm : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version",
kotlin_stdlib_js : "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version",
kotlin_reflect : "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version",
// Tests
kotlin_test_common : "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version",
kotlin_test_jvm : "org.jetbrains.kotlin:kotlin-test:$kotlin_version",
kotlin_test_junit : "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version",
kotlin_test_js : "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version",
kotlin_test_annotations: "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version",
kotlinx_coroutines_test: "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinx_coroutines_version",
junit : "junit:junit:4.13.2",
]
}
allprojects {
group 'org.amshove.kluent'
version '1.73'
apply plugin: 'com.adarshr.test-logger'
repositories {
mavenCentral()
}
}
subprojects {
ext.configurePublishing = { artifactName = null ->
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'signing'
artifactName = artifactName ?: project.name
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
java {
withJavadocJar()
withSourcesJar()
}
def isAndroid = project.rootProject.hasProperty("ANDROID")
sourceCompatibility = 1.8
targetCompatibility = 1.8
publishing {
repositories {
maven {
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
credentials {
username = findProperty('ossrhUsername')
password = findProperty('ossrhPassword')
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = artifactName
from components.java
pom {
name = artifactName
packaging 'jar'
description = 'Fluent Assertion-Library for Kotlin'
url = 'https://github.com/MarkusAmshove/Kluent'
scm {
connection = 'scm:git:https://github.com/MarkusAmshove/Kluent.git'
developerConnection = 'scm:git:[email protected]/MarkusAmshove/Kluent.git'
url = 'https://github.com/MarkusAmshove/Kluent'
}
licenses {
license {
name = 'MIT'
url = 'https://github.com/MarkusAmshove/Kluent/blob/master/LICENSE'
}
}
developers {
developer {
id = 'markusamshove'
name = 'Markus Amshove'
}
}
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
task printArtifactName {
doLast {
logger.info("artifactName: $artifactName")
}
}
if(project.tasks.findByName('generateMetadataFileForMavenJavaPublication')) {
project.tasks['generateMetadataFileForMavenJavaPublication'].dependsOn(checkJavaVersion)
}
}
}
task checkJavaVersion {
doLast {
def currentJvm = org.gradle.internal.jvm.Jvm.current()
if(!currentJvm.toString().startsWith('1.8'))
{
throw new RuntimeException("For publishing, JAVA_HOME needs to point to Java 8")
}
}
}