-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (93 loc) · 2.93 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
buildscript {
ext.kotlin_version = '1.2.51'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "com.diffplug.gradle.spotless" version "3.14.0"
id "com.github.johnrengelman.shadow" version "2.0.4"
}
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: "kotlin"
version = '1.4.0'
description = 'XolioZ is a DayZ clone originally made as a Minecraft server'
archivesBaseName = "XolioZ"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
spotless {
java {
licenseHeaderFile 'codequality/header-include-notice.txt'
//importOrder 'java', 'javax', 'org', 'com', 'com.diffplug', ''
removeUnusedImports()
eclipse().configFile 'codequality/style.xml'
}
kotlin {
indentWithTabs()
licenseHeaderFile 'codequality/header-include-notice.txt'
}
}
jar {
//from 'plugin.info'
}
// In this section you declare where to find the dependencies of your project
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url "http://maven.xol.io/repository/public/"
}
}
ext {
csApiBuiltAgainst = '123'
coreContentVersionBuiltAgainst = '130'
}
subprojects {
ext {
csApiBuiltAgainst = rootProject.csApiBuiltAgainst
coreContentVersionBuiltAgainst = rootProject.coreContentVersionBuiltAgainst
}
}
dependencies {
compile group: 'io.xol.chunkstories', name: 'api', version: csApiBuiltAgainst
compile group: 'io.xol.chunkstories', name: 'core', version: coreContentVersionBuiltAgainst
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
task mod(type: Zip) {
//dependsOn(jar) //It figures it out on it's own apparently, this build system is smarter than me :(
from 'res/'
from configurations.runtime.allArtifacts.files
archiveName = "xolioz_content.zip"
}
task install(type: Copy) {
dependsOn mod
File csDir = null;
if(project.hasProperty('chunkStoriesDirectory')) {
csDir = new File(chunkStoriesDirectory);
}
else {
println 'Did not found a configured directory for the game files, using default one'
String appDataFolder = System.getProperty("user.dir");
if(System.getProperty("os.name").toLowerCase().startsWith("win"))
appDataFolder = System.getenv("APPDATA");
else if(System.getProperty("os.name").toLowerCase().startsWith("lin"))
appDataFolder = System.getProperty("user.home");
else if(System.getProperty("os.name").toLowerCase().startsWith("mac"))
appDataFolder = System.getProperty("user.home");
csDir = new File(appDataFolder + "/.chunkstories");
}
println csDir.getAbsolutePath()
//for(String s : csDir.list())
// println s
include '**/*.zip'
include '**/*.jar'
from 'build/distributions/'
into csDir.getPath() + '/mods/';
}