This repository was archived by the owner on Nov 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
79 lines (66 loc) · 1.89 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
import org.apache.tools.ant.filters.ReplaceTokens
// -- project metadata
group 'io.github.xxyy'
version '1.1.1-SNAPSHOT'
// -- build plugins
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'net.linguica.maven-settings'
// -- project properties
defaultTasks 'clean', 'build', 'publishToMavenLocal'
sourceCompatibility = 1.7
def commitHash = 'git rev-parse --short HEAD'.execute().text.trim()
def fullVersion = version + '-git-' + commitHash
def buildName = commitHash + '-@-' + new Date().format('yyyy-MM-dd HH:mm')
// -- build dependencies
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
compile group: 'net.md-5', name: 'bungeecord-api', version: '1.8-SNAPSHOT'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
// -- deployment
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven { //reads from Maven settings.xml (~/.m2/settings.xml) repo definition with that id
name quietcord_deploy_repo_id
url quietcord_deploy_repo_url
}
}
}
// -- buildscript dependencies
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
}
dependencies {
classpath 'net.linguica.gradle:maven-settings-plugin:0.4'
classpath 'org.ajoberstar:grgit:1.4.0'
}
}
// -- plugin configurations
jar {
manifest.attributes "Implementation-Title": project.name
manifest.attributes "Implementation-Version": project.version
manifest.attributes "Implementation-Build": buildName
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
configure(tasks.processResources) {
include '**/*.yml'
filter(ReplaceTokens,
tokens: [version: fullVersion])
}