-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
111 lines (101 loc) · 2.34 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
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
sourceSets {
main {
java {
srcDir 'src/main'
}
}
test {
java {
srcDir 'src/test'
}
resources {
srcDir 'assets'
}
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
jar {
manifest {
attributes(
'Hjson-Version': project.version,
)
}
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
task(testSuite, dependsOn: ['classes','testClasses'], type: JavaExec) {
mainClass = 'org.hjson.test.Main'
classpath = files(sourceSets.main.runtimeClasspath, sourceSets.test.runtimeClasspath)
}
test.dependsOn testSuite
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = "Hjson Library"
description = project.description
url = "https://github.com/hjson/hjson-java"
licenses {
license {
name = "The MIT License (MIT)"
url = "https://github.com/hjson/hjson-java/blob/master/LICENSE"
distribution = "repo"
}
}
developers {
developer {
id = "laktak"
name = "Christian Zangl"
}
developer {
id = "trobro"
name = "Fredrik Trobro"
}
}
scm {
connection = "scm:[email protected]:hjson/hjson-java.git"
developerConnection = "scm:[email protected]:hjson/hjson-java.git"
url = "https://github.com/hjson/hjson-java"
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
def signingKey = System.getenv("GPG_SIGNING_KEY")
def signingPassword = System.getenv("GPG_SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.maven
}