-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
118 lines (103 loc) · 3.3 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
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'signing'
}
repositories {
mavenLocal()
mavenCentral()
}
group = 'com.epagagames'
version = '1.1.1'
ext {
jmonkeyengine_version = '3.3.2-stable'
}
dependencies {
api "org.jmonkeyengine:jme3-core:$jmonkeyengine_version"
api "org.jmonkeyengine:jme3-effects:$jmonkeyengine_version"
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
exclude '**/.backups'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'particlemonkey'
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
developers {
developer {
name = 'Greg Hoffman'
}
}
licenses {
license {
distribution = 'repo'
name = 'New BSD (3-clause) License'
url = 'https://github.com/Jeddic/particlemonkey/blob/master/LICENSE'
}
}
name = 'Particlemonkey'
description = 'A particle library for the jmonkey engine'
url = 'https://github.com/Jeddic/particlemonkey'
scm {
url = 'https://github.com/Jeddic/particlemonkey'
}
}
}
}
// 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://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
// Have to evaluate the project version late because when the conventions
// are configured the project build file hasn't set the version yet.
afterEvaluate {
url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
}
// 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') }
}