forked from JavaSaBr/jmb-shader-nodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
189 lines (142 loc) · 4.89 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import java.nio.file.Files
import java.nio.file.Paths
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'org.junit.platform.gradle.plugin'
group = 'com.spaceshift'
version = '1.1.0'
ext.artifactId = 'shader-nodes'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.compilerArgs += '-parameters'
}
ext.junitPlatformVersion = "1.0.0"
ext.junitJupiterVersion = "5.0.0"
ext.log4jVersion = '2.6.2'
junitPlatform {
filters {
engines {
}
tags {
}
}
logManager 'org.apache.logging.log4j.jul.LogManager'
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
configurations {
pluginDependences
}
dependencies {
compile 'com.github.JavaSabr:jmonkeybuilder:develop-SNAPSHOT'
testCompile "org.junit.platform:junit-platform-commons:$junitPlatformVersion"
testRuntime "org.junit.platform:junit-platform-engine:$junitPlatformVersion"
testCompile "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
testRuntime "org.apache.logging.log4j:log4j-core:$log4jVersion"
testRuntime "org.apache.logging.log4j:log4j-jul:$log4jVersion"
// Only needed to run tests in an (IntelliJ) IDE(A) that bundles an older version
testCompile "org.junit.platform:junit-platform-launcher:$junitPlatformVersion"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
task cleanPluginFolders(type: Delete) {
doFirst {
def projectFolder = Paths.get("$buildDir").getParent()
def embeddedPluginsFolder = projectFolder.resolve("embedded-plugins")
def deployPlugin = projectFolder.resolve("deploy-plugin")
if (Files.exists(embeddedPluginsFolder)) {
GFileUtils.deleteDirectory(embeddedPluginsFolder.toFile())
}
if (Files.exists(deployPlugin)) {
GFileUtils.deleteDirectory(deployPlugin.toFile())
}
}
}
task createPluginFolders(dependsOn: 'cleanPluginFolders') {
doFirst {
def projectFolder = Paths.get("$buildDir").getParent()
def embeddedPluginsFolder = projectFolder.resolve("embedded-plugins")
Files.createDirectory(embeddedPluginsFolder)
def pluginFolder = embeddedPluginsFolder.resolve(String.valueOf(artifactId))
Files.createDirectory(pluginFolder)
def configuration = configurations.pluginDependences
def dependencies = configuration.dependencies
if (dependencies.isEmpty()) {
return
}
def libsFolder = pluginFolder.resolve("libs")
Files.createDirectory(libsFolder)
}
}
task copyPluginDependences(type: Copy, dependsOn: ['install', 'createPluginFolders']) {
def configuration = configurations.pluginDependences
def dependencies = configuration.dependencies
if (dependencies.isEmpty()) {
return
}
def projectFolder = Paths.get("$buildDir").getParent()
def embeddedPluginsFolder = projectFolder.resolve("embedded-plugins")
def pluginFolder = embeddedPluginsFolder.resolve(String.valueOf(artifactId))
def libsFolder = pluginFolder.resolve("libs")
into libsFolder.toString()
from configuration
}
task preparePlugin(type: Copy, dependsOn: 'copyPluginDependences') {
def projectFolder = Paths.get("$buildDir").getParent()
def embeddedPluginsFolder = projectFolder.resolve("embedded-plugins")
def pluginFolder = embeddedPluginsFolder.resolve(String.valueOf(artifactId))
from jar
into pluginFolder.toString()
}
task deployPlugin(type: Zip, dependsOn: 'preparePlugin') {
doFirst {
def projectFolder = Paths.get("$buildDir").getParent()
def deployPluginFolder = projectFolder.resolve("deploy-plugin")
if (!Files.exists(deployPluginFolder)) {
Files.createDirectory(deployPluginFolder)
}
}
def projectFolder = Paths.get("$buildDir").getParent()
def embeddedPluginsFolder = projectFolder.resolve("embedded-plugins")
def pluginFolder = embeddedPluginsFolder.resolve(String.valueOf(artifactId))
def deployPluginFolder = projectFolder.resolve("deploy-plugin")
from pluginFolder.toString()
destinationDir deployPluginFolder.toFile()
}
task wrapper(type: Wrapper) {
gradleVersion = '4.3'
}
defaultTasks 'install'
// To specify a license in the pom:
install {
repositories.mavenInstaller {
pom.version = version
pom.artifactId = artifactId
}
}