-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
73 lines (66 loc) · 1.82 KB
/
Copy pathbuild.gradle
File metadata and controls
73 lines (66 loc) · 1.82 KB
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
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
}
configure(subprojects) {
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.6
}
subprojects {
version = '0.0.1-SNAPSHOT'
ext.appName = 'egu2016'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
}
// Clearing Eclipse project data in root folder:
tasks.eclipse.doLast {
delete '.project'
delete '.classpath'
delete '.settings/'
}
// Run `gradle pack` task to generate skin.atlas file at assets/ui.
import com.badlogic.gdx.tools.texturepacker.TexturePacker
task pack << {
render('./raw/icons/', 100)
render('./raw/effects/', 70)
render('./raw/people/', 150)
// Note that if you need multiple atlases, you can duplicate the
// TexturePacker.process invocation and change paths to generate
// additional atlases with this task.
TexturePacker.process(
'raw/ui', // Raw assets path.
'assets/ui', // Output directory.
'skin' // Name of the generated atlas (without extension).
)
}
def render(String dirName, size) {
def root = file(dirName)
root.listFiles().each {
def name = it.name.split("\\.")[0]
runProcess(root, "inkscape -z -w $size -h $size -e ../ui/${name}.png ${name}.svg")
}
}
def runProcess(dir, String commands) {
println commands
def builder = new ProcessBuilder(commands.split(' '))
builder.inheritIO()
builder.directory(dir)
builder.start().waitFor()
}