-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
116 lines (97 loc) · 3.47 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
plugins {
id 'java'
id 'groovy'
id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}"
id 'idea'
id 'org.jetbrains.intellij' version '1.13.3'
id 'org.cadixdev.licenser' version '0.6.1'
}
group = pluginGroup
version = pluginVersion
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
sourceSets {
gradleToolingExtension
}
def gradleToolExtensionJar = tasks.register(sourceSets.gradleToolingExtension.jarTaskName, Jar) {
from sourceSets.gradleToolingExtension.output
archiveClassifier = 'gradle-tooling-extension'
}
tasks.jar.dependsOn sourceSets.gradleToolingExtension.jarTaskName
repositories {
mavenCentral()
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
maven {
name = 'Minecraft Forge'
url = 'https://maven.minecraftforge.net'
}
maven {
name = 'IntelliJ Dependencies'
url = 'https://cache-redirector.jetbrains.com/intellij-dependencies'
}
maven {
name = 'IntelliJ Snapshots' // For org.jetbrains.intellij.gradle:gradle-tooling-extension
url = 'https://www.jetbrains.com/intellij-repository/snapshots'
}
}
dependencies {
implementation "org.parchmentmc.feather:io-moshi:${featherVersion}"
implementation "com.squareup.moshi:moshi-kotlin:${moshiVersion}"
implementation "net.minecraftforge:srgutils:${srgutilsVersion}"
compileOnly sourceSets.gradleToolingExtension.output
runtimeOnly files(gradleToolExtensionJar)
// ASM
implementation "org.ow2.asm:asm:${asmVersion}"
implementation "org.ow2.asm:asm-tree:${asmVersion}"
implementation "org.ow2.asm:asm-analysis:${asmVersion}"
gradleToolingExtensionCompileOnly "org.codehaus.groovy:groovy-all:${groovyVersion}"
gradleToolingExtensionCompileOnly "com.jetbrains.intellij.gradle:gradle-tooling-extension:${gradleToolingExtensionVersion}"
gradleToolingExtensionCompileOnly "org.jetbrains:annotations:${jetbrainsAnnotationsVersion}"
}
configurations {
implementation {
exclude group: 'org.jetbrains.kotlin'
}
}
intellij {
pluginName = project.properties.pluginName
type = platformType
version = platformVersion
downloadSources = true
updateSinceUntilBuild = false
plugins = ['java', 'gradle', 'Groovy', 'ByteCodeViewer']
sandboxDir = layout.projectDirectory.dir(".sandbox").toString()
}
license {
header = file('HEADER')
ext {
name = 'Scribe'
year = 2023
holder = 'ParchmentMC'
}
exclude '**/bytecode-utils.kt', '**/class-utils.kt', '**/MemberReference.kt', '**/psi-utils.kt', '**/gradle-util.kt'
}
idea.module.excludeDirs.add(project.file(intellij.sandboxDir.get()))
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
freeCompilerArgs = ['-Xjvm-default=all']
}
}
compileGradleToolingExtensionJava {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(11)
}
options.bootstrapClasspath = files(javaCompiler.map { it.metadata.installationPath.file("jre/lib/rt.jar") })
options.release = 6
options.compilerArgs = ['-Xlint:-options']
}
compileGradleToolingExtensionGroovy {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(11)
}
sourceCompatibility = targetCompatibility = '1.6'
options.compilerArgs = ['-Xlint:-options', '-proc:none']
}