-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
87 lines (74 loc) · 2.12 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
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GrDeprecatedAPIUsage
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.5.30'
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = project.mvn_group
version = project.console_version
if (project.build_number != "undefined") version += "+build.${project.build_number}"
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib"
api "com.google.code.gson:gson:2.8.9"
api "com.github.HyDevelop:HyConfigLib:3.1.52"
api "net.mamoe:mirai-core:${mirai_version}"
api "org.apache.logging.log4j:log4j-api:${log4j_version}"
api "org.apache.logging.log4j:log4j-core:${log4j_version}"
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
}
task copyJar(type: Copy) {
from configurations.runtimeClasspath
into 'build/libs/lib'
}
jar.dependsOn([copyJar])
jar {
from("LICENSE")
manifest {
attributes ([
"Main-Class" : "net.cjsah.console.MainKt",
"Class-Path" : configurations.runtimeClasspath.files.collect { "lib/$it.name" }.join(' ')
])
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task docJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
tasks.withType(Javadoc) {
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
publishing {
publications {
mavenJava(MavenPublication) {
version project.console_version
// groupId project.group
artifactId project.archivesBaseName
from components.java
artifact sourcesJar
artifact docJar
}
}
def ENV = System.getenv()
if (ENV.MAVEN_URL) {
repositories.maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}