-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
70 lines (56 loc) · 1.94 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
// Information for all projects
// The default tasks for all projects
defaultTasks 'removeOldReleases', 'build', 'createReleaseJar', 'install'
allprojects
{
version = "2.7.2 for Forge 1.7.10 v7"
group = "com.khorn.terraincontrol"
// Give this a value in a child project to change the name in your IDE
// Otherwise it will use the default name. In the case of the project
// 'platforms:bukkit', the default name is invalid because it contains a slash
ext.ideProjectName = null
// Version of the shadow plugin
ext.shadowVersion = '1.0.2'
}
// Information for all subprojects
// (common, forge and bukkit, but not this file)
subprojects
{ task ->
task.plugins.withType(org.gradle.api.plugins.JavaBasePlugin)
{
// We're still on Java 6
sourceCompatibility = '1.6'
// Generate Eclipse config files when using "gradle eclipse"
task.apply plugin: 'eclipse'
// Generate IntelliJ IDEA config files
task.apply plugin: 'idea'
// Change project name in Eclipse
// See comment above about the ideProjectName
task.eclipse.project.file.whenMerged
{ project ->
if (task.project.ext.ideProjectName != null)
{
project.name = task.project.ext.ideProjectName
}
}
// Since we're renaming projects, we need to rename the
// dependency 'common' to 'TerrainControl-Common'
task.eclipse.classpath.file.whenMerged
{ classpath ->
classpath.entries.findAll{ entry -> entry.path == "/common" }*.path = "/TerrainControl-Common"
}
}
// Generate a pom.xml, upload to local Maven repository
apply plugin: 'maven'
}
task removeOldReleases <<
{
allprojects
{
File distributionsFolder = new File(project.buildDir, "distributions")
if (distributionsFolder.exists())
{
distributionsFolder.deleteDir()
}
}
}