GitLab update scheduled for Friday, January 21th between 08:15 and 08:45 CET. If unpleasant, please contact René or Martin.

build.gradle 3.88 KB
Newer Older
1
2
apply plugin: 'jastadd'
apply plugin: 'application'
3
apply plugin: 'com.google.protobuf'
4
5
6

sourceCompatibility = 1.8

7
mainClassName = 'de.tudresden.inf.st.ros2rag.starter.StarterMain'
8
9
10
11
12
13
14
15
16

repositories {
    jcenter()
}

buildscript {
    repositories.jcenter()
    dependencies {
        classpath 'org.jastadd:jastaddgradle:1.13.3'
17
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12'
18
19
20
    }
}

René Schöne's avatar
René Schöne committed
21
22
23
24
configurations {
    baseRuntimeClasspath
}

25
sourceSets.main.java.srcDir "src/gen/java"
26
jar.manifest.attributes('Main-Class': 'de.tudresden.inf.st.ros2rag.starter.StarterMain')
27
28

dependencies {
René Schöne's avatar
René Schöne committed
29
30
    implementation project (':ros2rag.base')
    baseRuntimeClasspath project (':ros2rag.base')
31
32
33
    implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: "${jackson_version}"
    implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jackson_version}"
    implementation group: 'net.sf.beaver', name: 'beaver-rt', version: '0.9.11'
34
    compile 'com.google.protobuf:protobuf-java:3.0.0'
René Schöne's avatar
René Schöne committed
35
    compile group: 'org.fusesource.mqtt-client', name: 'mqtt-client', version: '1.15'
36
37
38
39
40
41
42
43
44
45

    jastadd2 "org.jastadd:jastadd:2.3.4"
}

test {
    useJUnitPlatform()

    maxHeapSize = '1G'
}

René Schöne's avatar
René Schöne committed
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
// Input files for relast
def relastFiles = ["src/gen/jastadd/Grammar.relast"]

// phases: Ros2Rag -> RelAst -> JastAdd
// phase: Ros2Rag
task ros2rag(type: JavaExec) {
    classpath = configurations.baseRuntimeClasspath

    group = 'Build'
    main = 'org.jastadd.ros2rag.compiler.Compiler'

    args([
            '--verbose',
            '--outputDir=src/gen/jastadd',
            '--inputGrammar=src/main/jastadd/RobotModel.relast',
            '--inputRos2Rag=src/main/jastadd/Definitions.ros2rag',
            '--rootNode=Model'
    ])
}

// phase: RelAst
task relastToJastAdd(type: JavaExec) {
    group = 'Build'
    main = "-jar"

    args(["../libs/relast.jar",
            "--grammarName=./src/gen/jastadd/model",
            "--useJastAddNames",
            "--listClass=java.util.ArrayList",
            "--jastAddList=JastAddList",
            "--resolverHelper",
            "--file"]
    +
            relastFiles)

    inputs.files relastFiles
    outputs.files file("./src/gen/jastadd/model.ast"), file("./src/gen/jastadd/model.jadd")
}

// phase: JastAdd
86
87
88
89
jastadd {
    configureModuleBuild()
    modules {
        //noinspection GroovyAssignabilityCheck
René Schöne's avatar
René Schöne committed
90
        module("ros2rag starter") {
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

            java {
                basedir "src/"
                include "main/**/*.java"
                include "gen/**/*.java"
            }

            jastadd {
                basedir "src/"
                include "main/jastadd/**/*.ast"
                include "main/jastadd/**/*.jadd"
                include "main/jastadd/**/*.jrag"
                include "gen/jastadd/**/*.ast"
                include "gen/jastadd/**/*.jadd"
                include "gen/jastadd/**/*.jrag"
            }
        }
    }

    cleanGen.doFirst {
        delete "src/gen/java/org"
        delete "src/gen-res/BuildInfo.properties"
    }

    preprocessParser.doFirst {

        args += ["--no-beaver-symbol"]

    }

René Schöne's avatar
René Schöne committed
121
    module = "ros2rag starter"
122

René Schöne's avatar
René Schöne committed
123
    astPackage = 'de.tudresden.inf.st.ros2rag.starter.ast'
124
125
126
127
128
129
130
131
132
133
134
135

    genDir = 'src/gen/java'

    buildInfoDir = 'src/gen-res'

    // jastaddOptions = ["--lineColumnNumbers", "--visitCheck=true", "--rewrite=cnta", "--cache=all"]
    // default options are: '--rewrite=cnta', '--safeLazy', '--visitCheck=false', '--cacheCycle=false'
    extraJastAddOptions = ["--lineColumnNumbers", '--List=JastAddList']
}

// Workflow configuration for phases
generateAst.dependsOn relastToJastAdd
René Schöne's avatar
René Schöne committed
136
relastToJastAdd.dependsOn ros2rag
137
138
139
140
141
142
143
144
145

protobuf {
    // create strange directories, so use default here
//    generatedFilesBaseDir = "$projectDir/src/gen/java"
    protoc {
        // The artifact spec for the Protobuf Compiler
        artifact = 'com.google.protobuf:protoc:3.0.0'
    }
}