forked from KrystilizeNevaDies/JLSL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
89 lines (74 loc) · 1.8 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
plugins {
id 'java'
id 'maven-publish'
}
group 'org.stianloader'
version '1.0.0'
repositories {
mavenCentral()
}
dependencies {
// Intellij annotations
compileOnly 'org.jetbrains:annotations:24.1.0'
// ASM
implementation 'org.ow2.asm:asm-tree:9.7'
implementation 'org.ow2.asm:asm:9.7'
implementation 'org.ow2.asm:asm-util:9.7'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
compileJava {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
jar {
into('META-INF/LICENSES/' + archivesBaseName) {
from project.rootProject.file("LICENSE")
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
into('META-INF/LICENSES/' + archivesBaseName) {
from project.rootProject.file("LICENSE")
}
}
javadoc {
javadocTool = javaToolchains.javadocToolFor{
languageVersion = JavaLanguageVersion.of(17)
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
plugin(MavenPublication) { publication ->
groupId project.group
artifactId project.archivesBaseName
version version
from components['java']
artifact sourcesJar
}
}
repositories {
if (System.getProperty('publishRepo') != null) {
maven {
url System.getProperty('publishRepo')
allowInsecureProtocol = true
}
} else {
mavenLocal()
}
}
}