-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
107 lines (94 loc) · 2.62 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
buildscript {
ext.kotlin_version = "1.3.61"
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+'
}
}
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "application"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"
group = "com.github.Gjum"
archivesBaseName = "Botlin"
version = "0.2.1"
ext { // set version according to travis/git
def tag = System.getenv("TRAVIS_TAG")
def buildNr = System.getenv("TRAVIS_BUILD_NUMBER")
def commitHash = System.getenv("TRAVIS_COMMIT")
def isRelease = tag == project.version
if (!isRelease) {
if (buildNr != null) {
project.version = String.format("%s-build%s", project.version, buildNr)
} else if (commitHash != null) {
project.version = String.format("%s-SNAPSHOT+git-%s", project.version, buildNr)
} else {
project.version = "${project.version}-SNAPSHOT"
}
}
}
mainClassName = "com.github.gjum.minecraft.botlin.Main"
jar.manifest.attributes('Main-Class': mainClassName)
runShadow.main = mainClassName
shadowJar.classifier = 'full'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1"
implementation "com.github.Gjum:MCProtocolLib-1.12.2-LTS:1.0.0"
implementation "org.jline:jline:3.11.0"
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2'
testImplementation "io.mockk:mockk:1.9.3"
testCompile 'io.kotest:kotest-runner-junit5:4.0.2798-SNAPSHOT'
}
test {
useJUnitPlatform()
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
javaAndSrcDoc(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
bintray {
publications = ['javaAndSrcDoc']
pkg {
version.name = project.version
name = project.name
repo = 'minecraft'
licenses = ['MPL-2.0']
vcsUrl = 'https://github.com/Gjum/Botlin.git'
}
user = 'gjum'
key = System.getenv('BINTRAY_APIKEY')
}