-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
128 lines (111 loc) · 3.53 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
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "net.researchgate:gradle-release:2.8.1"
}
}
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'net.researchgate.release'
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
compileTestJava.options.encoding = "UTF-8"
project.ext.githubUserName = project.hasProperty('githubUserName') ? githubUserName : ""
project.ext.githubToken = project.hasProperty('githubToken') ? githubToken : ""
publishing {
repositories {
maven {
name = "GitHub Packages"
url = uri("https://maven.pkg.github.com/HardNorth/config-simple")
credentials {
username = githubUserName
password = githubToken
}
}
}
}
dependencies {
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.cfg4j:cfg4j-core:4.4.1'
implementation 'org.apache.commons:commons-io:1.3.2'
implementation 'org.apache.commons:commons-text:1.8'
testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${project.junitVersion}"
testImplementation "org.junit.platform:junit-platform-runner:${project.junitRunnerVersion}"
testImplementation "org.junit.platform:junit-platform-console-standalone:${project.junitRunnerVersion}"
testImplementation 'org.hamcrest:hamcrest:2.2'
}
test {
useJUnitPlatform()
systemProperty("file.encoding", "utf-8")
testLogging {
exceptionFormat = 'full'
}
exclude('com/github/hardnorth/common/config/feature/**')
}
task uberjar(type: Jar) {
archiveClassifier.set("all")
from files(sourceSets.main.output.classesDirs)
from(configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
manifest {
attributes 'Implementation-Title': project.name,
'Implementation-Version': archiveVersion,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version')
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
getArchiveClassifier().set('sources')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
getArchiveClassifier().set('javadoc')
}
artifacts {
archives sourcesJar
archives javadocJar
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId project.group
artifactId project.name
description project.description
pom.withXml {
def root = asNode()
root.children().last() + pomConfig
}
artifact sourcesJar
artifact javadocJar
}
}
}
def releaseDependencies = [publish]
releaseDependencies.addAll(afterReleaseBuild.getDependsOn())
afterReleaseBuild.setDependsOn(releaseDependencies)