-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
131 lines (111 loc) · 2.99 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
plugins {
id "java-gradle-plugin"
id "org.jetbrains.kotlin.jvm" version "1.5.21"
id "maven-publish"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(16)
}
}
ext {
def env = System.getenv()
local = !env.GITHUB_ACTIONS
branch = "git rev-parse --abbrev-ref HEAD".execute().text
buildNumber = env.BUILD_NUMBER
}
group "me.dreamhopping.pml"
version "3.14.0"
sourceSets {
runtime {
}
}
repositories {
mavenCentral()
maven {
url "https://maven.fabricmc.net"
}
}
configurations {
runtimeImplementation.extendsFrom(runtimeInclude)
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.0"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
implementation gradleApi()
implementation "com.google.code.gson:gson:2.8.8"
implementation "org.ow2.asm:asm-tree:9.2"
implementation "org.ow2.asm:asm-commons:9.2"
compileOnly "net.fabricmc:fabric-fernflower:1.3.0"
implementation sourceSets.runtime.runtimeClasspath
runtimeInclude "com.google.code.gson:gson:2.8.8"
runtimeInclude "org.apache.httpcomponents:httpclient:4.3.3"
runtimeInclude "commons-io:commons-io:2.5"
runtimeImplementation "org.apache.logging.log4j:log4j-api:2.14.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "net.fabricmc:tiny-mappings-parser:0.3.0+build.17"
}
test {
useJUnitPlatform()
}
task runtimeJar(type: Jar, dependsOn: runtimeClasses) {
from sourceSets.runtime.output
from configurations.runtimeInclude.collect { it.isDirectory() ? it : zipTree(it) }
classifier "runtime"
duplicatesStrategy DuplicatesStrategy.EXCLUDE
manifest.attributes(
"Implementation-Version": project.version
)
}
task runtimeSourcesJar(type: Jar) {
dependsOn "classes", "runtimeClasses"
from sourceSets.runtime.allSource
classifier "runtime-sources"
}
jar {
dependsOn "runtimeJar", "runtimeSourcesJar"
from sourceSets.main.output, sourceSets.runtime.output
manifest.attributes(
"Implementation-Vendor": project.group,
"Implementation-Version": project.version,
"Implementation-Title": project.name
)
from project.tasks.runtimeJar, project.tasks.runtimeSourcesJar
}
java {
withSourcesJar()
}
artifacts {
archives runtimeJar
archives sourcesJar
}
gradlePlugin {
plugins {
pufferfishGradle {
id = "me.dreamhopping.pml.gradle"
implementationClass = "me.dreamhopping.pml.gradle.PufferfishGradle"
}
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "16"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "16"
}
}
publishing {
publications {
//noinspection GroovyAssignabilityCheck
mavenJava(MavenPublication) {
from components.java
pom {
name = "PufferfishGradle"
url = "https://github.com/BookMC/PufferfishGradle"
}
}
}
}