forked from MovingBlocks/DestinationSol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (125 loc) · 4.69 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
152
153
154
155
156
157
apply from: 'config/gradle/ide.gradle'
buildscript {
repositories {
mavenCentral()
}
dependencies {
// Git plugin for Gradle
classpath 'org.ajoberstar:gradle-git:0.6.3'
}
}
// Git plugin details at https://github.com/ajoberstar/gradle-git
import org.ajoberstar.gradle.git.tasks.*
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
version = '2.0.0'
ext {
appName = 'DestinationSol'
gdxVersion = '1.9.8'
roboVMVersion = '2.3.3'
}
}
repositories {
mavenLocal()
// Good ole Maven central
mavenCentral()
// Repos for LibGDX
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
// Terasology Artifactory for any shared libs
maven { url "http://artifactory.terasology.org/artifactory/virtual-repo-live" }
maven { url "https://maven.google.com" }
}
configurations {
codeMetrics
}
dependencies {
// Config for our code analytics lives in a centralized repo: https://github.com/MovingBlocks/TeraConfig
codeMetrics group: 'org.terasology.config', name: 'codemetrics', version: '1.2.0', ext: 'zip'
}
task extractConfig(type: Copy) {
description = "Extracts our configuration files from the zip we fetched as a dependency"
from {
configurations.codeMetrics.collect {
zipTree(it)
}
}
into "$rootDir/config/metrics"
}
// Helper that returns a list of all local Destination Sol module projects
def destinationSolModules() {
subprojects.findAll {it.parent.name == 'modules'}
}
tasks.eclipse.doLast {
delete ".project"
}
idea {
project {
// Set JDK
jdkName = '1.8'
wildcards -= '!?*.groovy'
ipr {
withXml { xmlProvider ->
// Apply a bunch of tweaks to IntelliJ config - all defined in ide.gradle
// Part reason for separate file was in case a module needs to define something it cannot do so in a project block
def iprNode = xmlProvider.asNode()
ideaActivateCheckstyle(iprNode)
ideaActivateCopyright(iprNode)
ideaActivateAnnotations(iprNode)
ideaActivateGit(iprNode)
ideaActivateGradle(iprNode)
}
// Sets sourceCompatibility within IntelliJ (without this root build having the Java plugin applied)
whenMerged { project ->
project.jdk.languageLevel = 'JDK_1_8'
}
}
}
// Tweaks to the .iws
workspace.iws.withXml { xmlProvider ->
def iwsNode = xmlProvider.asNode()
ideaMakeAutomatically(iwsNode)
ideaRunConfig(iwsNode)
}
}
cleanIdea.doLast {
new File('DestinationSol.iws').delete()
new File('config/metrics').deleteDir()
println "Cleaned root - don't forget to re-extract code metrics config! 'gradlew extractConfig' will do so, or 'gradlew idea' (or eclipse)"
}
task(fetchAndroid, type: GitClone) {
description = 'Git clones the Android facade source from GitHub'
// Repo name is the dynamic part of the task name
def repo = 'DestSolAndroid'
// Default GitHub account to use. Supply with -PgithubAccount="TargetAccountName" or via gradle.properties
def githubHome = 'MovingBlocks'
def destination = file('android')
// Don't clone this repo if we already have a directory by that name (also determines Gradle UP-TO-DATE)
enabled = !destination.exists()
//println "fetchAndroid requested for $repo from Github under $githubHome - exists already? " + !enabled
// Do the actual clone if we don't have the directory already
uri = "https://github.com/$githubHome/" + repo + ".git"
//println "Fetching $repo from $uri"
destinationPath = destination
bare = false
}
task(fetchGwt, type: GitClone) {
description = 'Git clones the GWT facade source from GitHub'
// Repo name is the dynamic part of the task name
def repo = 'DestSolGwt'
// Default GitHub account to use. Supply with -PgithubAccount="TargetAccountName" or via gradle.properties
def githubHome = 'MovingBlocks'
def destination = file('gwt')
// Don't clone this repo if we already have a directory by that name (also determines Gradle UP-TO-DATE)
enabled = !destination.exists()
//println "fetchGwt requested for $repo from Github under $githubHome - exists already? " + !enabled
// Do the actual clone if we don't have the directory already
uri = "https://github.com/$githubHome/" + repo + ".git"
//println "Fetching $repo from $uri"
destinationPath = destination
bare = false
}
task wrapper(type: Wrapper) {
gradleVersion = '2.10'
}