-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
137 lines (116 loc) · 2.79 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
plugins {
id 'java-library'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.8.4'
id 'uk.co.probablyfine.gradle.test-commit-revert' version '0.3.5'
id 'com.diffplug.spotless' version '5.6.1'
}
ext {
gitUrl = "https://github.com/mrwilson/femto"
}
group 'uk.co.probablyfine'
version '0.2.0'
sourceCompatibility = 14
targetCompatibility = 14
repositories {
mavenCentral()
jcenter()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testImplementation 'org.hamcrest:hamcrest:2.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
}
testCommitRevert {
promptForMessage = true
}
spotless {
java {
googleJavaFormat('1.9').aosp()
}
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
tasks.withType(Javadoc).all { enabled = false }
artifacts {
archives sourcesJar
archives javadocJar
}
def pomConfig = {
developers {
developer {
id "probablyfine"
name 'Alex Wilson'
email "[email protected]"
}
}
licenses {
license {
name 'MIT'
url gitUrl + '/blob/main/LICENCE.md'
distribution 'repo'
}
}
scm {
url gitUrl
}
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId project.group
artifactId project.name
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'A teeny-tiny dependency injection library')
root.appendNode('name', project.name)
root.appendNode('url', gitUrl)
root.children().last() + pomConfig
}
}
}
}
bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['mavenPublication']
pkg {
repo = project.group
name = project.name
licenses = ['MIT']
vcsUrl = gitUrl
version {
name = project.version
desc = project.version
released = new Date()
gpg {
sign = true
}
}
}
publish = true
}