forked from Hugobros3/chunkstories-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
130 lines (107 loc) · 2.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
// Apply the java plugin to add support for Java
buildscript {
repositories {
mavenCentral()
maven { url "http://maven.xol.io/repository/public/" }
//maven { url 'https://jitpack.io' }
}
dependencies {
//classpath 'com.github.johni0702:gradle-ecj-plugin:795736c7bd085c6ff3a5fbd3f5d2913c94fe589e'
classpath 'de.johni0702.gradle:gradle-ecj-plugin:1.1-JAVA9'
}
}
plugins {
id "com.github.hierynomus.license" version "0.14.0"
}
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "http://maven.xol.io/repository/public/"
}
}
description = 'The base content chunkstories is built on.'
group = 'io.xol.chunkstories'
version = '127'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
ext {
apiRevisionBuiltAgainst = '119'
useEclipseCompiler = true
}
dependencies {
compile group: 'io.xol.chunkstories', name: 'api', version: apiRevisionBuiltAgainst
compile group: 'io.xol.enklume', name: 'enklume', version: 100
}
if(ext.useEclipseCompiler) {
apply plugin: 'de.johni0702.ecj'
println "Using ECJ compiler"
}
license {
header rootProject.file('codequality/header-include-notice.txt')
strictCheck true
mapping {
java='DOUBLESLASH_STYLE'
}
}
task buildContentPack(type: Zip) {
//Require Gradle to build the content jar first
dependsOn jar
//Include all resources, but don't bundle any project file from content authoring tools
//Keeping those in the repo is fine, but users don't need it!
from('res/'){
exclude("**/*.pdn")
exclude("**/*.ps")
exclude("**/*.xcf")
exclude("**/*.aup")
}
//We want the final archive to bear our mod name
archiveName = "core_content.zip";
//archiveName = "${rootProject.name}.zip"
}
jar {
destinationDir = file("$rootDir/res")
version = null
}
clean {
delete configurations.runtime.allArtifacts.files
}
artifacts {
archives jar
archives buildContentPack
}
configurations {
deployerJars
}
dependencies {
deployerJars "org.apache.maven.wagon:wagon-ssh:3.0.0"
}
//Create a properties.gradle with login credentials to use this.
//Watch out: wagon-ssh is an old mess and WILL NOT TAKE EdDSA host keys
//You MUST ask the server for one of those and replace whatever you had for it in known_hosts
if(hasProperty('uploadUsername')) {
println 'Login credentials found'
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
if(project.hasProperty('uploadPrivateKey')) {
println 'Found private key'
repository(url: "scp://xol.io/home/maven-user/maven-repo") {
authentication(userName: uploadUsername, privateKey: uploadPrivateKey)
}
}
else {
println 'Found password'
repository(url: "scp://xol.io/home/maven-user/maven-repo") {
authentication(userName: uploadUsername, password: uploadPassword)
}
}
}
}
}
}