-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
94 lines (78 loc) · 2.18 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
plugins {
id 'java-library'
id 'maven-publish'
}
def versionValue = System.getenv('VERSION') ?: '13.5.2'
group = 'me.devtec.theapi.loaders'
version = versionValue
repositories {
mavenCentral()
mavenLocal()
}
allprojects {
repositories {
maven {
url = 'https://jitpack.io'
}
}
}
dependencies {
implementation 'com.github.TheDevTec:TheAPI-Shared:13.5.2'
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'
implementation 'com.github.TheDevTec:TheAPI-Shared:13.5.2'
}
tasks.withType(JavaCompile) {
options.annotationProcessorPath = configurations.annotationProcessor
}
task buildJar(type: Jar) {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
from sourceSets.main.output
archiveBaseName.set(project.name)
archiveVersion.set(versionValue)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = project.name
version = versionValue
from components.java
}
}
}
}
task buildJar(type: Jar) {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
from subprojects.collect { it.sourceSets.main.output }
archiveBaseName.set(project.name)
archiveVersion.set(versionValue)
}
publishing {
publications {
jar(MavenPublication) {
from components.java
artifactId = 'TheAPI'
version = versionValue
publishJarPublicationToMavenLocal.dependsOn buildJar
}
}
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
build.dependsOn buildJar