-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
95 lines (83 loc) · 2.26 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
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'java'
id "com.dorongold.task-tree" version "1.4"
}
group 'qilin'
// version format: major.minor.patch
version '0.9.5-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(16)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation(project(':qilin.microben'))
implementation(project(':qilin.pta'))
implementation(project(':qilin.core'))
implementation(project(':qilin.util'))
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
tasks.register('fatJar', Jar) {
dependsOn(tasks.named('build'))
manifest {
attributes 'artifact': 'qilin',
'Version': getArchiveVersion(),
'Main-Class': 'driver.Main'
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
doLast {
copy {
from "$buildDir/libs/${archiveBaseName.get()}-${getArchiveVersion().get()}.jar"
into "$rootDir/artifact/"
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
group rootProject.group
version rootProject.version
tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources')
from(sourceSets.main.allSource)
}
tasks.register('javadocJar', Jar) {
archiveClassifier.set('javadoc')
from(javadoc.destinationDir)
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(16)
vendor = JvmVendorSpec.ADOPTIUM
}
}
publishing.publications {
qilin(MavenPublication) {
artifactId = artifactId.substring(6)
from components.java
artifact sourcesJar
artifact javadocJar
}
}
publishing.repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/QiLinPTA/QiLin"
credentials {
username = project.findProperty("gpr.user") ?: "QiLinPTA"
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
}