-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
74 lines (54 loc) · 2.06 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
import groovy.json.JsonSlurper
plugins {
id "java"
}
repositories {
mavenCentral()
maven { url "https://repo.gradle.org/gradle/libs-releases" } // for gradle-tooling-api
flatDir { dirs mcreator_path + '/lib' }
}
group = 'net.mcreator.demojavaplugin'
version = new JsonSlurper().parse(file('src/main/resources/plugin.json'))['info']['version']
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
configurations {
implementation.extendsFrom export
}
dependencies {
implementation project(':MCreator')
project(':MCreator').afterEvaluate(() ->
project(":MCreator").configurations.named("implementation").get().dependencies.each {
//noinspection ForeignDelegate
implementation it
}
)
// Uncomment the following two lines if you need to use JavaFX in your plugin
//implementation group: 'org.openjfx', name: 'javafx-web', version: '21.0.2'
//implementation group: 'org.openjfx', name: 'javafx-swing', version: '21.0.2'
// Use "export" configuration for dependencies that should be included in the plugin (if MCreator does not provide them)
// export group: 'org.example', name: 'example-library', version: '1.2.3'
}
tasks.jar {
archiveFileName.set("demo-plugin.zip")
from {
configurations.export.collect { it.isDirectory() ? it : zipTree(it) }
}
}
tasks.register('runMCreatorWithPlugin', JavaExec) {
dependsOn jar
environment("MCREATOR_PLUGINS_FOLDER", file("./build/libs"))
environment("MCREATOR_PLUGINS_DEV", "")
jvmArgs '--add-opens', 'java.base/java.lang=ALL-UNNAMED'
classpath = project(':MCreator').sourceSets.main.runtimeClasspath
main = 'net.mcreator.Launcher'
workingDir = mcreator_path
}
subprojects { subproject ->
subproject.plugins.withType(JavaPlugin) {
test {
dependsOn rootProject.jar
environment("MCREATOR_PLUGINS_FOLDER", new File(rootProject.projectDir, "/build/libs"))
environment("MCREATOR_PLUGINS_DEV", "")
workingDir = mcreator_path
}
}
}