-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
91 lines (82 loc) · 2.39 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
plugins {
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'signing'
}
group 'net.nokok.draft'
version '1.1.1'
repositories {
jcenter()
mavenLocal()
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
dependencies {
implementation 'javax.inject:javax.inject:1'
testImplementation 'com.google.inject:guice:3.0'
testImplementation 'javax.inject:javax.inject-tck:1'
testImplementation 'org.codehaus.groovy:groovy-all:2.5.10'
testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5'
testImplementation 'junit:junit:4.12'
testImplementation 'com.google.testing.compile:compile-testing:0.18'
}
task signFiles(type: Sign) {
sign project.file('build/publications/maven/pom-default.xml')
outputs.upToDateWhen { false }
}
signing {
sign configurations.archives
sign publishing.publications
}
if(!hasProperty('nexusUsername')) {
ext.nexusUsername = "dummy"
}
if(!hasProperty('nexusPassword')) {
ext.nexusPassword = "dummy"
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = 'draft'
version = project.version
from components.java
pom {
name = 'Draft'
description = 'Implementation of JSR-330'
url = 'https://github.com/nokok/Draft'
developers {
developer {
id = 'nokok'
name = 'Noriyuki Kazusawa'
email = '[email protected]'
}
}
licenses {
license {
name = 'MIT License'
url = 'https://github.com/nokok/Draft/blob/master/LICENSE'
}
}
scm {
url = '[email protected]:nokok/Draft.git'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = "${nexusUsername}"
password = "${nexusPassword}"
}
}
}
}