Merge remote-tracking branch 'event' into world-loader-anvil
# Conflicts: # core/src/main/java/mc/core/CoreEventListener.java
This commit is contained in:
40
build.gradle
40
build.gradle
@@ -1,3 +1,6 @@
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
@@ -85,6 +88,43 @@ subprojects {
|
||||
task cleanDep(type: Delete) {
|
||||
delete 'libs'
|
||||
}
|
||||
|
||||
/**
|
||||
* Сборка
|
||||
*/
|
||||
task deploy() {
|
||||
dependsOn { jar }
|
||||
|
||||
doLast {
|
||||
def deployDir = System.getProperty("deploy")
|
||||
if (deployDir == null) {
|
||||
println "Need param -Ddeploy=path/to/deploy"
|
||||
throw new Exception("Need param -Ddir=path/to/deploy")
|
||||
}
|
||||
|
||||
def target = Paths.get(deployDir, jar.archivePath.getName())
|
||||
if (Files.notExists(target)) {
|
||||
println jar.archivePath
|
||||
Files.copy(jar.archivePath.toPath(), target)
|
||||
}
|
||||
|
||||
|
||||
|
||||
def libsDir = System.getProperty("libs", deployDir+File.separator+"libs")
|
||||
if (Files.notExists(Paths.get(libsDir))) {
|
||||
(new File(libsDir)).mkdirs()
|
||||
}
|
||||
|
||||
def libsCollection = configurations.compile + configurations.runtime - configurations.compile_excludeCopy
|
||||
libsCollection.each{ libFile ->
|
||||
target = Paths.get(libsDir, libFile.getName())
|
||||
if (Files.notExists(target)) {
|
||||
println libFile
|
||||
Files.copy(libFile.toPath(), target)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user