-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
107 lines (96 loc) · 3.07 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
plugins {
id 'java-library'
id 'signing'
id 'maven-publish'
}
version '0.8.0-SNAPSHOT'
group "io.github.m2ci-msp"
description "Java TextGridTools"
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.json', name: 'json', version: '20220924'
testImplementation group: 'org.testng', name: 'testng', version: '7.5'
testImplementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
}
test {
useTestNG()
testLogging {
exceptionFormat = 'full'
}
}
/**********************************************************************************************
** Formatting part
**********************************************************************************************/
task autoFormatCode {
def config = file("astyle.conf")
inputs.files config
outputs.upToDateWhen { false }
doLast {
fileTree(dir: '.', include: '**/*.java').each { java_file ->
exec {
commandLine "astyle", "--options=$config", java_file
}
}
}
}
/**********************************************************************************************
** Project meta + publishing part
**********************************************************************************************/
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = project.name
description = project.description
url = 'https://github.com/m2ci-msp/jtgt'
licenses {
license {
name = 'GNU Lesser General Public License v3.0 only'
url = 'https://spdx.org/licenses/LGPL-3.0-only.html'
}
}
developers {
developer {
id = 'seblemaguer'
name = 'Sébastien Le Maguer'
}
developer {
id = 'psibre'
name = 'Ingmar Steiner'
}
}
scm {
connection = 'scm:git:git://github.com/m2ci-msp/jtgt.git'
developerConnection = 'scm:git:ssh://git@github.com:m2ci-msp/jtgt.git'
url = 'https://github.com/m2ci-msp/jtgt'
}
}
}
}
repositories {
maven {
name 'NewOSSRH'
url isReleaseVersion ? 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2'
: 'https://s01.oss.sonatype.org/content/repositories/snapshots'
credentials(PasswordCredentials)
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}