This repository has been archived by the owner on Aug 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
74 lines (63 loc) · 1.48 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
import groovy.json.JsonSlurper
import ru.pearx.jnome.generator.tasks.GenerateTask
import ru.pearx.jnome.generator.tasks.StripTask
/*buildscript {
repositories {
maven {
url uri('Generator/build/repo')
}
}
dependencies {
classpath project(':Jnome:Generator')
}
}*/
group 'ru.pearx.jnome'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: "jnome-generator"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
}
sourceSets {
autogen {
java {
srcDir "src/autogen/java"
}
}
}
File autogen = file("$buildDir/autogen")
File preprocessed = file("$autogen/preprocessed.h")
File stripped = file("$autogen/stripped.h")
File generatedDir = file("$autogen/generated")
List<String> includes = new JsonSlurper().parseText(preprocessing_include_directories)
task mkdirs() {
autogen.mkdirs()
}
task preprocess(type: Exec) {
setExecutable(gcc_executable)
List<String> args = ["-E", "${preprocessing_input_file}"];
for(String s : includes)
{
args.add("-I")
args.add("${s}")
}
args.add("-o")
args.add(preprocessed.toString())
setArgs(args)
}
task strip(type: StripTask) {
input = preprocessed
output = stripped
whitelistFiles = includes
}
task generate(type: GenerateTask) {
inputFile stripped
outputDir generatedDir
}
preprocess.dependsOn(mkdirs)
strip.dependsOn(preprocess)
generate.dependsOn(strip)
build.dependsOn(generate)