This repository has been archived by the owner on Jul 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
151 lines (123 loc) · 3.42 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
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' }
}
plugins {
id "com.jfrog.bintray" version "1.4"
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven-publish'
group 'org.squiddev'
version "${project.mod_version}"
sourceCompatibility = 1.6
minecraft {
version = project.mc_version + "-" + project.forge_version
runDir = "run-${project.mc_version}"
mappings = "${project.mappings}"
replace '${mod_version}', project.mod_version
}
repositories {
mavenCentral()
ivy {
name = "ComputerCraft"
artifactPattern "http://addons-origin.cursecdn.com/files/2291/384/[module][revision](.[ext])"
}
maven {
name = "squiddev"
url = "https://dl.bintray.com/squiddev/maven"
}
maven {
name = "snapshots"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
configurations {
shade
compile.extendsFrom shade
}
dependencies {
compile "ComputerCraft:ComputerCraft:${cc_version}"
compile "org.squiddev:CCTweaks:${mc_version}-1.3.2:dev"
compileOnly('org.squiddev:ConfigGen:1.2.5') { exclude group: 'net.minecraftforge' }
shade('org.squiddev:luaj.luajc:1.0.9') {
// We provide a custom LuaJ source with ComputerCraft
exclude group: 'org.luaj'
// Bundled with CCTweaks-Lua
exclude group: 'org.ow2.asm'
}
shade('org.squiddev:cobalt.luajc:1.1.0') {
// Bundled with CCTweaks-Lua
exclude module: 'Cobalt'
exclude group: 'org.ow2.asm'
}
shade('net.sandius.rembulan:rembulan-runtime:0.1-SNAPSHOT') { exclude group: 'org.ow2.asm' }
shade('net.sandius.rembulan:rembulan-compiler:0.1-SNAPSHOT') { exclude group: 'org.ow2.asm' }
shade('net.sandius.rembulan:rembulan-stdlib:0.1-SNAPSHOT') { exclude group: 'org.ow2.asm' }
testCompile group: 'junit', name: 'junit', version: '4.11'
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "mod_version", project.mod_version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// Replace mod_version and mc_version
expand 'mod_version': mod_version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
from configurations.shade
.collect { it.isDirectory() ? it : zipTree(it) }
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['mavenJava']
publish = true
pkg {
repo = 'maven'
name = 'cctweaks-runtimes'
licenses = ['MIT']
vcsUrl = 'https://github.com/SquidDev-CC/CCTweaks-Runtimes'
version {
name = project.version
desc = 'Additional runtimes for CCTweaks-Lua'
released = new Date()
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint"
}
tasks.withType(Jar) {
exclude "**/*.java"
}
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}