-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
149 lines (126 loc) · 4.17 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* SimMath build script.
*/
plugins {
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'signing'
}
version='1.6.1-SNAPSHOT'
group='com.simsilica'
ext.websiteUrl = 'https://github.com/Simsilica/SimMath'
ext.jmeVersion = "3.1.0-stable"
ext.slf4jVersion = '1.7.32'
repositories {
mavenCentral()
}
dependencies {
// Pull in jme core for the math package for easy translation to/from JME
// classes.
api "org.jmonkeyengine:jme3-core:$jmeVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
testImplementation 'junit:junit:4.12'
testImplementation 'org.codehaus.groovy:groovy-all:2.4.11'
}
compileJava { // compile-time options:
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
if( JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_10) ) {
options.release = 7
}
}
java {
sourceCompatibility = 1.7
targetCompatibility = 1.7
withJavadocJar()
withSourcesJar()
}
javadoc {
// Disable doclint for JDK8+.
if( JavaVersion.current().isJava8Compatible() ) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
test {
testLogging {
// I want to see the tests that are run and pass, etc.
events "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showCauses true
showExceptions true
showStackTraces true
}
}
sourceSets {
main {
resources {
exclude "**/.backups/**"
}
}
}
publishing {
publications {
library(MavenPublication) {
from components.java
pom {
description = 'A double-based math package similar to JME\'s float-based math classes.'
developers {
developer {
name = 'Paul Speed'
}
}
inceptionYear = '2015'
licenses {
license {
distribution = 'repo'
name = 'New BSD (3-clause) License'
url = project.ext.websiteUrl + '/blob/master/license.md'
}
}
name = project.group + ':' + project.name
scm {
connection = 'scm:git:git://github.com/Simsilica/SimMath.git'
developerConnection = 'scm:git:ssh://github.com:Simsilica/SimMath.git'
url = project.ext.websiteUrl + '/tree/master'
}
url = project.ext.websiteUrl
}
}
}
// Staging to OSSRH relies on the existence of 2 properties
// (ossrhUsername and ossrhPassword)
// which should be stored in ~/.gradle/gradle.properties
repositories {
maven {
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : 'Unknown user'
password = project.hasProperty('ossrhPassword') ? ossrhPassword : 'Unknown password'
}
name = 'OSSRH'
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
//url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
}
}
}
tasks.register('install') {
dependsOn 'publishToMavenLocal'
description 'Installs Maven artifacts to the local repository.'
}
// signing tasks
// Signing relies on the existence of 3 properties
// (signing.keyId, signing.password, and signing.secretKeyRingFile)
// which should be stored in ~/.gradle/gradle.properties
signing {
sign publishing.publications
}
tasks.withType(Sign) {
onlyIf { project.hasProperty('signing.keyId') }
}
// Customize some tasks
tasks.sourcesJar {
exclude "**/.backups/**"
}