-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
107 lines (97 loc) · 2.2 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 'application'
id 'maven-publish'
id 'signing'
id 'jacoco'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.sonarsource.sonarlint.core:sonarlint-core:8.0.2.42487'
testImplementation 'junit:junit:4.13.2'
testImplementation 'com.google.code.gson:gson:2.8.6'
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
html.enabled true
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
application {
mainClass = 'io.github.spinsie.chirp.Analyzer'
}
version = {
def stdout = new ByteArrayOutputStream()
def result = exec {
commandLine 'git', 'describe', '--tags', '--match', 'v[0-9]*'
standardOutput = stdout
ignoreExitValue true
}
if (result.getExitValue() != 0) {
return 'unspecified'
}
return stdout.toString().trim().substring(1)
}()
jar {
manifest {
attributes 'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Main-Class': 'io.github.spinsie.chirp.Analyzer',
'Sealed': 'true'
}
}
signing {
required = { gradle.taskGraph.hasTask('uploadArchives') }
sign publishing.publications
}
tasks.withType(Jar) {
from('LICENSE') {
into 'META-INF'
}
}
publishing {
repositories {
maven {
url = { 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' }
credentials {
username = findProperty('ossrhUsername')
password = findProperty('ossrhPassword')
}
}
}
publications {
sonatype(MavenPublication) {
from components.java
pom {
name = 'chirp'
description = 'Library and CLI Code Analyzer'
url = 'https://github.com/spinsie/chirp'
scm {
connection = 'scm:git:git://github.com/spinsie/chirp.git'
developerConnection = 'scm:git:ssh://github.com/spinsie/chirp.git'
url = 'https://github.com/spinsie/chirp'
}
licenses {
license {
name = 'MIT License'
url = 'https://github.com/spinsie/chirp/blob/main/LICENSE'
}
}
developers {
developer {
name = 'spinsie'
email = '009101@gmail.com'
}
}
}
}
}
}